Skip to content

Bump gitlab.com/gitlab-org/api/client-go from v0.145.0 to v1.46.0 - #239

Draft
vinamra28 with Copilot wants to merge 3 commits into
mainfrom
copilot/bump-gitlab-sdk-version
Draft

Bump gitlab.com/gitlab-org/api/client-go from v0.145.0 to v1.46.0#239
vinamra28 with Copilot wants to merge 3 commits into
mainfrom
copilot/bump-gitlab-sdk-version

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown

Changes

📝 Description

What changed?

Upgrades gitlab.com/gitlab-org/api/client-go from v0.145.0 to v1.46.0 and fixes all resulting type-mismatch compilation errors caused by the SDK's breaking change of ID fields from intint64.

Fixes across pkg/clients/gitlab/:

  • types.go: GitlabConfig.ParentGroupId intint64
  • users.go:
    • PerPage comparison: len(users) < opt.PerPageint64(len(users)) < opt.PerPage
    • strconv.Atoistrconv.ParseInt(..., 10, 64) for FetchUserDetails and DeleteUser
  • teams.go: addToLdapGroup and addGroupAsProjectDeveloper signatures intint64
  • team_membership.go: strconv.Atoistrconv.ParseInt(..., 10, 64) in AddUserToTeam, RemoveUserFromTeam, and ReconcileGroupParams — required because AddGroupMemberOptions.UserID changed from *int to *int64 in the new SDK

Why 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-go v1.46.0
  • Transitive: github.com/google/go-querystring v1.2.0, golang.org/x/time v0.14.0, golang.org/x/exp updated, google.golang.org/protobuf v1.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

  • N/A

🚀 Deployment

Deploy Steps

  1. N/A

Prerequisites

  • N/A

Post-Deployment Monitoring

  • N/A

Rollback Plan

  • N/A

⚠️ Breaking Changes

  • This PR contains breaking changes
  • Migration guide provided (if applicable)

Details:

  • N/A

⚙️ Configuration Changes

GitlabConfig.ParentGroupId is now int64. Existing YAML/JSON config values remain compatible — Go's JSON/YAML unmarshal handles numeric widening transparently.


✅ Developer Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added positive and negative tests that prove my fix is effective or that my feature works
  • Relevant documentation (README, tech specs, etc.) has been added or updated
  • All CI/CD checks are passing
Original prompt

This section details on the original issue you should resolve

<issue_title>Bump gitlab dependency to latest version</issue_title>
<issue_description>## Current State

At the moment, the gitlab sdk getting used is v0.145.0 which is quite old. Dependabot tried to upgrade the dependency in #223 but it seems there are some breaking changes which needs to be addressed.

Acceptance Criteria

Bump the gitlab sdk to latest version while ensuring that all the breaking changes are handled properly.</issue_description>

Comments on the Issue (you are @copilot in this section)


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI changed the title [WIP] Update GitLab SDK to latest version and handle breaking changes Bump gitlab.com/gitlab-org/api/client-go from v0.145.0 to v1.46.0 Mar 24, 2026
Copilot AI requested a review from vinamra28 March 24, 2026 07:14
accessLevel := gitlab.DeveloperPermissions
for _, userID := range userIDs {
userIDInt, convErr := strconv.Atoi(userID)
userIDInt, convErr := strconv.ParseInt(userID, 10, 64)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why was this change needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vinamra28

Copy link
Copy Markdown
Member

/gemini review

Copilot AI requested a review from vinamra28 March 29, 2026 11:48

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

Bump gitlab dependency to latest version

2 participants