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

feat: Make spec.source.helm.values field accepts either a string or a rawExtension #8794

Closed

Conversation

mcbenjemaa
Copy link

@mcbenjemaa mcbenjemaa commented Mar 16, 2022

Test using this demo repo: https://github.com/mcbenjemaa/argocd-apps

Fixes: #2936
Enhancement Proposal Ref: #8579

Thanks @crenshaw-dev for guidance.

CC @alexec

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

@mcbenjemaa mcbenjemaa force-pushed the feat/argocd-helm-values-raw branch 3 times, most recently from 0ab763c to a8d18af Compare March 16, 2022 16:10
@mcbenjemaa
Copy link
Author

I will fix the tests

@mcbenjemaa
Copy link
Author

Fixes: #2936

@crenshaw-dev
Copy link
Member

@mcbenjemaa thanks for your persistence on this! I want to make sure I have enough time to give this a solid review, so bear with me as I try to carve out the time.

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.

Just tested this locally, and things seem to behave quite nicely! We could probably use an e2e test or two.

My questions might have been silly. Mostly stuff that surprised me / I was curious about, not necessarily anything wrong!

@mcbenjemaa mcbenjemaa force-pushed the feat/argocd-helm-values-raw branch 7 times, most recently from dd329e5 to 6e4f706 Compare March 22, 2022 13:48
@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #8794 (f201dc1) into master (ba0c249) will decrease coverage by 0.13%.
The diff coverage is 7.93%.

@@            Coverage Diff             @@
##           master    #8794      +/-   ##
==========================================
- Coverage   44.96%   44.82%   -0.14%     
==========================================
  Files         212      213       +1     
  Lines       25261    25318      +57     
==========================================
- Hits        11359    11350       -9     
- Misses      12295    12363      +68     
+ Partials     1607     1605       -2     
Impacted Files Coverage Δ
cmd/argocd/commands/app.go 9.13% <0.00%> (-0.04%) ⬇️
.../apis/application/v1alpha1/stringorobject_types.go 2.77% <2.77%> (ø)
cmd/util/app.go 48.70% <6.25%> (-1.70%) ⬇️
pkg/apis/application/v1alpha1/types.go 54.63% <100.00%> (ø)
reposerver/repository/repository.go 60.08% <100.00%> (ø)
applicationset/services/scm_provider/github.go 63.52% <0.00%> (-17.65%) ⬇️
applicationset/services/scm_provider/utils.go 88.50% <0.00%> (+4.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba0c249...f201dc1. Read the comment docs.

@mcbenjemaa mcbenjemaa force-pushed the feat/argocd-helm-values-raw branch 7 times, most recently from 78a2375 to 9ad1808 Compare March 25, 2022 14:16
@mcbenjemaa
Copy link
Author

Strange! Why this test is failing docs/readthedocs.org:argo-cd

@crenshaw-dev
Copy link
Member

@mcbenjemaa oh, there was a dependency in docs/requirements.txt that needed to be pinned. If you merge master, it should work. :-)

@crenshaw-dev
Copy link
Member

Hey, @mcbenjemaa, how's this going? Anything I can do to help?

@mcbenjemaa
Copy link
Author

I have rebased it with master!
If the tests succeeds we are ready!

@crenshaw-dev
Copy link
Member

@mcbenjemaa could you run make codegen-local? Looks like the CLI docs need to be updated.

@mcbenjemaa
Copy link
Author

I don't know Why

license/snyk (Argoproj) test has failed
security/snyk (Argoproj) test has failed

@mcbenjemaa
Copy link
Author

@crenshaw-dev Can you restart the test ?

Integration tests / Run end-to-end tests (v1.22.6)

@crenshaw-dev
Copy link
Member

I don't think I have permissions to rerun tests. @alexmt can you kick it off again?

Alternatively @mcbenjemaa, you could push an empty commit.

@mcbenjemaa
Copy link
Author

mcbenjemaa commented Mar 31, 2022

Just rebasing it.

mcbenjemaa and others added 10 commits March 31, 2022 16:40
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
…g or object

Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mohamed.chiheb-extern@renault.com>
…e2e that sets values as raw via this flag

Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mohamed.chiheb-extern@renault.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.com>
Signed-off-by: Mohamed Chiheb <mc.benjemaa@gmail.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.

Alrighty. I'm super excited about this PR. It's been a marathon, thanks for all your work @mcbenjemaa! I want to do a line-by-line review of this PR and do some manual testing. So please be patient with any comments that come up. But this is really good code, I'm excited to get it merged.

assets/swagger.json Show resolved Hide resolved
@@ -632,7 +633,7 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C
}
}
if app.Spec.Source.Helm != nil {
if len(parameters) == 0 && len(valuesFiles) == 0 && !valuesLiteral && !ignoreMissingValueFiles {
if len(parameters) == 0 && len(valuesFiles) == 0 && !valuesLiteral && !valuesRawLiteral && !ignoreMissingValueFiles {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a CLI unit test for this param. Recently merged tests like #8918 and #8901 might be helpful.

cmd/util/app.go Show resolved Hide resolved
cmd/util/app.go Show resolved Hide resolved
cmd/util/app.go Show resolved Hide resolved
Comment on lines 417 to +420
if len(opts.values) > 0 {
src.Helm.Values = opts.values
src.Helm.Values.Values = opts.values
}
if len(opts.valuesRaw) > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if someone specifies both? Should we throw an error if they try?

@crenshaw-dev
Copy link
Member

@mcbenjemaa lmk if I can do anything to help with this!

@crenshaw-dev
Copy link
Member

@mcbenjemaa closing this in favor of #9079, where I'll try to get it across the finish line. Thanks so much again for all your work on this!

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.

Make Helm values field templatable using Kustomize
2 participants