Repository navigation
fix(reuse): use Docker image for SPDX generation (#124) - #125
Conversation
The reuse-compliance reusable workflow was exiting 1 even when `reuse lint` reported full compliance. The actual failure was in the Generate SPDX SBOM step, which ran `uv pip install --no-build 'reuse==5.0.2'`. PyPI publishes only one wheel per reuse release (5.0.2 is cp313-only, 6.2.0 is cp310-only), the runner's uv venv defaults to system CPython 3.12, no wheel matches, and `--no-build` (S8541/S8544 mitigation from PR #110) forbids the sdist fallback. Replace the uv-based install with a second invocation of fsfe/reuse-action, passing `args: spdx -o reuse-spdx.spdx`. The Docker image already has reuse installed for the correct Python ABI, so the wheel mismatch goes away, and the security posture is preserved (no host-side pip install). While here: - Gate the Upload SPDX artifact step on the SPDX step outcome so an upload-of-missing-file does not mask the real failure. - Move the `steps.reuse.outcome` shell interpolation in the Summary step into an env var, eliminating the workflow-injection antipattern. - Add SPDX step outcome to the Summary so a future SPDX failure is reported separately from REUSE compliance status. Refs: ByronWilliamsCPA/audio-processor PR #28, run 25982739523 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the reusable REUSE compliance workflow to generate SPDX output via the pinned fsfe/reuse-action Docker action instead of installing reuse with uv, addressing the wheel mismatch described in issue #124.
Changes:
- Removes the
uvsetup and host-sidereuseinstall for SPDX generation. - Adds a second
fsfe/reuse-actioninvocation forreuse spdx. - Updates SPDX upload gating and summary reporting.
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "SPDX SBOM generated and uploaded as artifact." >> $GITHUB_STEP_SUMMARY | ||
| if [ "$SPDX_OUTCOME" = "success" ]; then | ||
| echo "SPDX SBOM generated and uploaded as artifact." >> $GITHUB_STEP_SUMMARY |
PR ReviewStatus: 0 Critical, 3 Important, 2 Suggested. All 24 CI checks green. SonarCloud Quality Gate passed (0 new issues). SHA pin Important (should fix)
Suggested
What this PR does wellRoot-cause analysis in the PR body (traces the actual log sequence and refutes the misleading symptom in #124); security posture preserved ( Generated with Claude Code |
The Summary step previously gated the success message on `SPDX_OUTCOME == success` alone, so an artifact upload failure was silently presented as a successful upload, and a skipped SPDX step (triggered when REUSE lint fails with `fail-on-missing: true` and the job aborts before SPDX runs) was reported as "SPDX SBOM generation failed (outcome: skipped)", sending operators to debug a step that never ran. Address both Copilot findings on PR #125: - Add `id: upload-spdx` to the Upload SPDX artifact step and thread `UPLOAD_OUTCOME` into the Summary step's env block. - Split the SPDX status line into four explicit branches: success+uploaded (happy path), success+upload-failed (artifact is missing), skipped (no SPDX failure to investigate), and any other outcome (genuine generation failure). Also document the intentional `fail-on-missing: false` behavior with an `#ASSUME` comment: SPDX still runs against a possibly non-compliant tree because the SBOM is for transparency, not for gating, and a partial inventory beats none. Refs: ByronWilliamsCPA/.github PR #125 (review comments) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…#124) Per global CLAUDE.md, `fix:` commits must add a CHANGELOG entry. The parent commit on this branch (ed595aa, "fix(reuse): use Docker image for SPDX generation") shipped without one. Backfill the bullet here under [Unreleased] -> ### Fixed, alongside the related #110 entry, covering: the Docker-image SPDX generation switch, the wheel-ABI root cause it solved, the gated upload step, the workflow-injection mitigation (env-var pass-through), the four-way SPDX status split landed in c9f1127, and the documented `fail-on-missing: false` behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
PR Fix SummaryPushed Commits
Findings addressed
Local verification
CI re-run triggered by push. Generated with Claude Code |



Summary
Fixes #124. The reuse-compliance reusable workflow exited 1 even when
reuse lintreported full compliance. Root cause was NOT the conditional in the Summary step (as the issue suggested), but rather theGenerate SPDX SBOMstep failing onuv pip install --no-build 'reuse==5.0.2'.Diagnosis
Reproduced in audio-processor run 25982739523. The actual log sequence:
fsfe/reuse-action(lint) emitsCongratulations! Your project is compliant...and exits 0.Generate SPDX SBOMstep runsuv pip install --no-build 'reuse==5.0.2'and fails with:if: always()) then runs withif [ "success" == "success" ]and correctly takes the Compliant branch, but the job is already marked failed.PyPI publishes only one wheel per
reuserelease (5.0.2 = cp313-only, 6.2.0 = cp310-only). The runner'suv venvuses system CPython 3.12, so no wheel matches, and--no-build(S8541/S8544 mitigation from #110) forbids the sdist fallback. Pinning a Python version is fragile because reuse moves the wheel target each release.The "##[group]Run echo "Some files are missing..."" output the issue quoted is GitHub Actions rendering the full script body of the next step in the group header before execution, not the branch that actually ran.
Fix
Replace the uv-based install with a second invocation of
fsfe/reuse-action, passingargs: spdx -o reuse-spdx.spdx. Docker container actions acceptwith.args:to override the DockerfileCMD; the action's wrapper doesreuse "$@"inside$GITHUB_WORKSPACE, so output lands whereupload-artifactcan find it. The Docker image has reuse installed for the matching Python ABI, sidestepping the wheel mismatch entirely without weakening the--no-buildposture on the runner.Hardening included
Upload SPDX artifactonsteps.spdx.outcome == 'success'so missing-file uploads do not mask failures.steps.reuse.outcometemplate into an env var in the Summary step, eliminating a${{ }}-in-shell injection antipattern (caught by the security hook during edit).Test plan
**Status:** CompliantandSPDX SBOM generated and uploaded as artifact.**Status:** Non-compliantsummary.Follow-ups (not in this PR)
workflow-templates/python-reuse.ymlcaller pin (currently@ea8e190) so new consumers pull the fixed reusable.fail-on-missing: falsesemantics to also suppress SPDX-step failures.Generated with Claude Code