Skip to content

ci(license-exceptions): harden decision-workflow parser and untrack stale site/exceptions.json - #1511

Merged
jeefy merged 5 commits into
cncf:mainfrom
jeefy:fix/license-exception-workflow-hygiene
Sep 7, 2026
Merged

ci(license-exceptions): harden decision-workflow parser and untrack stale site/exceptions.json#1511
jeefy merged 5 commits into
cncf:mainfrom
jeefy:fix/license-exception-workflow-hygiene

Conversation

@jeefy

@jeefy jeefy commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

While verifying the License Exception Decision workflow (the one that updates exceptions.json / CSV / SPDX when a decision label is applied), I found it has never actually executed — all 7 historical runs are skipped because the label guard didn't match until #69bbe5b. The parser and generator do work when dry-run offline, but two hygiene issues surfaced:

1. Parser: empty table cells shift columns

row.split('|').map(trim).filter(c => c) dropped blank cells, so a request with an empty Upstream URL column would put the Project Usage URL into packageUrl and the License into... the wrong field entirely (license would become the Purpose text). Now only the leading/trailing pipes are stripped and positions are preserved.

Also unwraps markdown links ([grafana/k6](https://github.com/grafana/k6) → bare URL) and <url> in the URL column, and only sets comment when non-empty.

Verified by extracting the exact github-script block from the YAML and running it against the real body of #1482 plus a synthetic table with an empty cell and no leading pipe.

2. site/exceptions.json was tracked but is a build artifact

pretest copies the canonical file in and posttest deletes it; the Netlify build overwrites it. The committed copy was stale (2026-06-01, 487 entries vs 494) and every npm test left the tree dirty. Removed and gitignored — app.js already falls back to ../exceptions.json.

4. Publish the canonical data URL

A downstream consumer was fetching site/exceptions.json via raw.githubusercontent.com (and therefore getting the stale copy). README now documents https://exceptions.cncf.io/{exceptions.json,CNCF-licensing-exceptions.csv,cncf-exceptions-current.spdx} as the URLs to consume, and netlify.toml adds Access-Control-Allow-Origin: * on those three files.

Before merging: repoint the downstream consumer to https://exceptions.cncf.io/exceptions.json — this PR removes the file it currently reads.

5. Assign generated PRs

Decision PRs stay as PRs (no auto-merge; the main ruleset requires a PR anyway) and are now assigned to @joannalee333 so they have an owner. #1512 was assigned manually.

Test plan

3. Generated commit lacks DCO sign-off

#1512 fails the repo's DCO check because the create-pull-request commit has no Signed-off-by. Added signoff: true.

Not addressed here

peter-evans/create-pull-request uses GITHUB_TOKEN, so the PRs it opens won't trigger validate-exceptions / E2E on themselves. Worth a PAT or GitHub App token as a follow-up.

site/exceptions.json is a build/test artifact: pretest copies the
canonical exceptions.json in and posttest removes it, and the Netlify
build overwrites it. The tracked copy was stale (2026-06-01, 487 entries
vs 494) and running npm test left the tree dirty. Ignore it instead.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
… workflow

- Keep empty table cells so column positions stay stable. Previously
  .filter(c => c) dropped blanks, so an empty Upstream URL shifted the
  license value into the wrong field.
- Unwrap markdown links ([text](url)) and <url> in the Upstream URL
  column so packageUrl is a bare URL.
- Only set comment when the cell is non-empty.

Verified against the body of cncf#1482 and a synthetic row with an empty
cell.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
…orkflow

The repo enforces DCO; the first real run (cncf#1512) failed the DCO check
because the generated commit had no Signed-off-by trailer.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@jeefy
jeefy force-pushed the fix/license-exception-workflow-hygiene branch from 3517e5d to 21230bb Compare September 7, 2026 04:30
…-origin reads

Downstream consumers were fetching site/exceptions.json from
raw.githubusercontent.com, which is a build artifact and had drifted
from the source of truth. Document https://exceptions.cncf.io/ as the
place to fetch JSON/CSV/SPDX from and add Access-Control-Allow-Origin
on those three files so browser-based consumers can use it too.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
Decision PRs are intentionally not auto-merged; assign them so they
land in the reviewer's queue rather than sitting unowned.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@jeefy
jeefy merged commit 6334dfa into cncf:main Sep 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant