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

feat: more verbose log messages in all commands #61

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Conversation

mcombuechen
Copy link
Collaborator

This normalizes the style of log messages throughout the different commands, and adds more debug logging, specifically for skipped packages during enrich commands (ecosystems, snyk).

Closes #14.

@mcombuechen mcombuechen requested review from garethr and a team as code owners March 1, 2024 15:39
@@ -63,7 +64,7 @@ func enrichCDXLicense(component cdx.Component, packageData packages.Package) cdx
return component
}

func enrichExternalReference(component cdx.Component, packageData packages.Package, url *string, refType cdx.ExternalReferenceType) cdx.Component {
func enrichExternalReference(component cdx.Component, _ packages.Package, url *string, refType cdx.ExternalReferenceType) cdx.Component {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change to appease the linter.

Copy link
Contributor

Choose a reason for hiding this comment

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

While we're at it, would it make sense to remove the packages.Package param altogether and possibly extract the enrichExternalReference to the cdx utils? could be reused in the future for enrichers other than ecosystems

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'll change this in a later PR if that's ok. IMHO we should change all the enrichers anyway, to receive a pointer to a component and mutate; we could do this all in a refactoring PR.

lib/ecosystems/enrich_spdx_test.go Show resolved Hide resolved
@@ -63,7 +64,7 @@ func enrichCDXLicense(component cdx.Component, packageData packages.Package) cdx
return component
}

func enrichExternalReference(component cdx.Component, packageData packages.Package, url *string, refType cdx.ExternalReferenceType) cdx.Component {
func enrichExternalReference(component cdx.Component, _ packages.Package, url *string, refType cdx.ExternalReferenceType) cdx.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're at it, would it make sense to remove the packages.Package param altogether and possibly extract the enrichExternalReference to the cdx utils? could be reused in the future for enrichers other than ecosystems

@mcombuechen mcombuechen merged commit 6bf7ae4 into main Mar 4, 2024
5 checks passed
@mcombuechen mcombuechen deleted the feat/log-msg branch March 4, 2024 10:31
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.

Debug messages
2 participants