fix(reporting/gitlab): bump client-go to v1.9.1, widen IDs to int64 - #7398
Conversation
client-go v1.x widened ID fields from int to int64 across the API surface (User.ID, Issue.ID, ListOptions.Page/PerPage). Adjust the tracker to the new signatures: Integration.userID, the assignee slice, the FormatInt arguments, and ListOptions casts. Keep Options.DuplicateIssuePageSize / DuplicateIssueMaxPages as int — that struct is user-facing YAML and YAML ints round-trip into int64 fine. Cast at the call site only. UpdateIssue and CreateIssueNote signatures also widened, but issue.IID is already int64 in v1.x, so existing call sites compile unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughThis PR upgrades the GitLab API client library from v0.130.1 to v1.9.1, accompanied by type compatibility changes in the Integration implementation. The userID field and related pagination/assignee handling switch from int to int64 types to match the updated API library. ChangesGitLab API Client Upgrade and Type Compatibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Upgrade the GitLab tracker to work with
gitlab.com/gitlab-org/api/client-go v1.x. The v1 release widened ID fields frominttoint64across the API surface (User.ID,Issue.ID,ListOptions.Page/PerPage, assignee slices). Currently nuclei is pinned atv0.130.1so SDK consumers wanting a current client-go version (notably pd-agent) carry a localreplacedirective in theirgo.mod. This PR bumps tov1.9.1and adjusts the tracker source to match.Changes
Dependency:
gitlab.com/gitlab-org/api/client-gov0.130.1→v1.9.1google.golang.org/protobufv1.36.6→v1.36.11(pulled bygo mod tidy)Source —
pkg/reporting/trackers/gitlab/gitlab.go, 5 line changes:Integration.userID:int→int64assigneeIDs:[]int{i.userID}→[]int64{i.userID}IssueID: strconv.FormatInt(int64(issue.ID), 10)→FormatInt(issue.ID, 10)(ID is alreadyint64)createdIssue.IDListOptions.Page/PerPagenow requireint64; cast at the call siteUpdateIssueandCreateIssueNotesignatures also widened (issue int→issue int64), butgitlab.Issue.IIDis alreadyint64in v1.x, so existingissue.IIDarguments compile unchanged.What stays the same
Options.DuplicateIssuePageSize/DuplicateIssueMaxPagesremainint. That struct is user-facing YAML; YAML ints round-trip intoint64fine, so there's no reason to widen the public surface. The cast happens at the call site only.Test plan
go build ./...cleango vet ./...cleango build ./pkg/reporting/trackers/gitlab/cleanhttptest.Servermocking the four endpoints (GET /user,POST /projects/:id/issues,GET /projects/:id/issues,PUT /projects/:id/issues/:iid). Worth writing because theint64bump is the kind of change that compiles fine but can encode wrong if a forgotten cast silently truncates. Will add in a follow-up commit on this PR.Why pd-agent cares
pd-agent currently carries a
replace gitlab.com/gitlab-org/api/client-go => …directive to use a compatible version locally. Once this PR lands and gets tagged in a nuclei release, pd-agent can drop that replace entirely.Summary by CodeRabbit
Chores
Refactor