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: return revision from getGitGeneratorInfo #8979

Merged

Conversation

reiniertimmer
Copy link
Contributor

@reiniertimmer reiniertimmer commented Apr 4, 2022

Originally posted here argoproj/applicationset#520 but moved to argo-cd since the applicationset codes is now integrated here.

Signed-off-by: Reinier Timmer reinier.timmer@ah.nl

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

Description

It seems that the applicationset webhook endpoint is not working completely as expected when tracking a repository branch (other than the default branch).

It turns out that the revision that is being used to compare against the targetRevision is always empty. So the test on https://github.com/argoproj/argo-cd/blob/master/applicationset/utils/webhook.go#L247 would always return false.

The revision field is already being evaluated on https://github.com/argoproj/argo-cd/blob/master/applicationset/utils/webhook.go#L147, but for some reason it was never included in the response.

After this change, we verified this on our own installation (when the code was still in the separate applicationset project) and there the webhook processing does recognize the correct branches on push events from GitHub. It is not live-tested yet after the applicationset code was moved to argo-cd

Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>
@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #8979 (df5428f) into master (3c00de8) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #8979      +/-   ##
==========================================
- Coverage   44.96%   44.92%   -0.04%     
==========================================
  Files         212      212              
  Lines       25264    25264              
==========================================
- Hits        11361    11351      -10     
- Misses      12296    12309      +13     
+ Partials     1607     1604       -3     
Impacted Files Coverage Δ
applicationset/utils/webhook.go 70.46% <100.00%> (+0.19%) ⬆️
applicationset/services/scm_provider/github.go 63.52% <0.00%> (-17.65%) ⬇️
util/settings/settings.go 48.10% <0.00%> (ø)
pkg/apis/application/v1alpha1/hack.go 0.00% <0.00%> (ø)
applicationset/services/scm_provider/utils.go 88.50% <0.00%> (+4.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c00de8...df5428f. Read the comment docs.

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm!

@crenshaw-dev crenshaw-dev merged commit 27d4edd into argoproj:master Apr 4, 2022
wojtekidd pushed a commit to wojtekidd/argo-cd that referenced this pull request Apr 25, 2022
Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>
Signed-off-by: wojtekidd <wojtek.cichon@protonmail.com>
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