fix: require the redirect that makes a landing reachable - #25
Merged
Conversation
Since package-build 15 (HeroicLands/package-build#182) a package's landing is published at `/<package>/homepage-<shortcode>/`, and `/<package>/` — the canonical address, the one every link points at and the one the site router proxies — is Hugo's site root: chrome around an empty `<main>`. What connects them is a `_redirects` entry the package authors, and nothing checked for it. The guard requires `_headers` at the deployment root and never `_redirects`, so a build that emits a perfect landing and no redirect passes every check, deploys, and serves a blank page at the package's canonical URL. `sohl-kethira-basic` shipped exactly that; it was noticed by eye and fixed by hand (HeroicLands/sohl-kethira-basic#83) with every check green. Require it. Keyed on the landing, which by that point in the step IS the new-shape signal: a post-#182 tree with no landing has already been refused (#23), so an empty `landing` is a pre-#182 caller — and those three serve their landing at `/<package>/` itself and correctly author no `_redirects`. Both path forms are required, because Pages matches a rule against the raw `url.pathname` before any trailing-slash handling, so `/<package>` and `/<package>/` are distinct keys and a rule for one leaves the other blank. The destination is derived from the landing that was actually found, never assumed: the shortcode is the author's. The first matching rule is the one read, as Pages reads it, so a wrong rule cannot be rescued by a right one after it. The status column is not read — 301, 302 and a 200 rewrite all arrive at the landing, and what this catches is a rule that is absent, not one misnumbered. A guard, not a fallback, unlike `_headers`: the destination is the landing's own address, which is the package's to state and not this workflow's to guess. Closes #24
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since package-build 15 (package-build#182) a package's landing is published at
/<package>/homepage-<shortcode>/, and/<package>/— the canonical address, the one every link points at and the one the site router proxies — is Hugo's site root: chrome around an empty<main>. What connects them is a_redirectsentry the package authors, specified inMIGRATING.md§3 of that release.Nothing checked for it. The guard requires
_headersat the deployment root and never_redirects, so a build that emits a perfectly good landing and no redirect passes every check in this file, deploys, and serves a blank page at the package's canonical URL.sohl-kethira-basicshipped exactly that; it was noticed by eye and fixed by hand (sohl-kethira-basic#83), not caught by anything here. Same visitor-facing outcome as #21, down a different path: #21 was a build that produced no landing, this is a build that produced one nothing routes to.Require it.
Keyed on the landing, which by that point in the step is the new-shape signal. A post-#182 tree carrying no landing has already been refused by #23, so an empty
landingat this line is a pre-#182 caller — andharn-adventures,harn-ensembleandHarnMaster-3-FoundryVTTserve their landing at/<package>/itself and correctly author no_redirects. So no second version read is needed: the one #23 added already stands between the two shapes.Both path forms. Cloudflare Pages matches a rule against the raw
url.pathname, before any trailing-slash handling, so/<package>and/<package>/are distinct keys and a rule for only one of them leaves the other on the blank root. Each is required separately, with its own message.The destination is derived, never assumed. It comes from the landing that was actually found, so a package whose homepage note carries a different shortcode is measured against its own address. The first matching rule is the one read, as Pages reads it, so a wrong rule cannot be rescued by a correct one placed after it.
The status column is not read. Every value a package would plausibly write there arrives at the landing — 301, 302, or a 200 rewrite — and what this guard exists to catch is a rule that is absent, not one that is misnumbered.
A guard, not a fallback, unlike
_headersabove. The destination is the landing's own address, which is package-specific, so there is no generic file this workflow could write instead.Verification
The guard step's
run:body and the default-_headersstep's were extracted verbatim withyqand driven against the real built trees of all four callers —kethiraatsohl-kethira-basic#84, andharnadventures,hm3andharnensembleas their repositories build today — each with the@heroiclands/package-buildits checkout actually installs (15.0.0 / 9.0.0 / 9.0.0 / 10.0.0). The three pre-#182 trees emit no_headers, so the workflow's own default step was run against them first, as it is in the job.kethira_redirectskethira_redirectsdeletedkethira_redirectsemptykethira/kethira/rule/kethirakethira/kethirarule/kethira/kethira/kethira/kethirakethirakethira#comment on a rulekethirakethirakethira302instead of301kethirakethira2 page(s)harnadventures_redirects1 page(s)hm3_redirects1 page(s)harnensemble_redirects1 page(s)index.htmlremovedshellcheck -s bashis clean on the extracted body,actionlintis clean on the file, and it parses as YAML.What this does not do
It does not check the pinned
Cache-ControlthatMIGRATING.md§3 asks for alongside the redirect. That is a caching decision, not a blank page, and it is the package's_headersto write.#21is untouched and stays open: its remaining criteria are that every caller reaches package-build >= 15 and that #20's transitional branch then goes, which is three content migrations in three other repositories.Closes #24