Skip to content

Commit 8a6a104

Browse files
committed
ci(security): pin the ScanCode install; pluggy 1.7.0 breaks it
The license gate installed `scancode-toolkit` unpinned. pluggy 1.7.0 (uploaded to PyPI 2026-10-15 09:50 UTC) no longer finds the hookspecs that plugincode 32.0.0 declares on a class (`@pre_scan_spec class PreScanPlugin`), so scancode crashes at import with "ValueError: did not find any 'pre_scan' hooks" and `security / license-gate` fails on every run, whatever the tree. The last green gate started at 09:50:14 UTC; every run since is red. `ci-ok` and the release `verify` job both need the security workflow, so this blocks every PR and the release. Install exactly scancode-toolkit 32.5.0 (the version every green run used) with pluggy constrained to 1.6.0 through PIP_CONSTRAINT, which the pip that pipx runs reads. The local hint in license-gate.sh names the same command. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 8df0639 commit 8a6a104

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎.github/scancode-constraints.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Constraints for the ScanCode install of the license gate (PIP_CONSTRAINT).
2+
# pluggy 1.7.0 (2026-10-15) no longer finds plugincode 32.0.0's class-level
3+
# hookspecs: scancode then crashes at import with "did not find any
4+
# 'pre_scan' hooks" and the gate fails on every run.
5+
pluggy==1.6.0

‎.github/workflows/_security.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4040
- name: Install ScanCode Toolkit
41-
run: pipx install scancode-toolkit
41+
# Pinned: an unpinned install picked up pluggy 1.7.0, which breaks
42+
# scancode at import (see .github/scancode-constraints.txt).
43+
env:
44+
PIP_CONSTRAINT: ${{ github.workspace }}/.github/scancode-constraints.txt
45+
run: pipx install scancode-toolkit==32.5.0
4246
- name: "Gate self-test (a planted violation must be detected)"
4347
run: scripts/license-gate.sh --selftest
4448
- name: "License compliance gate (one finding fails)"

‎scripts/license-gate.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ set -euo pipefail
1313
# the ScanCode pass for runtime; their per-directory license files ARE
1414
# scanned, and layer 1 guarantees each grammar carries one.
1515
#
16-
# Requires: scancode (pipx install scancode-toolkit), python3.
16+
# Requires: scancode (PIP_CONSTRAINT=.github/scancode-constraints.txt
17+
# pipx install scancode-toolkit==32.5.0, as CI does), python3.
1718

1819
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1920
cd "$ROOT"
@@ -79,7 +80,7 @@ echo "OK: every vendored source directory is covered by a license file"
7980

8081
echo "=== License gate 2/2: ScanCode detection ==="
8182
if ! command -v scancode &>/dev/null; then
82-
echo "FAIL: scancode not installed (pipx install scancode-toolkit)"
83+
echo "FAIL: scancode not installed (PIP_CONSTRAINT=.github/scancode-constraints.txt pipx install scancode-toolkit==32.5.0)"
8384
exit 1
8485
fi
8586

0 commit comments

Comments
 (0)