Repository navigation
fix(404): resolve the 404 page from the site root, and bound the weekly crawl - #167
Merged
Merged
Conversation
…ly crawl — Closes embeddedos-org#166 GitHub Pages serves /404.html at the missing path itself, and its relative URLs (style.css, index.html, docs/index.html, ...) resolved under that path: every asset 404'd, and linkinator --recurse followed the links one level deeper each time until the job was cancelled at 6 h. <base href="/"> makes them resolve from the root (base-uri 'self' in the page's CSP allows it). health-check gets timeout-minutes: 45 so a future hang fails visibly instead of being silently cancelled. tests/not-found.spec.js loads a nested missing path and requires a 404 status, no failed same-origin request, and no link under that path: fails against the old 404.html (6 failed assets), passes with this one.
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.
Closes #166
Changes
404.html<base href="/">after the charset, so its relativestyle.css,index.html,docs/…and the rest resolve from the site root at any missing path. The page's CSP already hasbase-uri 'self'..github/workflows/health-check.ymltimeout-minutes: 45on the crawl job, so a future hang fails visibly instead of being silently cancelled at 6 h.tests/not-found.spec.js(new)/no/such/page/). Requires a 404 status, no failed same-origin request, and no internal link under that path.Verification
Measured at f70dea7.
1. The crawl itself. linkinator 6 with the job's flags, starting at the missing path
/eVera/. The repo was served by a small local server that answers unknown paths with404.htmland status 404, as GitHub Pages does.404.html2. The new test. With the current
404.htmlit fails: 6 of the page's own assets return 404. With this PR it passes.3. Existing 404 checks.
npx playwright test tests/links.spec.js tests/seo.spec.js tests/accessibility.spec.js --project=chromium -g 404: 10/10 pass with this PR.4.
actionlint .github/workflows/health-check.yml(1.7.12): pass.Two related problems, not in this PR:
/eVera/,/eRide/, …, viadocs/manifest.json). I'll file that separately.ci.ymlonly triggers onmainanddevelop, so the Playwright suite never runs onmaster. I'll file that separately too.This is a fork PR, so the workflows need a maintainer's approval to run.