You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOC: Document SBOM and SPDX tooling in Utilities/Maintenance
README section listing the five SBOM-related Python scripts added in
this PR and the typical workflows (add headers, verify versions,
validate SBOM, baseline fingerprint).
Copy file name to clipboardExpand all lines: Utilities/Maintenance/README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,3 +8,57 @@ Note that the files in this directory are not tested automatically
8
8
by the continuous integration (CI) of the ITK git repository. So a
9
9
git commit that only modifies files in this directory should not
10
10
trigger a run of the CI.
11
+
12
+
## SBOM and SPDX Tooling
13
+
14
+
The following scripts support ITK's SPDX-2.3 Software Bill of Materials
15
+
workflow (see `CMake/ITKSBOMGeneration.cmake` and
16
+
`CMake/ITKSBOMValidation.cmake`). All require Python 3.10 or later.
17
+
18
+
| Script | Purpose |
19
+
|--------|---------|
20
+
|`AddSPDXHeaders.py`| Prepend SPDX-FileCopyrightText / SPDX-License-Identifier lines to ITK-owned source files. Idempotent; skips files that already carry an SPDX header. Used by the `check-spdx-headers` pre-commit hook with `--check --files <paths>` to enforce SPDX on new files. Handles shebangs, UTF-8 BOM, and CRLF line endings safely. |
21
+
|`VerifySPDXVersions.py`| Cross-check that each ThirdParty module's `SPDX_VERSION` in `itk-module.cmake` matches the tag declared in its `UpdateFromUpstream.sh`. Skips modules tracking `master`, commit SHAs, or ITK-custom `for/*` tags. Invoked by CTest as `ITKSBOMVersionConsistency`. |
22
+
|`ValidateSBOMLight.py`| In-tree lightweight validator for the generated SBOM. Checks required SPDX 2.3 fields, license-reference integrity, and SPDXID uniqueness. Always runs via CTest `ITKSBOMValidation`. |
23
+
|`ValidateSBOMWithSpdxTools.py`| Full SPDX 2.3 schema validation via the optional `spdx-tools` pip package. Returns CTest skip code 77 when `spdx-tools` is not installed so the test is optional rather than a hard dependency. Invoked by CTest as `ITKSBOMSchemaValidation`. |
24
+
|`ComputeSBOMFingerprint.py`| SHA-256 fingerprint over the sorted, canonicalized SBOM package metadata (name, version, license, PURL). Used for drift detection between branches and in CI via CTest `ITKSBOMFingerprint` when `ITK_SBOM_FINGERPRINT_BASELINE` is set. |
0 commit comments