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(misconf): Improve logging for unsupported checks #8634

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Mar 27, 2025

Description

There's no reason to print these logs on the error stream as it is not an error but simply lack of support.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@simar7 simar7 self-assigned this Mar 27, 2025
@simar7 simar7 requested a review from nikpivkin as a code owner March 27, 2025 21:03
@simar7 simar7 requested a review from DmitriyLewen March 27, 2025 21:04
@@ -165,15 +165,15 @@ func (s *Scanner) fallbackChecks(compiler *ast.Compiler) {
continue
}

s.logger.Error(
s.logger.Debug(
"Error occurred while parsing. Trying to fallback to embedded check",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
Can we somehow change the word Error?
Even if we show debug log, some users see word error and think it's an error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I agree - I updated it here 1bcf4c2

In the next release I want to add support inside of checks metadata to specify the minimum supported trivy version that the particular check would require to run.

That information will be used in this logic to only load those checks which are supported by that particular trivy version, thereby avoiding us getting into situations like these.

Copy link
Member Author

Choose a reason for hiding this comment

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

Details on the new feature here #8637

Copy link
Contributor

Choose a reason for hiding this comment

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

Details on the new feature here #8637

Looks good 👍

@DmitriyLewen DmitriyLewen enabled auto-merge March 28, 2025 05:02
@DmitriyLewen DmitriyLewen added this pull request to the merge queue Mar 28, 2025
Merged via the queue into aquasecurity:main with commit 5b7704d Mar 28, 2025
12 checks passed
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.

bug(misconf): Improve logging for unsupported checks
2 participants