diff --git a/.gitignore b/.gitignore index 3bac384..358a709 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ target/ # Generated locally by rust_autobadges/Cargo Tarpaulin /tarpaulin-report.html +# cargo-cyclonedx emits one intermediate SBOM beside every workspace manifest. +**/sbom.cdx.json + # cargo-fuzz runtime output /fuzz/artifacts/ /fuzz/coverage/ diff --git a/Jenkinsfile b/Jenkinsfile index e7a688d..c284a0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -234,6 +234,10 @@ pipeline { echo "Building John Slop release binaries..." + # Jenkins reuses workspaces. Remove only ignored release + # output so rerunning the same commit stays deterministic. + rm -rf -- dist + # The packaging script reads and validates Cargo.toml itself. scripts/package-release.sh diff --git a/scripts/package-release.sh b/scripts/package-release.sh index 6c335cf..6b94f4f 100755 --- a/scripts/package-release.sh +++ b/scripts/package-release.sh @@ -19,6 +19,15 @@ bundle_name="john_slop-${release_version}-${target_triple}" bundle_dir="dist/${bundle_name}" archive_path="dist/${bundle_name}.tar.gz" +cleanup_intermediate_sboms() { + rm -f \ + sbom.cdx.json \ + crates/john-slop-core/sbom.cdx.json \ + crates/john-slop-lsp/sbom.cdx.json +} +trap cleanup_intermediate_sboms EXIT +trap 'exit 1' HUP INT TERM + if [ -e "$bundle_dir" ] || [ -e "$archive_path" ]; then echo "release output already exists for $bundle_name; move it aside first" >&2 exit 2 diff --git a/tasks.md b/tasks.md index 8d6e73a..a33cfbb 100644 --- a/tasks.md +++ b/tasks.md @@ -701,6 +701,15 @@ policy/audit checks, Unicode-catalog reproducibility, and workspace package assembly pass; coverage is 92.72% (1,604/1,730 lines), and all release metadata and binary versions agree on `0.1.26`. +## Post-milestone CI maintenance + +- [x] Prevent per-package `cargo cyclonedx` intermediates and retained release + bundles from breaking later builds in a reused Jenkins workspace. + +Acceptance: workspace packaging ignores stale generated SBOMs, release packaging +removes its per-package SBOM intermediates on success or failure, and Jenkins can +rebuild the same release commit without retaining an earlier `dist/` bundle. + ## Deferred by design - Statistical or model-based authorship classification.