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: Go template with sprig for application template render in applicationset #9873

Closed

Conversation

rishabh625
Copy link
Contributor

Signed-off-by: rishabh625 [email protected]

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

This is the PR moved from argoproj/applicationset

argoproj/applicationset#513

Thanks to @vavdoshka for all the efforts and @crenshaw-dev for pushing it this close

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #9873 (fd18257) into master (c1d8173) will decrease coverage by 0.17%.
The diff coverage is 7.77%.

@@            Coverage Diff             @@
##           master    #9873      +/-   ##
==========================================
- Coverage   45.86%   45.69%   -0.18%     
==========================================
  Files         227      228       +1     
  Lines       26864    26932      +68     
==========================================
- Hits        12322    12307      -15     
- Misses      12862    12949      +87     
+ Partials     1680     1676       -4     
Impacted Files Coverage Δ
applicationset/utils/templating.go 0.00% <0.00%> (ø)
applicationset/utils/utils.go 71.01% <ø> (-7.40%) ⬇️
...is/applicationset/v1alpha1/applicationset_types.go 39.13% <ø> (-1.78%) ⬇️
...cationset/controllers/applicationset_controller.go 56.26% <42.85%> (-0.50%) ⬇️
...licationset/generators/generator_spec_processor.go 51.56% <66.66%> (-0.11%) ⬇️
util/settings/settings.go 48.39% <0.00%> (+0.22%) ⬆️

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 c1d8173...fd18257. Read the comment docs.

Signed-off-by: rishabh625 <[email protected]>
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.

@rishabh625 can you write some usage docs? Having a bit of trouble following the code, and I think that'll help.

if applicationSetTemplate != nil {
err = mergo.Merge(dest, applicationSetTemplate)
} else {
log.Warn("generator template won't be applied when standard application template is not used")
Copy link
Member

Choose a reason for hiding this comment

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

Is this something we can't support? Seems that we could 1) render the untypedTemplate, 2) unmarshal the rendered template, 3) merge it with the generator template and 4) render the merged template.

@@ -13,266 +13,6 @@ import (
argoappsetv1 "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1"
)

func TestRenderTemplateParams(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

No replacement for these tests?

@crenshaw-dev crenshaw-dev mentioned this pull request Sep 6, 2022
10 tasks
@mrmm
Copy link

mrmm commented Sep 12, 2022

@iamnoah Is this PR still worked on ?

@mrmm
Copy link

mrmm commented Oct 5, 2022

@crenshaw-dev I would be happy to try to push something but it might be sloppy attempt. As I have a limited experience with Golang.

Would that be good for you ?

@crenshaw-dev
Copy link
Member

@mrmm I'd be happy to review and help with any local dev setup issues! :-)

@crenshaw-dev
Copy link
Member

Closing for now, until someone has time to pick it back up. :-)

@mrmm
Copy link

mrmm commented Nov 2, 2022

Hello @crenshaw-dev, I hope you are doing great!

I've started working on this (in my fork) but I am struggling with how to test this following the same way in (applicationset/utils/utils_test.go), and the commit of the tests is something like mrmm@c329469.

Do you have any recommendations to do this better please?

Edit: @crenshaw-dev you can ignore my previous request, as the work on this has restarted in #11183

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.

4 participants