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 error logs #10944

Merged
merged 19 commits into from Oct 18, 2022
Merged

chore: improve error logs #10944

merged 19 commits into from Oct 18, 2022

Conversation

smriti0710
Copy link
Contributor

@smriti0710 smriti0710 commented Oct 14, 2022

Note on DCO:

This PR is related to this issue #10592

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Base: 45.83% // Head: 45.65% // Decreases project coverage by -0.18% ⚠️

Coverage data is based on head (49d7d74) compared to base (4e8cfde).
Patch coverage: 6.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10944      +/-   ##
==========================================
- Coverage   45.83%   45.65%   -0.19%     
==========================================
  Files         237      237              
  Lines       28720    28728       +8     
==========================================
- Hits        13165    13115      -50     
- Misses      13742    13809      +67     
+ Partials     1813     1804       -9     
Impacted Files Coverage Δ
applicationset/utils/createOrUpdate.go 0.00% <0.00%> (ø)
cmd/argocd/commands/admin/app.go 30.37% <0.00%> (ø)
cmd/argocd/commands/admin/generatespec_utils.go 59.61% <0.00%> (ø)
cmd/argocd/commands/admin/project.go 27.97% <0.00%> (ø)
controller/clusterinfoupdater.go 33.33% <0.00%> (ø)
cmd/util/applicationset.go 19.23% <25.00%> (ø)
server/application/application.go 27.89% <0.00%> (-1.12%) ⬇️
util/settings/settings.go 51.25% <0.00%> (ø)
pkg/apiclient/grpcproxy.go 0.00% <0.00%> (ø)
pkg/apiclient/apiclient.go 1.25% <0.00%> (+0.15%) ⬆️
... and 3 more

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.

@smriti0710
Copy link
Contributor Author

@crenshaw-dev please review. Thanks.

alexmt and others added 18 commits October 17, 2022 14:00
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: wujunwei <wjw3323@live.com>

Signed-off-by: wujunwei <wjw3323@live.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
* Adding bcrypt support for argocd CLI

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Fixing linter issues

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Nesting bcrypt under account instead of admin

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Removing admin bcrypt docs

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Update docs/faq.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Amey Totawar <ameytotawar@gmail.com>

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Signed-off-by: Amey Totawar <ameytotawar@gmail.com>
Co-authored-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
* consolidate checksums into one file

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* sign container images

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* sign container images

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* remove id-token permissions

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Ryan Talbot <ryan-talbot@outlook.com>

Signed-off-by: Ryan Talbot <ryan-talbot@outlook.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Niharika <ns8gupta@gmail.com>
Signed-off-by: Niharika <niharika_sahai@intuit.com>

Signed-off-by: Niharika <ns8gupta@gmail.com>
Signed-off-by: Niharika <niharika_sahai@intuit.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
…al file paths (#10945) (#10946)

fix: Use os.PathSeparator instead of hard-coded string to resolve local file paths (#10945) (#10946)
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
 Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
#10961)

Signed-off-by: toVersus <toversus2357@gmail.com>

Signed-off-by: toVersus <toversus2357@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: Shawn Toffel <shawn.toffel@gmail.com>

Signed-off-by: Shawn Toffel <shawn.toffel@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
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.

Wording and format tweaks. Thanks!

@@ -292,11 +292,11 @@ func saveToFile(err error, outputFormat string, result reconcileResults, outputP
switch outputFormat {
case "yaml":
if data, err = yaml.Marshal(result); err != nil {
return err
return fmt.Errorf("error marshalling yaml file %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.

Suggested change
return fmt.Errorf("error marshalling yaml file %w", err)
return fmt.Errorf("error marshalling yaml: %w", err)

}
case "json":
if data, err = json.Marshal(result); err != nil {
return err
return fmt.Errorf("error marshalling json file %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.

Suggested change
return fmt.Errorf("error marshalling json file %w", err)
return fmt.Errorf("error marshalling json: %w", err)

@@ -43,7 +43,7 @@ func PrintResources(output string, out io.Writer, resources ...interface{}) erro
}
filteredResource, err := omitFields(resource)
if err != nil {
return err
return fmt.Errorf("error printing the resource %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.

Suggested change
return fmt.Errorf("error printing the resource %w", err)
return fmt.Errorf("error omitting filtered fields from the resource: %w", err)

@@ -56,14 +56,14 @@ func PrintResources(output string, out io.Writer, resources ...interface{}) erro
case "json":
jsonBytes, err := json.MarshalIndent(obj, "", " ")
if err != nil {
return err
return fmt.Errorf("error printing the json file %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.

Suggested change
return fmt.Errorf("error printing the json file %w", err)
return fmt.Errorf("error marshaling json: %w", err)

}

_, _ = fmt.Fprintln(out, string(jsonBytes))
case "yaml":
yamlBytes, err := yaml.Marshal(obj)
if err != nil {
return err
return fmt.Errorf("error printing the yaml file %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.

Suggested change
return fmt.Errorf("error printing the yaml file %w", err)
return fmt.Errorf("error marshaling yaml: %w", err)

@@ -40,7 +40,7 @@ func readAppsetFromURI(fileURL string, appset *[]*argoprojiov1alpha1.Application

yml, err := readFilePayload()
if err != nil {
return err
return fmt.Errorf("error reading file payload %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.

Suggested change
return fmt.Errorf("error reading file payload %w", err)
return fmt.Errorf("error reading file payload: %w", err)

@@ -49,18 +49,18 @@ func readAppsetFromURI(fileURL string, appset *[]*argoprojiov1alpha1.Application
func readAppset(yml []byte, appsets *[]*argoprojiov1alpha1.ApplicationSet) error {
yamls, err := kube.SplitYAMLToString(yml)
if err != nil {
return err
return fmt.Errorf("error splitting YAML to string %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.

Suggested change
return fmt.Errorf("error splitting YAML to string %w", err)
return fmt.Errorf("error splitting YAML to string: %w", err)

}

for _, yml := range yamls {
var appset argoprojiov1alpha1.ApplicationSet
err = config.Unmarshal([]byte(yml), &appset)
if err != nil {
return err
return fmt.Errorf("error unmarshalling appset %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.

Suggested change
return fmt.Errorf("error unmarshalling appset %w", err)
return fmt.Errorf("error unmarshalling appset: %w", err)

}
*appsets = append(*appsets, &appset)

}

return err
return fmt.Errorf("error reading app set %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.

Suggested change
return fmt.Errorf("error reading app set %w", err)
return fmt.Errorf("error reading app set: %w", err)

@@ -93,7 +93,7 @@ func (c *clusterInfoUpdater) updateClusters() {
func (c *clusterInfoUpdater) updateClusterInfo(cluster appv1.Cluster, info *cache.ClusterInfo) error {
apps, err := c.appLister.List(labels.Everything())
if err != nil {
return err
return fmt.Errorf("error while fetching the apps list %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.

Suggested change
return fmt.Errorf("error while fetching the apps list %w", err)
return fmt.Errorf("error while fetching the apps list: %w", err)

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
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.

lgtm, thanks @smriti0710!

@crenshaw-dev crenshaw-dev merged commit d021690 into argoproj:master Oct 18, 2022
nbjohnson pushed a commit to nbjohnson/argo-cd that referenced this pull request Oct 18, 2022
* fix: Resource list loading slowly due to Sync Wave sorting (argoproj#10932)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: fix wrong annotation in function (argoproj#10923)

Signed-off-by: wujunwei <wjw3323@live.com>

Signed-off-by: wujunwei <wjw3323@live.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* feat: add bcrypt support for argocd CLI (argoproj#10934)

* Adding bcrypt support for argocd CLI

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Fixing linter issues

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Nesting bcrypt under account instead of admin

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Removing admin bcrypt docs

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>

* Update docs/faq.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Amey Totawar <ameytotawar@gmail.com>

Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Signed-off-by: Amey Totawar <ameytotawar@gmail.com>
Co-authored-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: improve error logs

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: improve error logs

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: implement signed images (argoproj#10925)

* consolidate checksums into one file

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* sign container images

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* sign container images

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* remove id-token permissions

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: delete old snyk reports (argoproj#10938)

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

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

* chore: rewording of misleading message (argoproj#10407)

Signed-off-by: Ryan Talbot <ryan-talbot@outlook.com>

Signed-off-by: Ryan Talbot <ryan-talbot@outlook.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: delete old snyk reports, 2nd attempt (argoproj#10950)

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

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

* chore: wrap error objects to include context (argoproj#10592) (argoproj#10940)

Signed-off-by: Niharika <ns8gupta@gmail.com>
Signed-off-by: Niharika <niharika_sahai@intuit.com>

Signed-off-by: Niharika <ns8gupta@gmail.com>
Signed-off-by: Niharika <niharika_sahai@intuit.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* fix: Use os.PathSeparator instead of hard-coded string to resolve local file paths (argoproj#10945) (argoproj#10946)

fix: Use os.PathSeparator instead of hard-coded string to resolve local file paths (argoproj#10945) (argoproj#10946)
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: improve error logs

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: covered error log in controllers

 Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* chore: sign checksums file for release binaries (argoproj#10963)

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* [Bot] Update Snyk reports (argoproj#10953)

Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* feat: make applicationset controller configurable in argocd-cmd-params (argoproj#10961)

Signed-off-by: toVersus <toversus2357@gmail.com>

Signed-off-by: toVersus <toversus2357@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* docs: message is no longer truncated (argoproj#10962)

Signed-off-by: Shawn Toffel <shawn.toffel@gmail.com>

Signed-off-by: Shawn Toffel <shawn.toffel@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

* fix: addressed review comments

Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Smriti Prakash <smriti_prakash@intuit.com>
Signed-off-by: wujunwei <wjw3323@live.com>
Signed-off-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Signed-off-by: Amey Totawar <ameytotawar@gmail.com>
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Ryan Talbot <ryan-talbot@outlook.com>
Signed-off-by: Niharika <ns8gupta@gmail.com>
Signed-off-by: Niharika <niharika_sahai@intuit.com>
Signed-off-by: CI <ci@argoproj.com>
Signed-off-by: toVersus <toversus2357@gmail.com>
Signed-off-by: Shawn Toffel <shawn.toffel@gmail.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Adam <wjw3323@live.com>
Co-authored-by: Amey Totawar <ameytotawar@gmail.com>
Co-authored-by: Amey Totawar <ameysanjaykumar_totawar@intuit.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Smriti Prakash <smriti_prakash@intuit.com>
Co-authored-by: 34FathomBelow <34fathombelow@protonmail.com>
Co-authored-by: Ryan Talbot <4523072+RyanTalbot@users.noreply.github.com>
Co-authored-by: nsahai8 <ns8gupta@gmail.com>
Co-authored-by: Chris Davis <chris@codeflow.org.uk>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CI <ci@argoproj.com>
Co-authored-by: Tsubasa Nagasawa <toversus2357@gmail.com>
Co-authored-by: Shawn Toffel <shawn.toffel+github@gmail.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