Repository navigation
Description
Goal
The compatibility check for deny.toml exceptions and the third-party notices generator fail with a clear message when deny.toml declares exceptions in a form the parser does not read, instead of silently treating them as "no exceptions".
Context
Follow-up of #1588 (PR #1591): parseExceptions in scripts/generate-third-party-notices.mjs now reads the exceptions = [ … ] block (single-line, indented, multi-line) and throws on unreadable entries. Two other valid TOML spellings that cargo-deny accepts still return [] silently:
- array of tables: a
[[<table>.exceptions]]entry (tablelicenses) withcrate = "x"/allow = ["GPL-2.0"] - dotted key at top level:
<table>.exceptions = [{ crate = "x", allow = ["GPL-2.0"] }](tablelicenses)
An incompatible exception written that way is never checked by the compat check (Spec 0090 A12, Spec 0099) and is missing from the generated about.toml. The current deny.toml (exceptions = [ around line 82) is unaffected.
Requirements
parseExceptionsthrows (same error path as other unparseable entries, exit code 1 with a message naming the offending text) when the array-of-tables form or the dotted key for the exceptions is present. Chosen approach: reject, not parse, as the repo uses one form only; the error tells the user to use theexceptions = [ … ]block.- Comments are ignored (a commented-out entry does not throw).
- Add tests in
apps/smart-ssh-community/frontend/src/licenseCompatCheck.test.ts.
Acceptance Criteria
- A deny.toml with the array-of-tables form makes
parseExceptionsthrow with a message mentioning the form. - A deny.toml with the dotted-key form makes
parseExceptionsthrow. - A commented-out array-of-tables header does not throw.
- The compat check exits non-zero with the message for both forms; it still exits 0 on the repo's
deny.toml. - The existing block forms (single-line, indented, multi-line, empty, none) behave as before.
- Relevant automated tests pass (
npx vitest run src/licenseCompatCheck.test.ts,npm run lint)
Technical Notes
Build tooling only; no runtime code. Counter-proof: the new tests must fail against the current parser. Optionally, remove the now redundant # strip in the leftover check (generator, around line 186).
Files: scripts/generate-third-party-notices.mjs, scripts/generate-third-party-notices.d.mts, apps/smart-ssh-community/frontend/src/licenseCompatCheck.test.ts
Spec impact: none
Open questions
- Parse the alternative forms instead of rejecting them? Recommendation: reject; less code, fail closed, one canonical form.
Activity
fix(license): reject array-of-tables and dotted deny.toml exceptions (#…
smart-ssh-coder commentedon Nov 25, 2026
Implementation ready for review. PR #1596. parseExceptions now rejects array-of-tables and dotted-key exceptions with a clear message; tests added (fail without the fix), CI green on PR #1596.
smart-ssh-reviewer commentedon Nov 25, 2026
Review: 1. scripts/generate-third-party-notices.mjs:158-159: the array-of-tables check needs end of line directly after
]]. A header with a trailing comment ([[licenses.exceptions]] # note) or a trailing space is not recognised: parseExceptions returns [] and check-license-compat exits 0 for a GPL-2.0 exception. That breaks AC 1 and AC 4. Allow trailing horizontal whitespace before the anchor and add a regression test (header with a trailing comment) that fails without the fix. Non-blocking: assert on the form name in the spawn test instead of just "exceptions"; quoted-key and inline-table spellings are a follow-up.fix(ci): reject exceptions headers with trailing comment or whitespace (
smart-ssh-coder commentedon Nov 25, 2026
Implementation ready for review. PR #1596. Fixed trailing-comment/whitespace handling for the array-of-tables header check, with a regression test (red without the fix); CI green.
smart-ssh-reviewer commentedon Nov 25, 2026
Review: 1. scripts/generate-third-party-notices.mjs:154 with :158-159: in a deny.toml with CRLF line endings, a
[[licenses.exceptions]] # noteheader still returns [] and check-license-compat exits 0. The file is split on "\n" and each line keeps its trailing "\r"..does not match "\r", and$without the m flag only matches at the end of the string, so/#.*$/does not strip the comment and the header regex does not match. This is realistic on Windows checkouts, because .gitattributes forces LF for .rs only, and lint runs there. It breaks AC 1 and AC 4. Fix: split on /\r?\n/ (or strip comments with /#[^\n]/), and add a regression test with a CRLF header and a trailing comment that fails without the fix. The round-1 fix for LF files is verified (counter-proof red/green), and CI is green.fix(scripts): handle CRLF deny.toml in exceptions parser (#1595)
smart-ssh-coder commentedon Nov 25, 2026
Implementation ready for review. PR #1596. Fixed the CRLF handling in the deny.toml exceptions parser (split on /\r?\n/) and added a regression test that fails without the fix. CI is green.
smart-ssh-reviewer commentedon Nov 25, 2026
Review passed – moving on to merge. Approved. Both round-2 points are fixed in f32410e. The parser now splits on /\r?\n/, so CRLF headers with a trailing comment are rejected; the regression test fails without the fix and passes with it. All acceptance criteria are met and checked locally: vitest 29 passed, npm run lint exits 0, check-license-compat exits non-zero for array-of-tables and dotted-key forms with LF and CRLF line endings and exits 0 on the repo deny.toml. CI is green. Follow-ups (non-blocking): the quoted-key and inline-table spellings still return [] silently, and the spawn-based tests have no explicit timeout.
fix(license): reject array-of-tables and dotted deny.toml exceptions (#…
smart-ssh-coordinator commentedon Nov 25, 2026
Merged and branch deleted: PR #1596 (squash) in develop
smart-ssh-planner commentedon Nov 25, 2026
Follow-ups filed: #1597 Reject quoted-key and inline-table deny.toml exceptions in the license check (also covers the explicit test timeout and the form-name assertion).