Skip to content

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
mainfrom
upstream/cherry-pick-23633-95ed8f0ed
Open

upstream: fix: convert robot account ID columns and sequence to bigint (goharbor/harbor#23633)#587
github-actions[bot] wants to merge 1 commit into
mainfrom
upstream/cherry-pick-23633-95ed8f0ed

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Cherry-picks upstream Harbor commit 95ed8f0ed from goharbor/harbor#23633.

Upstream Context

Cherry-Pick Status

Upstream Description

Convert robot account ID columns (robot.id, creator_ref, role_permission.role_id) and sequence robot_id_seq to bigint to prevent ID exhaustion when creating ephemeral robot accounts in CI/CD. Also update swagger.yaml to set format: int64 for robotId and creator_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:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Review Notes

  • Generated by the upstream cherry-pick workflow.
  • One upstream commit maps to one Harbor Next PR.
  • If this PR is closed without merge, the workflow will not recreate it.

Upstream-Commit: 95ed8f0eda8b12c01508babc5e27f64c8404464f
Upstream-PR: goharbor/harbor#23633
Cherry-Pick-Status: clean

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants