upstream: fix: convert robot account ID columns and sequence to bigint (goharbor/harbor#23633) - #587
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
goharbor/harbor#23633) * fix(robot): convert robot account ID columns and sequence to bigint (#23091) Convert robot.id, creator_ref, role_permission.role_id, and robot_id_seq to bigint in PostgreSQL migration and update swagger.yaml parameters to format: int64. The sequence is capped at 9007199254740991 (2^53 - 1, JavaScript's Number.MAX_SAFE_INTEGER) instead of the bigint maximum, so every possible robot ID stays exactly representable as a JSON number for clients that decode into IEEE 754 doubles (portal, jq, generated JS clients). This still provides ~4 million times the int4 range. Unmarshaling extra_attrs using json.Decoder.UseNumber() and helper task.Int64FromAny ensures numeric IDs above 2^53 (e.g. execution or artifact IDs of other vendors) do not lose precision during scan task callbacks and data exports. Fixes: #23091 Signed-off-by: wang yan <yan-yw.wang@broadcom.com> * resovle the review comments Signed-off-by: wang yan <yan-yw.wang@broadcom.com> --------- Signed-off-by: wang yan <yan-yw.wang@broadcom.com> (cherry picked from commit 95ed8f0eda8b12c01508babc5e27f64c8404464f) Upstream-Commit: 95ed8f0eda8b12c01508babc5e27f64c8404464f Upstream-PR: goharbor/harbor#23633 Upstream-Author: @wy65701436 Cherry-Pick-Status: clean Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks upstream Harbor commit
95ed8f0edfrom goharbor/harbor#23633.Upstream Context
Cherry-Pick Status
Upstream Description
Convert robot account ID columns (
robot.id,creator_ref,role_permission.role_id) and sequencerobot_id_seqtobigintto prevent ID exhaustion when creating ephemeral robot accounts in CI/CD. Also updateswagger.yamlto setformat: int64forrobotIdandcreator_ref.Fixes: #23091
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #(issue)
Please indicate you've done the following:
Review Notes
Upstream-Commit: 95ed8f0eda8b12c01508babc5e27f64c8404464f
Upstream-PR: goharbor/harbor#23633
Cherry-Pick-Status: clean