Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Minor bug in determining teams for gitlab #5294

Merged

Conversation

lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Feb 2, 2025

what

Fix minor bug in determining teams for gitlab where if zero or more than one user is found, we return nil instead of an error.

why

I discovered this while working on #5269.

This is unlikely to ever come up, but the logic here has a subtle bug. When errors.Wrap(err, "...") is passed a nil error, it returns nil. This means if either of these error conditions occurred, we would incorrectly be returning nil for error instead of the error.

tests

I added some unit tests to cover these cases, and confirmed they failed on main.

references

@lukemassa lukemassa requested review from a team as code owners February 2, 2025 23:33
@lukemassa lukemassa requested review from jamengual, nitrocode and X-Guardian and removed request for a team February 2, 2025 23:33
@dosubot dosubot bot added bug Something isn't working provider/gitlab labels Feb 2, 2025
@github-actions github-actions bot added the go Pull requests that update Go code label Feb 2, 2025
@lukemassa lukemassa force-pushed the fix_minor_bug_in_get_teams_in_gitlab branch from 994c26a to c5fcce0 Compare February 2, 2025 23:34
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 3, 2025
@lukemassa lukemassa merged commit c2c25ae into runatlantis:main Feb 3, 2025
39 checks passed
bub3n pushed a commit to bub3n/atlantis that referenced this pull request Feb 3, 2025
bub3n pushed a commit to bub3n/atlantis that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go Pull requests that update Go code lgtm This PR has been approved by a maintainer provider/gitlab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove use of deprecated package pkg/errors
2 participants