feat(api): add generateSbom API method and SBOM CLI command#396
Conversation
Add a new public generateSbom(String manifestFile) method to the Api interface and its ExhortApi implementation. The method generates a CycloneDX SBOM from a manifest file locally using the existing provider infrastructure, without sending anything to the backend. Add a new 'sbom' CLI command with an --output flag. Without --output, the SBOM JSON is printed to stdout. With --output <path>, it is written to the specified file. Implements TC-3991 Assisted-by: Claude Code
Review Summary by QodoAdd generateSbom API method and SBOM CLI command
WalkthroughsDescription• Add generateSbom() API method for local SBOM generation • Implement new sbom CLI command with optional --output flag • Support CycloneDX SBOM generation without backend calls • Add comprehensive tests and documentation for SBOM functionality Diagramflowchart LR
A["Manifest File"] -->|"generateSbom()"| B["ExhortApi"]
B -->|"getProvider()"| C["Ecosystem Provider"]
C -->|"provideStack()"| D["CycloneDX SBOM JSON"]
D -->|"--output flag"| E["Write to File"]
D -->|"no flag"| F["Print to stdout"]
File Changes1. src/main/java/io/github/guacsec/trustifyda/Api.java
|
Code Review by Qodo
|
ExhortApi constructor no longer validates TRUSTIFY_DA_BACKEND_URL eagerly. The endpoint is resolved lazily on first use (when an HTTP call is about to be made). This allows generateSbom() and the CLI 'sbom' command to operate without a backend URL configured, since they only perform local SBOM generation. Implements TC-3991 Assisted-by: Claude Code
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Verification Report for TC-3991 (commit 3edf7c1)
Overall: WARNIssues noted (non-blocking):
Acceptance Criteria Details:
This comment was AI-generated by sdlc-workflow/verify-pr v0.5.10. |
ruromero
left a comment
There was a problem hiding this comment.
The implementation is correct. Just 2 minor comments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
thank you for the review, PR is updated. |
Add a new public generateSbom(String manifestFile) method to the Api interface and its ExhortApi implementation. The method generates a CycloneDX SBOM from a manifest file locally using the existing provider infrastructure, without sending anything to the backend.
Add a new 'sbom' CLI command with an --output flag. Without --output, the SBOM JSON is printed to stdout. With --output , it is written to the specified file.
Implements TC-3991
Assisted-by: Claude Code