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: wrong Git file generator globbing (fixes #13284, #13313 and #13686) #13314

Merged
merged 2 commits into from
May 28, 2023

Conversation

Calchan
Copy link
Contributor

@Calchan Calchan commented Apr 21, 2023

The current implementation of the Git file generator does undesirable globbing which breaks ApplicationSets in some cases. Please see full description of the issue in #13313.

I have extensively discussed this issue and PR with @crenshaw-dev on Slack at https://cloud-native.slack.com/archives/C01TSERG0KZ/p1681230308737899.

In this discussion, Micheal suggested I put the fix behind a configuration setting which defaults to the current behavior in case some users were relying on it. I did that, using the configuration for progressive syncs as a model.

Fixes: #13284
Fixes: #13313
Fixes: #13686

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).
  • The title of the PR conforms to the Toolchain Guide
  • 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).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

Please see Contribution FAQs if you have questions about your pull-request.

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Patch coverage: 68.08% and project coverage change: +0.02 🎉

Comparison is base (591b33d) 49.14% compared to head (85833fa) 49.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #13314      +/-   ##
==========================================
+ Coverage   49.14%   49.16%   +0.02%     
==========================================
  Files         248      248              
  Lines       42911    42944      +33     
==========================================
+ Hits        21087    21115      +28     
- Misses      19717    19718       +1     
- Partials     2107     2111       +4     
Impacted Files Coverage Δ
util/git/client.go 51.25% <57.14%> (+1.25%) ⬆️
applicationset/services/repo_service.go 88.46% <100.00%> (+0.46%) ⬆️
reposerver/repository/repository.go 60.64% <100.00%> (+0.02%) ⬆️

... and 3 files 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.

@Calchan Calchan force-pushed the fix_git_files_generator branch 5 times, most recently from cf1c5ba to 9513b81 Compare April 22, 2023 00:17
@ettancos
Copy link

if I understand right, this would also fix #13284, right?

@Calchan
Copy link
Contributor Author

Calchan commented Apr 22, 2023

if I understand right, this would also fix #13284, right?

Actually it won't. With this option it won't do any globbing at all, neither the wrong globbing it did before, nor correct globbing.

But it would if I used the doublestar package. That's actually a good idea. I'll try and look into it on Monday.

@Calchan Calchan force-pushed the fix_git_files_generator branch 4 times, most recently from 01ca256 to e94541b Compare April 22, 2023 23:40
@Calchan
Copy link
Contributor Author

Calchan commented Apr 23, 2023

I have updated the PR to use the doublestar package which optionally replaces the overly greedy globbing with correct globbing (instead of optionally disabling it in my initial iteration).

This should now also fix #13284.

@Calchan Calchan changed the title fix: wrong Git file generator globbing (fixes #13313) fix: wrong Git file generator globbing (#13313) May 2, 2023
@Calchan Calchan changed the title fix: wrong Git file generator globbing (#13313) fix: wrong Git file generator globbing (fixes #13284 and #13313) May 2, 2023
@Calchan
Copy link
Contributor Author

Calchan commented May 9, 2023

@ishitasequeira I have rebased this PR. Some of it had to be rewritten mostly because of #10952. It's now ready for review again.

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.

Thanks @Calchan for the PR!! I tested the PR and was able to very the new globbing behavior with nested subcharts.

I went through the code and it looks good as well. Just a minor nit.

applicationset/services/repo_service.go Outdated Show resolved Hide resolved
@Calchan Calchan force-pushed the fix_git_files_generator branch 4 times, most recently from 3b64105 to 2122bb0 Compare May 11, 2023 23:13
@Calchan Calchan changed the title fix: wrong Git file generator globbing (fixes #13284 and #13313) fix: wrong Git file generator globbing (fixes #13284, #13313 and #13686) May 23, 2023
Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
@Calchan
Copy link
Contributor Author

Calchan commented May 23, 2023

I have fixed some rebase conflicts, so this PR is ready to merge again.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
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, @Calchan!

@crenshaw-dev crenshaw-dev merged commit 9656795 into argoproj:master May 28, 2023
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…rgoproj#13314)

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
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
…rgoproj#13314)

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
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
Labels
None yet
Projects
None yet
4 participants