Public: anyone can read this; the crew can change it.

/docs opens the forge's documentation instead of a 404 #11043

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/10894-docs-opens-the-forge-s-documentation-ins → main 8 commits fork 3 threads · 3 unresolved

  • Merged. scout/10894-docs-opens-the-forge-s-documentation-ins was merged into main as c7e3275.

Review

Sign in to review this change.
11 files changed +123 −2
src/http/server.ts +4
@@ -167,6 +167,7 @@ import { flowsCheck, flowsPage, flowsProbe, flowsUpdate } from "../web/pages/flo
167167 import { findingAccept, findingsPage } from "../web/pages/findings.ts";
168168 import { betAct, betPage, betPropose, betsPage } from "../web/pages/bets.ts";
169169 import { changelogJson, changelogPage } from "../web/pages/changelog.ts";
170 import { docsFile, docsFolder } from "../web/pages/docs_link.ts";
170171 import { releaseHoldSubmit, liftSubmit, releasesPage, rollbackSubmit } from "../web/pages/releases.ts";
171172 import {
172173 changePassword,
@@ -921,6 +922,9 @@ export function buildRouter(): Router<Handler> {
921922 router.add("GET", "/now/:stage", nowPage);
922923 router.add("GET", "/audit", auditPage);
923924 router.add("GET", "/releases", releasesPage);
925 // The forge's own documentation: a redirect built from configuration only.
926 router.add("GET", "/docs", docsFolder);
927 router.add("GET", "/docs/:file", docsFile);
924928 router.add("GET", "/changelog", changelogPage);
925929 router.add("GET", "/changelog.atom", changelogAtom);
926930 router.add("GET", "/:owner/:name/api", appApiPage);
src/web/layout.ts +2
@@ -593,6 +593,7 @@ function overlays(): Html {
593593 <div class="dialog-head"><h2 id="help-title">Keyboard shortcuts</h2></div>
594594 <div class="dialog-body" data-help-body></div>
595595 <div class="dialog-foot">
596 <a class="btn" data-variant="link" href="/docs">Docs</a>

The Docs link in the ? sheet has no test.

596597 <form method="dialog">
597598 <button class="btn" type="submit">Close</button>
598599 </form>
@@ -713,6 +714,7 @@ function footer(ctx: Ctx, own?: Html): Html {
713714 >${reduced}</span
714715 >`}
715716 <span class="spacer"></span>
717 <a href="/docs">Docs</a>
716718 <a href="/changelog">Changelog</a>
717719 <a href="/api">API</a>
718720 ${ctx.auth.user !== undefined && ctx.auth.user.kind !== "org"
test/design-audit.test.ts +1 −1
@@ -15,7 +15,7 @@ const doc = readFileSync("docs/design/audit.md", "utf8");
1515
1616 /** Routes that answer a file, a fragment, a redirect hop or a callback. */
1717 const NOT_PAGES =
18 /^\/(assets\/|\.well-known\/|icons\/|og\/|live\/|__forge\/|go\/|new\/issue$|events$|system\/stream$|talk\/stream$|settings\/teams\/stream$|sw\.js$|robots\.txt$|favicon\.ico$|apple-touch-icon(-precomposed)?\.png$|sitemap\.xml$|manifest\.webmanifest$|opensearch\.xml$|llms\.txt$|openapi\.json$|releases\.json$|changelog\.atom$|audit\.csv$|settings\/traffic\/scrapes\/export$|fleet\/graph\/live$|fleet\/graph\.csv$|settings\/origins\/callback$|home\/archived\/|settings\/backups\/live$|api\/v1(\/|$))/;
18 /^\/(assets\/|\.well-known\/|icons\/|og\/|live\/|__forge\/|go\/|new\/issue$|events$|system\/stream$|talk\/stream$|settings\/teams\/stream$|sw\.js$|robots\.txt$|favicon\.ico$|apple-touch-icon(-precomposed)?\.png$|sitemap\.xml$|manifest\.webmanifest$|opensearch\.xml$|llms\.txt$|openapi\.json$|releases\.json$|changelog\.atom$|docs(\/[^/]*)?$|audit\.csv$|settings\/traffic\/scrapes\/export$|fleet\/graph\/live$|fleet\/graph\.csv$|settings\/origins\/callback$|home\/archived\/|settings\/backups\/live$|api\/v1(\/|$))/;
1919
2020 const getRoutes = [
2121 ...server.matchAll(/router\.add\(\s*"GET",\s*"([^"]+)"/g),
test/forge-looks.test.ts +1
@@ -34,6 +34,7 @@ const NOT_A_PAGE: Record<string, string> = {
3434 "/openapi.json": "a redirect to the contract document",
3535 "/favicon.ico": "the tab icon, an image",
3636 "/releases.json": "JSON feed of /releases",
37 "/docs": "a redirect to the forge's documentation",
3738 "/changelog.atom": "Atom feed of /changelog",
3839 "/sitemap.xml": "XML for crawlers",
3940 "/manifest.webmanifest": "the install manifest, JSON",
test/no-polling.test.ts +1
@@ -310,6 +310,7 @@ const NOT_WALKED: Record<string, string> = {
310310 "/boards/:slug/live": "needs a board; a stream, not a page",
311311 "/bring/:id/:job": "needs a bring job",
312312 "/claim/start/:token": "needs the one-time token an anonymous start returned",
313 "/docs/:file": "a redirect to the documentation, not a page; the file name is one the seed cannot guess",
313314 "/fleet/ops/:id": "needs a fleet operation",
314315 "/go/:code": "needs a short code minted by a share",
315316 "/home/archived/:op": "needs an archived-home operation",
test/pages-budget.test.ts +1 −1
@@ -41,7 +41,7 @@ const HEAVIER: Record<string, { statements?: number; git?: number }> = {
4141 };
4242
4343 /** Patterns with no fixture today: lower this as fixtures are added, never raise it silently. */
44 const MAX_UNFIXTURED = 144;
44 const MAX_UNFIXTURED = 145;
4545
4646 /** Streams and live fragments: no page. */
4747 const NOT_PAGES = new Set([
test/security-floor-routes.test.ts +1
@@ -62,6 +62,7 @@ const UNSEEDED: Record<string, string> = {
6262 "/:owner/-/teams/:team": ORG,
6363 "/claim/start/:token": "needs a one-time start claim token, which the seed does not mint (test/start.test.ts covers it)",
6464 "/talk/:id": TALK,
65 "/docs/:file": "a file name of the documentation folder; the seed supplies no :file",
6566 "/bring/:id/:job": "needs a bring job of the signed-in person; the seed brings nothing",
6667 "/fleet/ops/:id": FLEET,
6768 "/:owner/:name/bets/:id": BET,
test/server-timing-sweep.test.ts +1
@@ -47,6 +47,7 @@ const REDIRECTS = new Set([
4747 "/alice/forge/tells",
4848 "/alice/forge/tells/new",
4949 "/big",
50 "/docs",
5051 "/login",
5152 "/openapi.json",
5253 "/settings/origins/callback",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs