argo-cd
argo-cd copied to clipboard
feat: implement source refs for helm set-file (Beta) (#13220)
In multi-source applications helm values files can come from other repos if you use the ref syntax but it is not possible for the --set-file param to take files from other repos via the ref syntax. This extends the behavior to cover set-file parameters as well as the values files. fixes #13220, refs #17822
Checklist:
- [x] 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.
- [x] The title of the PR states what changed and the related issues number (used for the release note).
- [x] The title of the PR conforms to the Toolchain Guide
- [x] I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
- [x] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
- [x] Does this PR require documentation updates?
- [x] I've updated documentation as required by this PR.
- [x] I have signed off all my commits as required by DCO
- [x] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
- [x] My build is green (troubleshooting builds).
- [x] My new feature complies with the feature status guidelines.
- [x] I have added a brief description of why this PR is necessary and/or what this PR solves.
- [x] Optional. My organization is added to USERS.md.
- [x] Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).
This still needs testing added. The documentation pieces are in #17822, which I will rebase this PR on top once that lands. I'll readily admit I'm not a Go programmer so probably did some things wrong from an idiomatic standpoint. Hoping another contributor is willing to help me get this over the finish line.
I've labeled this as beta since it's for multi-source applications which themselves are beta.
I've set the documentation update to say the feature is available from ArgoCD 2.12+ because I'm assuming this won't make it into 2.11 since that's already in RC status.
So I pushed once to confirm the test failed. And the most recent test confirms the test passes.
@cardoe I can't open a PR against your branch, not sure why.
I added one commit at https://github.com/morremeyer/argo-cd/commit/aa090e2112b3e4cf88bffa6c07e5abab8cdc9e74 that uses slices.IndexFunc to check against all manifests, not just one.
Did not run the full test suite against it yet, feel free to add it to this PR.
Thanks @morremeyer. I've squashed your change in since you prefixed it with fixup!
and rebased the branch. Thanks for doing that!
I just brought this PR up in the contributor weekly since I'd love to see it merged.
I'll build an image for this PR in our environment and will test it in our setup to verify it works as desired.
I've got this patch built against 2.12.x and have been using it myself.
Hello, Any chance of moving forward with this PR? It's a very useful feature in my opinion. Thanks
I've rebased the branch and removed the documentation chunk that @morremeyer asked.
Codecov Report
Attention: Patch coverage is 80.00000%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 50.24%. Comparing base (
52b1b43
) to head (ff604b3
).
Files | Patch % | Lines |
---|---|---|
reposerver/repository/repository.go | 80.00% | 2 Missing and 2 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #17941 +/- ##
==========================================
+ Coverage 50.23% 50.24% +0.01%
==========================================
Files 312 312
Lines 42969 42984 +15
==========================================
+ Hits 21584 21598 +14
Misses 18907 18907
- Partials 2478 2479 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've rebased once again and attempted to add a test that checks for failure not just the happy path.
We have now built ArgoCD with this PR and are running it on our infrastructure for this week to validate the feature and observe performance.
I'll report back about that on Friday.
This has worked very well in our setup, from my point of view this PR is ready to be merged.
Thanks @cardoe for contributing this, we'll be very happy to see it released!
@crenshaw-dev Thanks for your feedback in the Contributor sync, as discussed then, we tested it in our infrastructure with success.
Could we merge and release it?
Like @morremeyer I'm successfully running this patch in my infra. Overall this increases test coverage. I know the codecov says there's some partials and missed tests but that's cause the calls to pathutil.ResolveValueFilePathOrUrl()
aren't tested for failure. But that function is tested elsewhere so I didn't think it'd be worth the increased cycles.
hi @morremeyer, the PR looks in a good shape 🤩, do you know if there is any news on this feature being accepted and released?
We're also very interested for this feature, can't wait to have it released :)
At this time we're waiting on @crenshaw-dev to review it. I've pinged him about it on Slack.
this is a useful feature for configmap files in non-helm repos, please review it and merge so it is available to users at large. if user acceptance test is required, then i am willing to offer my services to test the feature.
Will this be part of v2.12.0 ??
@spy16 No, it was merged after the first RC was made, so it will not appear in v2.12.0.
We can expect it with v2.13.0 if I remember the flow correctly.