feat(project): add standalone project sbom command#1246
Open
RoboShyim (roboshyim) wants to merge 2 commits into
Open
feat(project): add standalone project sbom command#1246RoboShyim (roboshyim) wants to merge 2 commits into
project sbom command#1246RoboShyim (roboshyim) wants to merge 2 commits into
Conversation
Expose the existing CycloneDX 1.7 SBOM generator used by project ci as shopware-cli project sbom so merchants can produce the artifact without running the full CI pipeline. - Reuse writeProjectSBOM for both project ci and project sbom - Keep CI skip-when-lock-missing behavior unchanged - Fail with a clear non-zero exit when lock is missing for project sbom - Flags: --format cyclonedx-json, --output/-o, --include-dev-dependencies - Tests + README usage example Closes shopware#1239
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1246 +/- ##
==========================================
+ Coverage 52.94% 52.99% +0.04%
==========================================
Files 300 302 +2
Lines 23152 23213 +61
==========================================
+ Hits 12258 12301 +43
- Misses 10894 10908 +14
- Partials 0 4 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Address review feedback: keep cmd/project as cobra surface only and put the shared CycloneDX generation logic in internal/shop so project ci and project sbom both call shop.WriteProjectSBOM.
Member
|
RoboShyim (@roboshyim) can you open up an PR at shopware/docs to mention this new command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Adds
shopware-cli project sbomso developers can generate the same CycloneDX 1.7 SBOM thatproject cialready produces, without running the full CI build.Flags:
--format— currently onlycyclonedx-json(validated; clear error for anything else)--output/-o— destination path (default:sbom.cdx.jsonin the project root, same as CI)--include-dev-dependencies— optional; off by default to match CIThe shared generator lives in
writeProjectSBOM.project cistill calls it withSkipMissingLock: trueso a lock-less tree does not fail the build. The standalone command fails with a clear non-zero exit whencomposer.lockis missing.Why?
Projects need on-demand SBOMs for security reviews, vulnerability scanning, compliance, and release artifacts. That capability was coupled to
project cionly.Implements #1239
How was this tested?
go test ./cmd/project/ -count=1(pass)go vet ./cmd/project/composer.lock→ writes CycloneDX 1.7 JSON with expected componentscomposer.lock→ non-zero exit + clear errorproject sbom --helpdocuments usageRelated issue or discussion
Closes #1239