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(dos): Trivially improve logging multiple packages #9425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sschuberth
Copy link
Member

No description provided.

@sschuberth sschuberth requested a review from a team as a code owner November 14, 2024 11:14
@sschuberth sschuberth enabled auto-merge (rebase) November 14, 2024 11:20
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.02%. Comparing base (15dcd7b) to head (6cdf4a9).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9425   +/-   ##
=========================================
  Coverage     68.02%   68.02%           
  Complexity     1291     1291           
=========================================
  Files           250      250           
  Lines          8808     8808           
  Branches        916      916           
=========================================
  Hits           5992     5992           
  Misses         2431     2431           
  Partials        385      385           
Flag Coverage Δ
test 35.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -170,7 +170,8 @@ class DosScanner internal constructor(
startTime: Instant,
issues: MutableList<Issue>
): ScanResultsResponseBody? {
logger.info { "Initiating a backend scan for ${packages.map { it.purl }}." }
logger.info { "Initiating a backend scan for the following packages:" }
packages.forEach { logger.info { it.purl } }
Copy link
Member

Choose a reason for hiding this comment

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

For consistency it would be better to embed the packages into the log above, otherwise you have the package list with logger prefix for each line here, and without the prefix below.

Copy link
Member Author

Choose a reason for hiding this comment

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

logger prefix for each line here

That was actually the intention of this change. I'm only not doing the same in line 202 as it's not possible with createAndLogIssue().

But as @mmurto also raised concerns about log filtering being harder this way, I'll change this to be like line 202.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another option would be to omit the first log and log the whole "Initiating package scan for ${it.purl}." inside the loop.

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.

3 participants