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

chore: fix label type in gitlab testdata #4091

Merged

Conversation

lukemassa
Copy link
Contributor

what

Change type of labels from string to array in gitlab test data.

why

Debugging why unit tests on #4028 are failing, it turns out that label parsing was updated in 0.95 such that the empty string is failing:

unexpected error: json: cannot unmarshal string into Go struct field alias.labels of type gitlab.Labels

This doesn't appear to correspond to any actual changes in the API, so I don't think any non-test code needs to be updated, it's just whenever this testdata was written it was filled in with the wrong type. If you look even now at an MR in the gitlab API, you'll see it's an empty array, not an empty string:

atlantis % curl -sS 'https://gitlab.com/api/v4/projects/lkysow%2Fatlantis-example/merge_requests/13'  | jq .labels
[]

tests

Running unit tests in #4028 and noting that it passes where it failed before.

references

Makes #4028 pass

@lukemassa lukemassa requested review from a team as code owners December 22, 2023 18:24
@lukemassa lukemassa requested review from jamengual, nitrocode and X-Guardian and removed request for a team December 22, 2023 18:24
@lukemassa lukemassa merged commit 7faa03f into runatlantis:main Dec 23, 2023
23 checks passed
@lukemassa
Copy link
Contributor Author

/cherry-pick release-0.27

ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
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.

2 participants