-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: retain count and order of revisions for multi source apps (#14108) #14113
Conversation
Signed-off-by: Lukas Wöhrl <[email protected]>
f876ebe
to
7519ed6
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #14113 +/- ##
==========================================
- Coverage 49.61% 49.61% -0.01%
==========================================
Files 256 256
Lines 43934 43924 -10
==========================================
- Hits 21800 21795 -5
+ Misses 19975 19972 -3
+ Partials 2159 2157 -2
☔ View full report in Codecov by Sentry. |
One thing to note is that, for the repo used just as a reference to values files (e.g. In below example, See below example,
Also, if there are more than one repositories, it is difficult to associate which revision belongs to which repository. (below example)
In my opinion, it was okay to show
Let me know what do you think. cc: @crenshaw-dev |
@ishitasequeira there is a place in the code with skips the revision if there is no manifest, I suggest removing that case for the revision output. Then the revisions always align up by index. |
Signed-off-by: Lukas Wöhrl <[email protected]>
I just pushed the changes. This will also directly fix a recurring cache invalidation bug, where the results would never be cached in the mentioned case of @ishitasequeira , because the length of the array will never be the same. Lines 532 to 536 in b392917
|
I think listing all revisions and using the index as key is fine, as long as the change doesn't have any unfortunate side-effects (looking at the PR, I don't think it does). |
@crenshaw-dev Looks like this is related to the following condition: argo-cd/reposerver/repository/repository.go Lines 341 to 346 in b392917
I currently don't see a reason for having this check in place? |
That is the expected condition and we would not want to remove that as we are not generating manifests for the specific scenarios when the source does not have a path / chart in the repo. The source can be used only for external values files. |
@ishitasequeira I see. But we still have to process this method to return the resolving of the ref (e.g. HEAD) to commit hash, don't we? |
@ishitasequeira after looking at the code, and getting a bit familiar with it, my suggestion would be to slightly modify this part: argo-cd/reposerver/repository/repository.go Lines 512 to 528 in b392917
So that it has a new argument to not generate a manifest, but it returns the correct "ManifestResponse", instead of this: argo-cd/reposerver/repository/repository.go Lines 546 to 548 in b392917
Thoughts? |
like this 93b0273 @ishitasequeira CC: @crenshaw-dev Created that in my fork, to get your opinion. |
I think that should work.. Thanks @woehrl01 !! |
Signed-off-by: Michael Crenshaw <[email protected]>
@woehrl01 how do you feel about this slightly simplified version? woehrl01#1 |
Looks great, I'll pick that. |
b9f9521
to
7519ed6
Compare
One downside of my change is that we'll be running some unnecessary manifest-generation-related operations for ref sources (e.g. checking for out-of-bounds symlinks) which could be skipped. But for now I think the performance hit is worth it for a relatively simple fix. |
/cherry-pick release-2.6 |
/cherry-pick release-2.7 |
@crenshaw-dev we also have to handle argo-cd/reposerver/repository/repository.go Line 1984 in 41dc06d
Do you have an idea what would be the best behaviour here? Should we just duplicate the check and return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
@woehrl01 I don't think the UI currently hits that endpoint for multi-source apps, precisely because it's not equipped to handle stuff like the ref-only sources. I think it's safe to ignore until someone starts working on multi-source UI support. |
Cherry-pick failed with |
Cherry-pick failed with |
…roj#14108) (argoproj#14113) * fix: retain order of revisions for multi source apps (argoproj#14108) Signed-off-by: Lukas Wöhrl <[email protected]> * fix: retain revision for multi source app with ref-repos Signed-off-by: Lukas Wöhrl <[email protected]> * calculate commitSHA before quitting manifest generation Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
…roj#14108) (argoproj#14113) * fix: retain order of revisions for multi source apps (argoproj#14108) Signed-off-by: Lukas Wöhrl <[email protected]> * fix: retain revision for multi source app with ref-repos Signed-off-by: Lukas Wöhrl <[email protected]> * calculate commitSHA before quitting manifest generation Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
Fixes will be in 2.6.11 and 2.7.6. |
… (#14113) (#14136) * fix: retain order of revisions for multi source apps (#14108) * fix: retain revision for multi source app with ref-repos * calculate commitSHA before quitting manifest generation --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Lukas Wöhrl <[email protected]>
… (#14113) (#14135) * fix: retain order of revisions for multi source apps (#14108) * fix: retain revision for multi source app with ref-repos * calculate commitSHA before quitting manifest generation --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Lukas Wöhrl <[email protected]>
…roj#14108) (argoproj#14113) (argoproj#14135) * fix: retain order of revisions for multi source apps (argoproj#14108) * fix: retain revision for multi source app with ref-repos * calculate commitSHA before quitting manifest generation --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Lukas Wöhrl <[email protected]> Signed-off-by: schakrad <[email protected]>
…roj#14108) (argoproj#14113) * fix: retain order of revisions for multi source apps (argoproj#14108) Signed-off-by: Lukas Wöhrl <[email protected]> * fix: retain revision for multi source app with ref-repos Signed-off-by: Lukas Wöhrl <[email protected]> * calculate commitSHA before quitting manifest generation Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
…roj#14108) (argoproj#14113) * fix: retain order of revisions for multi source apps (argoproj#14108) Signed-off-by: Lukas Wöhrl <[email protected]> * fix: retain revision for multi source app with ref-repos Signed-off-by: Lukas Wöhrl <[email protected]> * calculate commitSHA before quitting manifest generation Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Lukas Wöhrl <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
Fixes #14108
Fixes #14109
Supersedes #14081
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:
Please see Contribution FAQs if you have questions about your pull-request.