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(applicationset): support webhook with matrix interpolation (#9931) #10236

Merged
merged 2 commits into from Aug 11, 2022

Conversation

sboschman
Copy link
Contributor

Moved the webhook code to its own 'webhook' package, otherwise go ends up in a cyclic dependency error.

fixes #9931

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).

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #10236 (255230e) into master (915bd81) will decrease coverage by 0.07%.
The diff coverage is 55.35%.

@@            Coverage Diff             @@
##           master   #10236      +/-   ##
==========================================
- Coverage   46.18%   46.10%   -0.08%     
==========================================
  Files         226      228       +2     
  Lines       27581    27956     +375     
==========================================
+ Hits        12737    12889     +152     
- Misses      13124    13321     +197     
- Partials     1720     1746      +26     
Impacted Files Coverage Δ
applicationset/generators/scm_provider.go 40.65% <0.00%> (-0.46%) ⬇️
applicationset/webhook/webhook.go 65.97% <55.45%> (ø)
...licationset/generators/generator_spec_processor.go 61.64% <100.00%> (ø)
controller/clusterinfoupdater.go 33.33% <0.00%> (-2.26%) ⬇️
cmd/argocd/commands/app.go 19.52% <0.00%> (-0.90%) ⬇️
cmd/argocd/commands/app_resources.go 7.75% <0.00%> (-0.73%) ⬇️
server/logout/logout.go 83.87% <0.00%> (-0.51%) ⬇️
cmd/util/project.go 9.70% <0.00%> (-0.40%) ⬇️
controller/state.go 73.69% <0.00%> (-0.20%) ⬇️
server/application/terminal.go 12.75% <0.00%> (-0.09%) ⬇️
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@crenshaw-dev
Copy link
Collaborator

@sboschman can you resolve the conflicts?

Copy link
Collaborator

@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.

@sboschman can you describe (or add as comments) what the changes in shouldRefreshMatrixGenerator do? I need to read this more in-depth, but I think a quick description will help a lot. :-)

I'm a little worried that the temporary generators don't include matrix and merge generators. Is this solution expected to work with nested matrix generators, or matrix generators that contain nested merge generators?

@sboschman
Copy link
Contributor Author

I'm a little worried that the temporary generators don't include matrix and merge generators. Is this solution expected to work with nested matrix generators, or matrix generators that contain nested merge generators?

No not expected in its current form, as for some reason I was under the impression nesting those two generators was not allowed. After checking the docs again, I see you are allowed to nest them just once. So, will have to do some changes to support that.

@sboschman
Copy link
Contributor Author

Even before interpolation the webhook code didn't support nested matrix/merge generators. Do we silently fix this as part of the interpolation fix, or do you want me to open a new issue for changelog purposes @crenshaw-dev ?

Talking about changelog, should this fix be added to the changelog or not? As it fixes something that is not yet released, the interpolation feat is part of the upcoming 2.5 release... Might be a bit strange to have fixes in the changelog for 2.5 release for features introduced in that same 2.5 release?

Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator

Even before interpolation the webhook code didn't support nested matrix/merge generators. Do we silently fix this as part of the interpolation fix, or do you want me to open a new issue for changelog purposes @crenshaw-dev ?

I'm okay with just adding the support here, rather than with a new issue.

Talking about changelog, should this fix be added to the changelog or not? As it fixes something that is not yet released, the interpolation feat is part of the upcoming 2.5 release... Might be a bit strange to have fixes in the changelog for 2.5 release for features introduced in that same 2.5 release?

I think it's fine to include in the changelog. Folks will probably mostly look at the "features" section. Might be a little surprised to see this in the "bug fixes" section, but I don't think that will be a huge problem.

Copy link
Collaborator

@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.

Fantastic. Thanks @sboschman!

@crenshaw-dev crenshaw-dev merged commit 5515cde into argoproj:master Aug 11, 2022
@sboschman sboschman deleted the webhook-interpolation branch August 11, 2022 06:13
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.

Applicationset not refreshed after webhook event using matrix generator when using matrix generator references
2 participants