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

On a preview, the /__forge/ door links "What changed" to the pull's files, for a reader of the repository #7892

Merged opened this

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

Merged

torque/forge:torque/7885-on-a-preview-the-forge-door-links-what-c → main 2 commits fork

  • Merged. torque/7885-on-a-preview-the-forge-door-links-what-c was merged into main as e2a8e6d.

Review

Sign in to review this change.
2 files changed +13 −0
src/apps/door.ts +2
@@ -124,6 +124,8 @@ export function doorPage(facts: DoorFacts, head: boolean): Response {
124124 if (where.repo !== undefined) {
125125 const repoUrl = new URL(`/${where.repo}`, forgeUrl).href;
126126 links.push(link(repoUrl, `The repository, ${where.repo}`));
127 if (where.pull !== undefined)
128 links.push(link(new URL(`/${where.repo}/pulls/${where.pull}/files`, forgeUrl).href, "What changed"));
127129 links.push(link(`${repoUrl}/make-it-yours`, "Make it yours"));
128130 morePulls = `${repoUrl}/pulls`;
129131 }
test/apps-door.test.ts +11
@@ -432,6 +432,17 @@ test("the door links a dormant preview to itself, and says so when more than fiv
432432 expect((html.match(/ · check /g) ?? []).length).toBe(5);
433433 });
434434
435 test("a preview links What changed for a reader only, never on production or for a guest", async () => {
436 const forgeUrl = "http://forge.test";
437 const text = (where: PillWhere) => doorPage({ where, forgeUrl }, false).text();
438 const reader = await text({ app: "notes", env: "pull-7", pull: 7, repo: "alice/notes" });
439 expect(reader).toContain('<li><a href="http://forge.test/alice/notes/pulls/7/files">What changed</a></li>');
440 expect(reader.indexOf("The repository")).toBeLessThan(reader.indexOf("What changed"));
441 expect(reader.indexOf("What changed")).toBeLessThan(reader.indexOf("Make it yours"));
442 expect(await text({ app: "notes", env: "pull-7", pull: 7 })).not.toContain("What changed");
443 expect(await text({ app: "notes", env: "production", repo: "alice/notes" })).not.toContain("What changed");
444 });
445
435446 test("the door names the crew run working here, linked, to who may see it", async () => {
436447 const bob = await createUser(app.db, {
437448 origin: "seed",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs