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: adding of duplicate commit statuses in gitlab #1010

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

mo-rieger
Copy link

@mo-rieger mo-rieger commented Dec 19, 2024

The get commit-status request is paginated and only returns the first 20 commit statuses by default. This change fetches the commit-status by name to avoid multiple requests.

RESOLVES #1009

@mo-rieger mo-rieger force-pushed the mrieger/1009 branch 2 times, most recently from 6a84e2e to 69c9d12 Compare December 20, 2024 07:50
@matheuscscp
Copy link
Member

@mo-rieger Can you please build an image, test this e2e and post some evidence that it works? Then I think we can approve and merge the PR. Thanks!

@mo-rieger
Copy link
Author

mo-rieger commented Jan 31, 2025

Hi @matheuscscp, I built the image and replaced the notification-controller with my custom image.
The patch fixes the bug. The GitLab commit statuses get updated but the GitLab Jobs did not increase over time like it was the case before.
image
Do you need anything else?

@stefanprodan stefanprodan added the area/alerting Alerting related issues and PRs label Jan 31, 2025
@stefanprodan
Copy link
Member

Thanks @mo-rieger for testing this end-to-end 🥇 I expected for GitLab to error out when the commit status doesn't exists, but I guess they just return an empty list so the first time an event is issued, NC will create the status.

Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

Thanks very much for this contribution, @mo-rieger!

@matheuscscp matheuscscp merged commit d9bb201 into fluxcd:main Jan 31, 2025
7 checks passed
@mo-rieger
Copy link
Author

I expected for GitLab to error out when the commit status doesn't exists, but I guess they just return an empty list so the first time an event is issued, NC will create the status.

Exactly, it's always 200 with an empty list if no commit status exist.

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitLab Provider adds commit status for every reconciliation
3 participants