Skip to content

ci: the SPDX header guard does not look at the book's CSS/JS or flake.nix - #960

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/spdx-guard-web-assets
Aug 17, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/spdx-guard-web-assets

Conversation

@vyncint

@vyncint vyncint commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

scripts/check-spdx-headers.sh globs *.rs *.sh *.py *.cu *.c *.h *.ll. Eight tracked first-party files fall outside that list, so nothing checks their headers:

cuda-oxide-book/_static/css/custom.css
cuda-oxide-book/_static/css/lightbox.css
cuda-oxide-book/_static/css/nvidia-sphinx-theme.css
cuda-oxide-book/_static/js/lightbox.js
cuda-oxide-book/_static/js/spa-nav.js
cuda-oxide-book/_templates/footer.html
cuda-oxide-book/_templates/globaltoc.html
flake.nix

All eight already carry the standard two-line header, so this changes no file and fails nothing today. That is the point: someone wrote them correctly and nothing was watching, which is precisely the hazard the guard's own header describes — the OSRB review fixed 32 files in #812, and the next two scripts to land (#819, #835) arrived bare and had to be fixed again. A new book stylesheet or Sphinx template can land the same way now and CI stays green.

These files are in policy scope, not out of it: CONTRIBUTING's "License Headers" section already names HTML's comment form. Only the guard's glob was short.

Changes

  • Add *.js *.css *.html *.nix to the git ls-files glob.
  • Update the scope comment (file count 1795 → 1803) and record why the four extensions are there.

Testing

Local, no GPU and no toolkit — this guard reads text and runs in under a second.

Case Before After
clean tree OK (1795 files) OK (1803 files)
header stripped from flake.nix OK — passed error: flake.nix: missing SPDX-FileCopyrightText line, exit 1
header stripped from _static/js/spa-nav.js OK — passed error: ... spa-nav.js: missing SPDX-FileCopyrightText line, exit 1

nvidia-sphinx-theme.css carries Copyright (c) 2023-2024, which the existing regex's optional year-range branch already accepts, and its header sits on lines 2–3 of a minified file — inside the 15-line window.

  • Guards pass (check-spdx-headers.sh plus the eight status-guard scripts)
  • cargo oxide run <example> — not applicable, no code path changes
  • New example added — not applicable

`check-spdx-headers.sh` globs `*.rs *.sh *.py *.cu *.c *.h *.ll`. Eight
tracked first-party files fall outside that list and are therefore unchecked:

  cuda-oxide-book/_static/css/custom.css
  cuda-oxide-book/_static/css/lightbox.css
  cuda-oxide-book/_static/css/nvidia-sphinx-theme.css
  cuda-oxide-book/_static/js/lightbox.js
  cuda-oxide-book/_static/js/spa-nav.js
  cuda-oxide-book/_templates/footer.html
  cuda-oxide-book/_templates/globaltoc.html
  flake.nix

All eight already carry the standard two-line header, so this changes no
file and fails nothing today. That is exactly the hazard the guard's own
header describes: the OSRB review fixed 32 files in NVIDIA#812, and the next two
scripts to land (NVIDIA#819, NVIDIA#835) arrived without headers because nothing was
watching that extension. The same is true here one file type over -- a new
book stylesheet or template can land bare and CI stays green.

CONTRIBUTING already names HTML's comment form in the header policy, so
these files are in policy scope; only the guard's glob was short.

Verified: the guard passes unchanged over the extended scope (1803 files,
up from 1795), and stripping the header from `flake.nix` or from
`_static/js/spa-nav.js` now fails the run, where before it passed.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added bug Something isn't working build-related Build scripts, toolchain discovery, or compilation setup supply-chain Dependency policy: licenses, sources, security advisories, lock files labels Aug 17, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

Ran the guard's regexes against all eight newly covered files:

  • all pass, including the 2023-2024 year range in the minified theme CSS,
  • no rustlantis or exempt file has the new extensions,
  • so nothing breaks today, and the next headerless stylesheet or template gets caught in CI instead of a license audit.

Merging.

@nihalpasham
nihalpasham merged commit a538be6 into NVIDIA:main Aug 17, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working build-related Build scripts, toolchain discovery, or compilation setup supply-chain Dependency policy: licenses, sources, security advisories, lock files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants