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

⭐️ allow to write sbom reports to a file #3294

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

chris-rock
Copy link
Member

@chris-rock chris-rock commented Feb 13, 2024

Allows users to write sboms directly to a file:

cnquery sbom docker debian:12 -o cyclonedx-json --output-target debian-12.json --record testdata/debian-12-recording.json

Copy link
Contributor

github-actions bot commented Feb 13, 2024

Test Results

2 780 tests  ±0   2 779 ✅ ±0   53s ⏱️ +5s
  186 suites ±0       1 💤 ±0 
    5 files   ±0       0 ❌ ±0 

Results for commit c2bf362. ± Comparison against base commit 305f2aa.

This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-02-16_09:57:04.499621508_+0000_UTC_m=+0.011226490
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-16_09:57:04.499621508_+0000_UTC_m=+0.011226490
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-16_09:57:04.499621508_+0000_UTC_m=+0.011226490#01
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-02-16_12:09:26.018262027_+0000_UTC_m=+0.011313872
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-16_12:09:26.018262027_+0000_UTC_m=+0.011313872
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-16_12:09:26.018262027_+0000_UTC_m=+0.011313872#01

♻️ This comment has been updated with latest results.

@chris-rock chris-rock force-pushed the chris-rock/sbom-reports branch 2 times, most recently from 0f7fdc7 to 532e56d Compare February 13, 2024 22:36
if outputTarget != "" {
filename := outputTarget
if len(boms) > 1 {
filename = fmt.Sprintf("%s-%d.%s", path.Base(outputTarget), i, path.Ext(outputTarget))
Copy link
Contributor

@preslavgerchev preslavgerchev Feb 14, 2024

Choose a reason for hiding this comment

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

nit/question: this might be a problem in CI/CD setups, a user wouldn't expect that we change the filename. can we not write all boms to one file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmh, the current format only has one report included, so we would need one file for a sbom.

@chris-rock chris-rock force-pushed the chris-rock/sbom-reports branch from 532e56d to c2bf362 Compare February 16, 2024 12:07
@chris-rock chris-rock merged commit b742cc0 into main Feb 16, 2024
14 checks passed
@chris-rock chris-rock deleted the chris-rock/sbom-reports branch February 16, 2024 12:16
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants