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(appset): regard selector in nested matrix generator's generators #11984

Merged
merged 2 commits into from
Jun 23, 2023
Merged

fix(appset): regard selector in nested matrix generator's generators #11984

merged 2 commits into from
Jun 23, 2023

Conversation

Roshick
Copy link
Contributor

@Roshick Roshick commented Jan 14, 2023

Fixes #11982

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

@Roshick Roshick changed the title fix: regard /selector nested matrix generators fix: regard selector in nested matrix generator's generators Jan 14, 2023
@codecov
Copy link

codecov bot commented Jan 14, 2023

Codecov Report

Patch coverage: 27.58% and project coverage change: -0.03 ⚠️

Comparison is base (150a184) 49.64% compared to head (c6098e8) 49.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11984      +/-   ##
==========================================
- Coverage   49.64%   49.62%   -0.03%     
==========================================
  Files         256      256              
  Lines       43914    43943      +29     
==========================================
+ Hits        21800    21805       +5     
- Misses      19958    19976      +18     
- Partials     2156     2162       +6     
Impacted Files Coverage Δ
applicationset/generators/matrix.go 71.96% <0.00%> (-5.90%) ⬇️
.../apis/application/v1alpha1/applicationset_types.go 31.11% <0.00%> (-0.35%) ⬇️
applicationset/generators/merge.go 52.40% <40.00%> (-0.80%) ⬇️
...licationset/generators/generator_spec_processor.go 59.63% <50.00%> (-0.77%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@blakepettersson
Copy link
Member

Does this work as intended? If so, could you write some e2e tests to exercise that functionality?

@Roshick
Copy link
Contributor Author

Roshick commented Feb 20, 2023

The fix works, tried with my local cluster. I'll have a look into the e2e testing setup this project uses! Need to check why my branch is failing after the rebase anyway.

@Roshick
Copy link
Contributor Author

Roshick commented Feb 20, 2023

@blakepettersson I've added an e2e test that covers the fix.

@Roshick
Copy link
Contributor Author

Roshick commented Mar 1, 2023

@crenshaw-dev as discussed I've added a flag and log some warnings if someone is using terminal generators with selectors without having the flag enabled. I'm not sure if this is the cleanest solution (i.e. adding the terminal selector when unmarshalling and removing it afterwards) instead of not adding it in the first place when going from terminal to nested, but the latter would need access to the application set (1. for the flag, 2. for some meaningful log warnings).

if this solution is okay, I would write 3 more e2e tests for the remaining branches (matrix->merge, merge->matrix, merge->merge).

@Roshick
Copy link
Contributor Author

Roshick commented Mar 2, 2023

@crenshaw-dev pull request is ready for review now

applicationset/generators/matrix.go Outdated Show resolved Hide resolved
@Roshick Roshick requested review from crenshaw-dev and removed request for ishitasequeira March 14, 2023 16:07
@ishitasequeira
Copy link
Member

@Roshick would you mind resolving conflicts? I will give the PR a review today.

@ishitasequeira ishitasequeira self-requested a review March 20, 2023 11:59
@Roshick
Copy link
Contributor Author

Roshick commented Mar 20, 2023

@Roshick would you mind resolving conflicts? I will give the PR a review today.

Sure, I can take care of it this evening!

@Roshick
Copy link
Contributor Author

Roshick commented Mar 21, 2023

@ishitasequeira done, but for some reason I don't understand the docs build failed

@crenshaw-dev crenshaw-dev changed the title fix: regard selector in nested matrix generator's generators fix(appset): regard selector in nested matrix generator's generators Mar 29, 2023
applicationset/generators/matrix.go Outdated Show resolved Hide resolved
applicationset/generators/matrix.go Outdated Show resolved Hide resolved
applicationset/generators/merge.go Outdated Show resolved Hide resolved
applicationset/generators/merge.go Outdated Show resolved Hide resolved
pkg/apis/application/v1alpha1/applicationset_types.go Outdated Show resolved Hide resolved
Copy link
Member

@ishitasequeira ishitasequeira 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 could you take another look?

@Roshick
Copy link
Contributor Author

Roshick commented Apr 29, 2023

@crenshaw-dev would appreciate another review :)

@Roshick
Copy link
Contributor Author

Roshick commented Jun 2, 2023

I will rebase and fix up the pull request next week and hope we can get it merged soon.

@crenshaw-dev
Copy link
Member

Thanks, @Roshick! Apologies for the delayed review. Looking forward to giving it a final pass next week.

@crenshaw-dev crenshaw-dev self-assigned this Jun 2, 2023
Signed-off-by: Elias Rieb <e.rieb@posteo.de>
@Roshick
Copy link
Contributor Author

Roshick commented Jun 6, 2023

@crenshaw-dev all fixed up now and ready to be reviewed! :)

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.

Thanks, @Roshick!

@crenshaw-dev
Copy link
Member

Drat, I broke auto-merge. I'll solve merge conflicts and push, then I'll merge after checks pass.

…-matrix-generators

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev crenshaw-dev merged commit 4b06175 into argoproj:master Jun 23, 2023
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…ctors (argoproj#11984)

Signed-off-by: Elias Rieb <e.rieb@posteo.de>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
…ctors (argoproj#11984)

Signed-off-by: Elias Rieb <e.rieb@posteo.de>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Completed
Development

Successfully merging this pull request may close these issues.

selector in nested matrix generators not regarded
4 participants