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

Poll Gitlab until changes are available #3246

Conversation

Jdsleppy
Copy link
Contributor

@Jdsleppy Jdsleppy commented Mar 20, 2023

what

To address #3210 , poll the Gitlab /changes endpoint until changes_count is no longer an empty string. changes_count is one of several fields that changes type when Gitlab's eventual consistency resolves and merge request changes are returned in the response. It's the most relevant choice of field for #3210 which is concerned with Client.GetModifiedFiles().

why

Recent backwards-incompatible changes in Gitlab's API break the workflow in Atlantis where the Gitlab client expects accurate values to be available immediately. Gitlab is documenting this change in behavior and not planning on reverting it, so Atlantis must adapt. Thankfully, experimentation shows that Gitlab returns accurate values after only a few seconds of waiting.

tests

  • Unit tests included in this PR
  • Manual end-to-end tests in an installed instance of Atlantis @jseiser
    • Build image docker buildx build --build-arg ATLANTIS_BASE_TAG_TYPE=debian -t atlantis:dev-debian-58e2552 .
    • Deploy new image via helm chart
    • Create a new MR
    • Auto planning works

references

@Jdsleppy Jdsleppy force-pushed the 3210-poll-gitlab-until-changes-are-available branch from 58e2552 to 8baef8d Compare March 20, 2023 19:35
@jseiser
Copy link

jseiser commented Mar 20, 2023

Ive tested this image, in our environment and its working.

@Jdsleppy Jdsleppy marked this pull request as ready for review March 20, 2023 20:13
@Jdsleppy Jdsleppy requested a review from a team as a code owner March 20, 2023 20:13
@github-actions github-actions bot added go Pull requests that update Go code provider/gitlab labels Mar 20, 2023
@nitrocode nitrocode added this to the v0.23.3 milestone Mar 20, 2023
@nitrocode nitrocode enabled auto-merge (squash) March 20, 2023 20:39
@nitrocode nitrocode disabled auto-merge March 20, 2023 20:40
@nitrocode nitrocode marked this pull request as draft March 20, 2023 20:42
@nitrocode nitrocode assigned nitrocode and unassigned nitrocode Mar 20, 2023
@nitrocode nitrocode marked this pull request as ready for review March 20, 2023 20:42
@nitrocode nitrocode enabled auto-merge (squash) March 20, 2023 20:43
@nitrocode nitrocode merged commit 3214b8c into runatlantis:main Mar 20, 2023
@Jdsleppy Jdsleppy deleted the 3210-poll-gitlab-until-changes-are-available branch March 20, 2023 20:47
@nitrocode
Copy link
Member

@Jdsleppy thank you for the quick fix.

Until v0.22.3 is released, please use the new image built from this merged PR.

dev-debian-3214b8c
dev-alpine-3214b8c

nitrocode pushed a commit that referenced this pull request May 5, 2023
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
go Pull requests that update Go code provider/gitlab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gitlab] - Empty changes list
4 participants