Skip to content

The licence surface comes from the kit - #453

Merged
jmchilton merged 2 commits into
mainfrom
license-surface-adopt
Aug 6, 2026
Merged

The licence surface comes from the kit#453
jmchilton merged 2 commits into
mainfrom
license-surface-adopt

Conversation

@jmchilton

Copy link
Copy Markdown
Member

The licence chips beside a note and the vendored-licence page were written here and written again in a sibling instance. Both now ship in @galaxy-foundry/site-kit, and @galaxy-foundry/license-policy 0.4 renames the file-id helpers so the two id spaces stop sharing a word. This adopts all of it.

The rename found four pins, not three

licenseIdFromFilePathlicenseFileIdFromPath, and LicenseFile.licenseIdLicenseFile.id. There are two id spaces: LicenseId is SPDX (MIT), LicenseFileId is the stem of a vendored copy (planemo). The old names claimed the second was the first, so licenseIdFromFilePath returned planemo and every reader had to already know that.

Bumping the range broke the build in exactly the eight places that held the confusion. It also surfaced a pin I would not have gone looking for: the root package.json carried license-policy at ^0.3.0 alongside site/ and two workspace packages. A caret on a 0.x version pins the minor, so the test side and the site side would have resolved different copies of the table.

What moved and what did not

now from the kit stayed ours
the three chips (LicenseBadge) the box around them, and the obligations line inside it
the policy rows, the redistributed-by list, the licence text (LicenseFileBody) which notes redistribute under a copy — our corpus is one flat collection at /{id}/
redistributesUnder, licenseFileHref, LICENSE_FILE_ROUTE the page's <h1> and eyebrow

The obligations line stays because it answers a different question than the badge does. What a licence permits travels with the licence; what this note owes for using it is ours. That is the line the policy table's own header comment draws, and it is why the badge reads license and nothing else — no license_file, no attribution, no link.

redistributesUnder(note.license_file, licenseFile.id) replaces an equality between two things both called licenseId. Cross-checked against the old filter on built output: galaxy 3, galaxy-tool-util-ts 5, nf-core-modules 2, nf-schema 1, planemo 1, cwl-v1.2 0 — identical, including the copy no note uses.

Three literals became theme, and the test is new

#16a34a, #d97706 and #dc2626 lived inside the component that drew them, here and in the sibling — the same three values, typed twice. The component names --color-license-* now, and this repo declares them.

That substitution fails silently: an undeclared custom property inside color-mix() yields a chip with no background and no error. Legible text, no colour, a page that looks designed rather than broken. So built-shell.test.ts asserts licenseBadgeStyleGaps and licenseFileStyleGaps against the emitted stylesheet. Deleting one token fails it and names the token — checked, not assumed.

Note this is the opposite direction from the dead-token assertion already in that file. That one catches a token declared and referenced by nothing; this one catches a token referenced and declared by nothing. Neither implies the other.

Two visible changes

The name chip reads the table's name column. Apache-2.0 renders as "Apache 2.0", with the SPDX id kept as the chip's title. name equals the id in 1 of 23 rows, so rendering the id is legible right up until it isn't — the sibling instance has a LicenseRef-arXiv-nonexclusive-distrib-1.0 that becomes a pill teaching a reader nothing. Our corpus carries only MIT and Apache-2.0, so this is the whole of the change here.

Bare URLs in a licence text are now links. The sibling did this; we shipped a <pre> a reader had to retype from. planemo.LICENSE points at CONTRIBUTORS.md and that was a string. Everything outside a matched URL is emitted verbatim, whitespace included, which is what the license_file obligation is for.

The regression this branch caused and then didn't ship

The first commit dropped our <h2>License text</h2> — the shared body had followed the sibling, which never had one, leaving the licence inside the "Redistributed by" outline. A reader moving by heading would land on a list of notes and find the terms somewhere past the end of it.

Fixed upstream (jmchilton/foundry-lib#70) rather than patched back here, so the sibling gets the heading too, and taken as site-kit@0.6.1 in the second commit. Verified on built output: all six licence pages carry it, cwl-v1.2 included — the page with no note list at all, which is the case that would have regressed if the heading had been hung off the note-list section.

Verification

303 tests across 21 files. astro check 0 errors over 69 files. packages-typecheck, packages-test, and pnpm validate at 0 errors across 242 files. The 49 validator warnings are pre-existing (eval.md / scenarios.md on molds and pipelines).

lint and format in this repo cover packages/* only; nothing here touches those trees.

The badge and the vendored-licence body ship in @galaxy-foundry/site-kit; the
policy table's file-id helpers were renamed in 0.4 so the two id spaces stop
sharing a word. Adopt both.

What was ours and stayed ours: which notes redistribute under a copy (our
corpus is one flat collection at /{id}/), the page's <h1>, and the box around
the chips — the obligations line is what this note owes, not what the licence
permits.

Three colours stop being literals inside a component and become theme, so
built-shell asserts the tokens arrive. Dropping one fails it; nothing else
would, because an undeclared property inside color-mix() renders a chip with
no background and no error.

Two visible changes. The name chip reads the table's `name` column, so
Apache-2.0 renders as "Apache 2.0" with the SPDX id on hover. And bare URLs
in a licence text are now links — planemo's CONTRIBUTORS.md was a string a
reader had to retype.
The adoption dropped our <h2>License text</h2> — the shared body had followed
the sibling instance, which never had one, leaving the licence inside the
"Redistributed by" outline. Fixed upstream rather than patched back here, so
both instances get the heading.
@jmchilton
jmchilton merged commit 337322c into main Aug 6, 2026
1 check passed
jmchilton added a commit that referenced this pull request Aug 8, 2026
site-kit 0.7.0 ships two more specimen groups, and the coverage check stops
the build until this page has an opinion about both. Both inline, both on the
props the kit ships and nothing added: unlike the reference card, whose kinds
are ours, the policy table is not — registries.ts gets it from bundledPolicy()
and so do the specimens, so there is no second group to author. What the badge
group is for is the ids. Every note here that declares a licence names MIT or
Apache-2.0, and the four cases the chips' colours exist to tell apart are the
four the corpus does not carry.

The badge is also the first specimen whose props coincide with a real page's.
#453 put LicenseBadge in every note's licence box, so the same component now
renders on both surfaces in one built site under one stylesheet, and the new
test compares the markup byte for byte on every page carrying a licence both
sides have. That is the claim the reference gallery cannot make. It fails on
the plausible repair: a gallery that stopped compiling is quickest fixed by
writing the four lines of chip markup here instead of importing them, and
nothing else would go red.

Today that is MIT and nothing else, which the test says out loud rather than
implying it covered the group. LicenseFileBody gets no version of it: the
kit's file specimens invent four copies this repo does not redistribute, so
there is no overlap to compare.
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