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

fix: reduce warn levels to debug for unactionable errors #3645

Merged

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Feb 5, 2025

Description

This PR just updates the majority of WARN log calls to DEBUG, these should all be messages that contain information that really isn't actionable by the user: for example, a user wouldn't be expected to modify the material that they are scanning to fix package.json errors, these would likely be in a prebuilt container or other source not controlled by the user; and a user would not be expected to modify syft code due to a bug.

I've tried to leave as warnings things that are actionable, things like invalid configuration: misconfigured cache directories, invalid cataloger selection, etc.. I've also updated any uses of log.WithFields that were also using a formatted message to just include the data as fields, e.g. log.WithFields(..).Debugf(...) -> log.WithFields(..., <data used in Debugf>).Debug(...).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

@kzantow kzantow changed the title fix: reduce warn levels to debug for non-actionable errors fix: reduce warn levels to debug for unactionable errors Feb 5, 2025
Copy link
Contributor

@spiffcs spiffcs left a comment

Choose a reason for hiding this comment

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

I checked each file.

If we're sticking with the philosophy that Warn should only be something that the user can take an action on then this PR get's us closer to that goal.

I'm a little worried about throwing some of these over the wall and making the Debug output more crowded with these messages, but maybe the next step after this PR is to start pruning those messages down based on feedback of what we find useful.

Also, more information is always better when debugging so these might be overblown concerns.

@spiffcs spiffcs merged commit 2328b20 into anchore:main Feb 7, 2025
12 checks passed
douglasclarke pushed a commit to douglasclarke/syft that referenced this pull request Feb 7, 2025
juan131 pushed a commit to juan131/syft that referenced this pull request Feb 14, 2025
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.

syft should not warn on known bad package.json
2 participants