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

chore: improve log in argo-cd/applicationset/generators/generator_spec_processor.go #10906

Merged
merged 6 commits into from Oct 13, 2022

Conversation

karengineering
Copy link
Contributor

@karengineering karengineering commented Oct 12, 2022

Signed-off-by: Karengineering 49111213+karengineering@users.noreply.github.com

Fix for #10592

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

@@ -28,7 +28,7 @@ type TransformResult struct {
func Transform(requestedGenerator argoprojiov1alpha1.ApplicationSetGenerator, allGenerators map[string]Generator, baseTemplate argoprojiov1alpha1.ApplicationSetTemplate, appSet *argoprojiov1alpha1.ApplicationSet, genParams map[string]interface{}) ([]TransformResult, error) {
selector, err := metav1.LabelSelectorAsSelector(requestedGenerator.Selector)
if err != nil {
return nil, err
return nil, fmt.Errorf("error transforming spec generator: %w", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@karengineering could you add a fmt import to the top of this file?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("error transforming spec generator: %w", err)
return nil, fmt.Errorf("error parsing label selector: %w", err)

I think this is a bit more specific to the error being throw.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated @crenshaw-dev

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 45.82% // Head: 45.62% // Decreases project coverage by -0.20% ⚠️

Coverage data is based on head (f68df47) compared to base (ba10959).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10906      +/-   ##
==========================================
- Coverage   45.82%   45.62%   -0.21%     
==========================================
  Files         236      236              
  Lines       28698    28699       +1     
==========================================
- Hits        13150    13093      -57     
- Misses      13738    13805      +67     
+ Partials     1810     1801       -9     
Impacted Files Coverage Δ
...licationset/generators/generator_spec_processor.go 61.64% <0.00%> (ø)
server/application/application.go 27.89% <0.00%> (-1.12%) ⬇️
pkg/apiclient/grpcproxy.go 0.00% <0.00%> (ø)
pkg/apiclient/apiclient.go 1.25% <0.00%> (+0.15%) ⬆️
server/application/terminal.go 12.75% <0.00%> (+1.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 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.

Thanks, @karengineering!

@crenshaw-dev crenshaw-dev enabled auto-merge (squash) October 13, 2022 21:19
@crenshaw-dev crenshaw-dev merged commit f9a7ea8 into argoproj:master Oct 13, 2022
nbjohnson pushed a commit to nbjohnson/argo-cd that referenced this pull request Oct 18, 2022
…c_processor.go (argoproj#10906)

* wrap error object to include context for generator_spec_processor.go

Signed-off-by: Karengineering <49111213+karengineering@users.noreply.github.com>

* addressing PR comments

Signed-off-by: Karengineering <49111213+karengineering@users.noreply.github.com>

Signed-off-by: Karengineering <49111213+karengineering@users.noreply.github.com>
Signed-off-by: Nicholas Johnson <nbjohnson10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants