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(appset): add support for missingkey=error in ApplicationSets (#13731) #13733

Merged
merged 4 commits into from
May 30, 2023

Conversation

raxod502-plaid
Copy link
Contributor

@raxod502-plaid raxod502-plaid commented May 24, 2023

Closes #13731.

The implementation is pretty straightforward. I just introduce a new optional parameter goTemplateOptions which is a list of options for the template engine. They are passed as is. The new parameter is threaded through most places that goTemplate is.

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.

@raxod502-plaid raxod502-plaid changed the title Add support for missingkey=error in ApplicationSets feat: Add support for missingkey=error in ApplicationSets May 24, 2023
@raxod502-plaid raxod502-plaid changed the title feat: Add support for missingkey=error in ApplicationSets feat(appset): add support for missingkey=error in ApplicationSets (#13731) May 24, 2023
@raxod502-plaid raxod502-plaid force-pushed the rr-missingkey-error branch 2 times, most recently from 815e177 to 3bd23e0 Compare May 24, 2023 22:17
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Patch coverage: 84.61% and no project coverage change.

Comparison is base (d685f15) 49.25% compared to head (9d97eec) 49.25%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13733   +/-   ##
=======================================
  Coverage   49.25%   49.25%           
=======================================
  Files         251      251           
  Lines       43518    43521    +3     
=======================================
+ Hits        21435    21438    +3     
  Misses      19949    19949           
  Partials     2134     2134           
Impacted Files Coverage Δ
.../apis/application/v1alpha1/applicationset_types.go 28.57% <ø> (ø)
applicationset/utils/utils.go 71.01% <64.70%> (+0.31%) ⬆️
...cationset/controllers/applicationset_controller.go 62.72% <100.00%> (ø)
applicationset/generators/cluster.go 80.34% <100.00%> (ø)
...licationset/generators/generator_spec_processor.go 60.39% <100.00%> (ø)
applicationset/generators/git.go 84.05% <100.00%> (ø)
applicationset/generators/scm_provider.go 33.53% <100.00%> (ø)
applicationset/generators/value_interpolation.go 80.00% <100.00%> (ø)
applicationset/webhook/webhook.go 65.71% <100.00%> (ø)

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

Copy link
Collaborator

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

Could you update the git files generators docs to specifically call out this feature? To me, it has the most intuitive use case: I want to make sure my devs are fully populating their app.yaml file, and I want the AppSet to fail if they forget to set a field.

Copy link
Collaborator

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

Could you update the git files generators docs to specifically call out this feature? To me, it has the most intuitive use case: I want to make sure my devs are fully populating their app.yaml file, and I want the AppSet to fail if they forget to set a field.

@raxod502-plaid
Copy link
Contributor Author

Sure thing - that would be this file, right? And specifically the Git Generator: Files subsection?

This feature will only work when using go templates, so do you think it is better to update all the examples to use go templates instead, or just to add an explanation of how to add the extra validation by migrating if you prefer?

@crenshaw-dev
Copy link
Collaborator

Yep, that's the file!

do you think it is better to update all the examples to use go templates instead

I do. We'll eventually want to deprecate and then remove fasttemplate support, since that library is no longer maintained.

Signed-off-by: Radon Rosborough <rrosborough@plaid.com>
@raxod502-plaid
Copy link
Contributor Author

Updated! I think I translated all the syntax correctly but let me know if I made any mistakes.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator

I tried to rebase, fingers crossed that I didn't break anything. 😬

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev crenshaw-dev merged commit 944eadd into argoproj:master May 30, 2023
24 checks passed
@raxod502-plaid raxod502-plaid deleted the rr-missingkey-error branch May 30, 2023 15:42
@raxod502-plaid
Copy link
Contributor Author

Thank you!

yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…goproj#13731) (argoproj#13733)

* Add support for missingkey=error in ApplicationSets

Signed-off-by: Radon Rosborough <rrosborough@plaid.com>

* options for cluster generator too

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Radon Rosborough <rrosborough@plaid.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
…goproj#13731) (argoproj#13733)

* Add support for missingkey=error in ApplicationSets

Signed-off-by: Radon Rosborough <rrosborough@plaid.com>

* options for cluster generator too

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Radon Rosborough <rrosborough@plaid.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
Development

Successfully merging this pull request may close these issues.

Support for missingkey=error in ApplicationSets with goTemplate: true
2 participants