Skip to content

hotfix(sbom): accept any CycloneDX 1.x; surface cyclonedx-py stderr#269

Merged
jinhongkuan merged 1 commit into
mainfrom
hotfix/v0.14.1-sbom-relax
May 7, 2026
Merged

hotfix(sbom): accept any CycloneDX 1.x; surface cyclonedx-py stderr#269
jinhongkuan merged 1 commit into
mainfrom
hotfix/v0.14.1-sbom-relax

Conversation

@jinhongkuan

Copy link
Copy Markdown
Contributor

v0.14.1 publish run #2 failed at SBOM gen — the prior hotfix's --schema-version 1.5 flag was rejected by cyclonedx-py 7.x with exit 2 (argparse error). Stderr was captured but invisible from the workflow log, so the actual error never surfaced. This commit: (1) drops the flag, (2) accepts any CycloneDX 1.x output (forward-compatible spec family), (3) prints captured stderr on subprocess failure for future-debuggability.

v0.14.1 publish run #2 still failed at SBOM gen — the previous hotfix
added `--schema-version 1.5` to the cyclonedx-py command but
cyclonedx-py 7.x rejected the flag with exit code 2 (argparse error,
"command-line usage error"). Stderr was captured but never printed,
so the actual error message was invisible from the publish workflow log.

This commit:

1. Drops the `--schema-version` flag entirely. cyclonedx-py emits
   whichever CycloneDX 1.x revision is its default (currently 1.6).
2. Loosens the validator from `specVersion == "1.5"` to `specVersion`
   starts with "1.". CycloneDX is forward-compatible within 1.x;
   every consumer that reads 1.5 reads 1.6.
3. On `subprocess.CalledProcessError`, prints the captured stderr to
   our own stderr before re-raising. Future CLI-flag drift becomes
   diagnosable from the workflow log without re-running.
4. Module docstring updated — title is "CycloneDX SBOM emitter" (no
   1.5 anymore), policy section explains the version drift fight.

The contract reduction from "exact 1.5" to "any 1.x" is a deliberate
trade for resilience against transitive `cyclonedx-bom` upgrades. If
we ever need to pin to a specific spec version for compliance reasons,
the right move is to pin `cyclonedx-bom` itself in pyproject.toml
[release] extras and document the dependency-policy decision.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jinhongkuan jinhongkuan merged commit 18e1414 into main May 7, 2026
@jinhongkuan jinhongkuan deleted the hotfix/v0.14.1-sbom-relax branch May 7, 2026 22:29
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jinhongkuan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 35 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 08abde56-c6d5-4c59-9e59-050f7f144499

📥 Commits

Reviewing files that changed from the base of the PR and between b259141 and 27f9c88.

📒 Files selected for processing (1)
  • release/sbom_emit.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/v0.14.1-sbom-relax

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant