Bump gitlab.com/gitlab-org/api/client-go from v0.145.0 to v1.46.0#239
Conversation
Co-authored-by: vinamra28 <26500025+vinamra28@users.noreply.github.com> Agent-Logs-Url: https://github.com/redhat-data-and-ai/usernaut/sessions/54e48e63-75f2-401e-9336-106557c27431
Co-authored-by: vinamra28 <26500025+vinamra28@users.noreply.github.com> Agent-Logs-Url: https://github.com/redhat-data-and-ai/usernaut/sessions/54e48e63-75f2-401e-9336-106557c27431
| accessLevel := gitlab.DeveloperPermissions | ||
| for _, userID := range userIDs { | ||
| userIDInt, convErr := strconv.Atoi(userID) | ||
| userIDInt, convErr := strconv.ParseInt(userID, 10, 64) |
There was a problem hiding this comment.
@copilot why was this change needed?
There was a problem hiding this comment.
In the new SDK v1.46.0, AddGroupMemberOptions.UserID changed from *int to *int64 (see vendor/gitlab.com/gitlab-org/api/client-go/group_members.go line 183). strconv.Atoi returns int, which can no longer be passed as *int64. strconv.ParseInt(userID, 10, 64) returns int64 directly, matching the new field type and avoiding an additional cast.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GitLab API client library to version 1.46.0 and adjusts the codebase to handle the transition from int to int64 for GitLab IDs (users and groups). Specifically, it replaces strconv.Atoi with strconv.ParseInt and updates function signatures and struct fields to use int64. I have no feedback to provide.
Changes
📝 Description
What changed?
Upgrades
gitlab.com/gitlab-org/api/client-gofromv0.145.0tov1.46.0and fixes all resulting type-mismatch compilation errors caused by the SDK's breaking change of ID fields fromint→int64.Fixes across
pkg/clients/gitlab/:types.go:GitlabConfig.ParentGroupIdint→int64users.go:PerPagecomparison:len(users) < opt.PerPage→int64(len(users)) < opt.PerPagestrconv.Atoi→strconv.ParseInt(..., 10, 64)forFetchUserDetailsandDeleteUserteams.go:addToLdapGroupandaddGroupAsProjectDevelopersignaturesint→int64team_membership.go:strconv.Atoi→strconv.ParseInt(..., 10, 64)inAddUserToTeam,RemoveUserFromTeam, andReconcileGroupParams— required becauseAddGroupMemberOptions.UserIDchanged from*intto*int64in the new SDKWhy is this change needed?
v0.145.0 is significantly outdated. Dependabot raised #223 but it was blocked by unresolved breaking changes in the SDK's major version bump.
Dependencies
gitlab.com/gitlab-org/api/client-gov1.46.0github.com/google/go-querystringv1.2.0,golang.org/x/timev0.14.0,golang.org/x/expupdated,google.golang.org/protobufv1.36.11🧪 Testing
Test Coverage
All existing unit tests pass. Integration/e2e tests require a live cluster and are unaffected by this change.
Performance Impact
🚀 Deployment
Deploy Steps
Prerequisites
Post-Deployment Monitoring
Rollback Plan
Details:
⚙️ Configuration Changes
GitlabConfig.ParentGroupIdis nowint64. Existing YAML/JSON config values remain compatible — Go's JSON/YAML unmarshal handles numeric widening transparently.✅ Developer Checklist
Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.