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

The /__forge/ door links "Report a problem" on a public app, no account needed #7923

Merged opened this

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

Merged

The door at `/__forge/` on a public app now lists "Report a problem, no account needed", linking to `/__forge/report` on the app's own host. I ran `tsc --noEmit`, `bun scripts/gate.ts` and `test/apps-door.test.ts` (15 pass). The gate printed nothing, so I took that as clean. I did not run the full suite, since the forge runs it on push.

shipped production is serving it deploy 2fa0c24

opened this

The door at /__forge/ on a public app now lists "Report a problem, no account needed", linking to /__forge/report on the app's own host. I ran tsc --noEmit, bun scripts/gate.ts and test/apps-door.test.ts (15 pass). The gate printed nothing, so I took that as clean. I did not run the full suite, since the forge runs it on push.

  • Change: DoorFacts gets one optional field, report, and doorPage adds one link line for it, escaped with escapeAttr. The door handler in src/apps/proxy.ts sets report only when reportUrl(runtime, target) is defined. The door's CSP and no-script shape are untouched.
  • Where it shows: a public app whose repository anyone may read. A private app, a nested target, and a repository the public may not read get no link, because reportUrl already returns nothing for them. I tested the public and private cases, not the nested one.
  • Test: the new test in test/apps-door.test.ts checks that a public app's door has the link with that href, and that a private app's door doesn't. It would fail without the change.
  • Merge with #7853: this adds only one optional field and one link line, so the two should merge cleanly in either order.
  • Left out: the link text isn't configurable, and the preview doors get the link under the same rule as production.

Closes #7855

Changes requested — before the latest push

The idea is right and small: a public app door links its own /__forge/report, and the route already exists (proxy.ts:960). Two things to fix in one round. (1) proxy.ts: reportUrl() is called here and again inside the report route; compute it once into a const next to ssh/tell and spread that, and wrap the long line the way the neighbours are wrapped. (2) The preview cannot show it working: it is a preview of the private forge repo, so its door correctly has no report link (/__forge/ has only the sign-in link). Show a public app door in the pull description, or add a test that drives proxyApp end to end for a public app: the door shows the link and GET /__forge/report answers 303 to the forge form. The unit test only checks the HTML string. No tty/README change needed (the door is web-only), but say so in the pull.

commented

The /__forge/ door of a public app now links "Report a problem, no account needed" to /__forge/report. That path answers 303 to the repository's report form, with the page the visitor came from. A private app's door has no such link.

Both of juniper's points are addressed in the new commit:

  • src/apps/proxy.ts: reportUrl() is now called once, as a const next to ssh and tell, and the door spreads report: "/__forge/report" from it. The line is wrapped like its neighbours. The report route keeps its own call, since it is a separate branch and needs the URL object.
  • test/apps-door.test.ts: the existing test already drives proxyApp end to end for the public app notes. It now also requests /__forge/report on that host and expects a 303 to /alice/notes/report on the forge, so the door cannot link a dead path. The same test still checks that a private app's door has no link.

bun x tsc --noEmit is clean, and test/apps-door.test.ts and test/apps-report.test.ts pass (18 tests). I did not run scripts/design-lint.ts.

The preview of this pull is the private forge repo, so its door correctly shows only the sign-in link. The test above is where the public-app link is shown working.

Not changed: the terminal and README, because the door is web-only.

Approved

Both earlier asks are met: reportUrl() is called once as a const beside ssh/tell, and the test now requests /__forge/report on the public host and expects a 303 to /alice/notes/report, so the door cannot link a dead path. The private app door is asserted to have no link. The link is a plain anchor with real text and works without JavaScript. The preview is a private repo, so only the test shows the public link; I could not check it live. Next, non-blocking: (1) run scripts/design-lint.ts, since the scout did not; (2) say in the README that a public app's door offers a no-account report path.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs