Skip to content

Conversation

@MuneebUllahKhan222
Copy link
Contributor

Description:

This pull request introduces the following changes:

  1. Dependency Update
  • Updated the gitlab.com/gitlab-org/api/client-go dependency from v0.129.0 to v1.12.0 in go.mod.
  1. Test Adjustments
  • Fixed the test crashing in filesystem_integration_test.go and gitlab_integration_test.go due to missing import of defaults package.
  • Updated the expected metrics in gitlab_integration_test.go to make sure that the test passes.
  • Updated the basic auth, scoped repo test to use creds of non-2fa account as gitlab no longer allows repo to be cloned with password of a 2fa enabled account.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team January 12, 2026 09:35
@MuneebUllahKhan222 MuneebUllahKhan222 requested review from a team as code owners January 12, 2026 09:35
@kashifkhan0771
Copy link
Contributor

Please do not merge this before this one: #4608

I want these changes to go to Enterprise first.

Copy link
Contributor

@kashifkhan0771 kashifkhan0771 left a comment

Choose a reason for hiding this comment

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

Need to resolve the conflicts.

@kashifkhan0771
Copy link
Contributor

Please do not merge this before this one: #4608

Thank you for waiting. The PR is merged, you can resolve the conflicts and we can review this PR.

Copy link
Contributor

@camgunz camgunz left a comment

Choose a reason for hiding this comment

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

LG! Just want that line split up then merge away 👍🏻

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

)
if err != nil {
return nil, fmt.Errorf("could not create Gitlab OAUTH client for %q: %w", s.url, err)
return nil, fmt.Errorf("could not create Gitlab TOKEN client for %q: %w", s.url, err)
Copy link

Choose a reason for hiding this comment

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

Incorrect error message for OAUTH authentication case

Low Severity

The error message in the case "OAUTH": block incorrectly says "could not create Gitlab TOKEN client" instead of "could not create Gitlab OAUTH client". This mismatch between the authentication method being used and the error message could cause confusion when debugging authentication failures.

Fix in Cursor Fix in Web

return nil, fmt.Errorf("could not create Gitlab TOKEN client for %q: %w", s.url, err)
}
return apiClient, nil

Copy link

Choose a reason for hiding this comment

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

Duplicated code between OAUTH and TOKEN cases

Low Severity

The case "OAUTH": block (lines 475-486) and case "TOKEN": block (lines 505-516) now have identical implementations after the library upgrade. Both create an oauth2.StaticTokenSource, call gitlab.NewAuthSourceClient with gitlab.OAuthTokenSource{TokenSource: ts}, and use the same options. This duplication increases maintenance burden since any fix or change would need to be applied in both places. These cases could be combined into case "OAUTH", "TOKEN": to eliminate the redundancy.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

5 participants