Repo-wide license header check only runs on Python PRs
Summary
Missing license headers in some JS file types can merge to main without CI
catching them, then surface later on an unrelated PR that happens to touch
py/**. We just hit this: two .mjs files added in #5426 failed the license
check on a Python PR that did not add them.
Root cause: two header checks with different coverage
The repo has two separate header checks, and they do not cover the same files.
-
scripts/copyright.ts, run on every PR viapnpm format:checkinformatter.yml(no path filter). It only recognizes these extensions:{ regex: /\.((ts)|(scss)|(js))$/, ... } // .ts .scss .js { regex: /\.html$/, ... } // .html { regex: /\.go$/, ... } // .goSo
.mjs,.cjs,.tsx,.jsx, and.cssare never checked. -
bin/check_license(addlicense), in the "Security and Compliance" job inpython.yml. It scans the whole repo and does recognize.mjs, but the workflow is path filtered:on: pull_request: paths: - "py/**" - "genkit-tools/**" - ".github/workflows/python.yml"So it only runs when a PR touches Python.
Why #5426 slipped through
#5426 added eslint.config.mjs and postcss.config.mjs with no header.
- The always-on check (
scripts/copyright.ts) ignores.mjs, so it passed. - The check that catches
.mjs(addlicense) never ran, because the PR was JS only and did not touchpy/**.
The next PR to touch Python ran addlicense, which scans everything, and failed
on the two .mjs files. The failure pointed at the wrong PR and author.
Fix options
- Add the missing extensions (
.mjs,.cjs,.tsx,.jsx,.css) toscripts/copyright.tsso the always-on check covers them. Smallest change. - Run
bin/check_licenseon all PRs instead of onlypy/**, so the comprehensive scan is not gated behind Python. - Settle on one tool as the source of truth so coverage cannot drift between the two.