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

Issues and pull requests are called issues and pull requests everywhere: retire "Told", "Changes", /tells and /changes #3255

Parked opened this in answer to
Closed without merging

scout/forge:scout/3241-issues-and-pull-requests-are-called-issu → main 1 commit fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
40 files changed +295 −187
src/actions/tell.ts +2 −2
@@ -158,10 +158,10 @@ export const TOO_LONG_WORDS = "That is too long to tell in one go.";
158158 /** What happened, in the sentence both doors say. */
159159 export function toldWords(told: Told): string {
160160 if (told.routed === undefined)
161 return `Told as #${told.issue.number}. Nobody is on the crew to take it yet — add someone under Settings → Crew.`;
161 return `Opened as issue #${told.issue.number}. Nobody is on the crew to take it yet — add someone under Settings → Crew.`;
162162 const r = told.routed;
163163 const who = r.builder.user.username;
164164 return told.assigned
165165 ? `${who} is on it — ${r.size} ${r.kind}${r.by === "rule" ? "" : `, ${r.by} decided in ${r.ms} ms`}.`
166 : `Told as #${told.issue.number}, but ${who} could not take it.`;
166 : `Opened as issue #${told.issue.number}, but ${who} could not take it.`;
167167 }
src/feed/items.ts +8 −8
@@ -340,7 +340,7 @@ function fromEvent(
340340 ...(pull?.authorIsAgent ? [`by ${pull.authorName}`] : []),
341341 ].join(", ");
342342 const toldWords = toldParts === "" ? "" : ` (${toldParts})`;
343 const change = number === undefined ? base(repo) : `${base(repo)}/changes/${number}`;
343 const change = number === undefined ? base(repo) : `${base(repo)}/pulls/${number}`;
344344 switch (e.kind) {
345345 case "run.finished": {
346346 const state = p["state"] === "failed" ? "failed" : "ok";
@@ -364,11 +364,11 @@ function fromEvent(
364364 };
365365 }
366366 case "pull.opened":
367 return { ...common, kind: "pull", link: change, what: `a change was opened${title ? `: ${clip(title)}` : ""}${toldWords}` };
367 return { ...common, kind: "pull", link: change, what: `opened a pull request${title ? `: ${clip(title)}` : ""}${toldWords}` };
368368 case "pull.merged":
369 return { ...common, kind: "pull", link: change, what: `a change shipped${title ? `: ${clip(title)}` : ""}${toldWords}` };
369 return { ...common, kind: "pull", link: change, what: `a pull request shipped${title ? `: ${clip(title)}` : ""}${toldWords}` };
370370 case "pull.reviewed":
371 return { ...common, kind: "pull", link: change, what: `a change was reviewed${title ? `: ${clip(title)}` : ""}` };
371 return { ...common, kind: "pull", link: change, what: `a pull request was reviewed${title ? `: ${clip(title)}` : ""}` };
372372 case "look.taken":
373373 return { ...common, kind: "look", link: base(repo), what: "a new picture of it is ready" };
374374 case "app.serving":
@@ -380,15 +380,15 @@ function fromEvent(
380380 return {
381381 ...common,
382382 kind: "tell",
383 link: `${base(repo)}/tells/${number}`,
384 what: told === "" ? `told #${number}` : clip(told),
383 link: `${base(repo)}/issues/${number}`,
384 what: told === "" ? `opened issue #${number}` : clip(told),
385385 };
386386 }
387387 case "issue.commented":
388388 case "pull.commented": {
389389 if (number === undefined) return undefined;
390390 const said = typeof p["body"] === "string" ? p["body"].trim() : "";
391 // A reply names what it answers: the tell's or the change's title.
391 // A reply names what it answers: the issue's or the pull request's title.
392392 const on = clip(
393393 (e.kind === "issue.commented" ? subjects.issue(repo.id, number)?.title : title) ??
394394 `#${number}`,
@@ -399,7 +399,7 @@ function fromEvent(
399399 kind: "reply",
400400 link:
401401 e.kind === "issue.commented"
402 ? `${base(repo)}/tells/${number}`
402 ? `${base(repo)}/issues/${number}`
403403 : change,
404404 what: said === "" ? `replied on “${on}”` : `on “${on}”: ${clip(said)}`,
405405 };
src/feed/share.ts +1 −1
@@ -193,7 +193,7 @@ async function steer(
193193 item: Candidate,
194194 ): Promise<Outcome> {
195195 const text = `Shared by ${sender.username} with ${agent.username}: ${words(item)} (${item.link})`;
196 const number = /\/changes\/(\d+)$/.exec(item.link)?.[1];
196 const number = /\/pulls\/(\d+)$/.exec(item.link)?.[1];
197197 const issue =
198198 number === undefined ? undefined : getIssue(app.db, repo.id, Number(number));
199199 if (issue !== undefined) {
src/http/server.ts +11 −7
@@ -222,7 +222,6 @@ import {
222222 issueThreadFragment,
223223 newIssuePage,
224224 newIssueSubmit,
225 newTellPage,
226225 } from "../web/pages/issues.ts";
227226 import { tellPage } from "../web/studio/tell.ts";
228227 import { tellHerePage } from "../web/studio/tell_here.ts";
@@ -331,7 +330,6 @@ import {
331330 } from "../web/pages/crew.ts";
332331 import { newPullPage, newPullSubmit } from "../web/pages/pulls.ts";
333332 import {
334 changePage,
335333 pullPage,
336334 pullStateFragment,
337335 } from "../web/studio/change.ts";
@@ -621,6 +619,13 @@ const gitChallenge = () =>
621619
622620 // ---- the public server ----
623621
622 /** The studio's retired nouns (`/tells`, `/changes`) answer 301 to the
623 * issue and pull addresses, so every old link keeps working. */
624 function movedTo(ctx: Ctx, from: string, to: string): Response {
625 const path = ctx.url.pathname.replace(new RegExp(`^(/[^/]+/[^/]+)/${from}(?=/|$)`), `$1/${to}`);
626 return new Response(null, { status: 301, headers: { location: `${path}${ctx.url.search}` } });
627 }
628
624629 export function buildRouter(): Router<Handler> {
625630 const router = new Router<Handler>();
626631
@@ -1063,9 +1068,8 @@ export function buildRouter(): Router<Handler> {
10631068 // One issue page, at `/issues/:number` and `/tells/:number` alike, for
10641069 // every repository and every viewer. The literal /tells is registered
10651070 // before /tells/:number for the same reason /issues/new is.
1066 router.add("GET", "/:owner/:name/tells", tellsList);
1067 router.add("GET", "/:owner/:name/tells/new", newTellPage);
1068 router.add("GET", "/:owner/:name/tells/:number", tellPage);
1071 for (const path of ["tells", "tells/new", "tells/:number"])
1072 router.add("GET", `/:owner/:name/${path}`, (ctx) => movedTo(ctx, "tells", "issues"));
10691073 router.add("GET", "/:owner/:name/report", reportPage);
10701074 router.add("POST", "/:owner/:name/report", reportSubmit);
10711075 router.add("GET", "/:owner/:name/reports", reportsPage);
@@ -1136,8 +1140,8 @@ export function buildRouter(): Router<Handler> {
11361140 // the studio's own noun. See the tells above for the rule; the forms that
11371141 // ship, close and comment keep posting under /pulls/:number.
11381142 router.add("GET", "/:owner/:name/pulls", changesList);
1139 router.add("GET", "/:owner/:name/changes", changesList);
1140 router.add("GET", "/:owner/:name/changes/:number", changePage);
1143 for (const path of ["changes", "changes/:number"])
1144 router.add("GET", `/:owner/:name/${path}`, (ctx) => movedTo(ctx, "changes", "pulls"));
11411145 router.add("GET", "/:owner/:name/pulls/new", newPullPage);
11421146 router.add("POST", "/:owner/:name/pulls/new", newPullSubmit);
11431147 router.add("GET", "/:owner/:name/pulls/:number", pullPage);
src/web/chrome.ts +8 −9
@@ -203,10 +203,9 @@ export function scopeHeader(
203203 },
204204 ]),
205205 {
206 // Studio names its own lists — told, not issues; a repository that is
207 // not an app keeps git's words.
208 label: studio ? "Told" : "Issues",
209 href: studio ? tellsHref(base) : `${base}/issues`,
206 // One vocabulary in every mode: issues and pulls.
207 label: "Issues",
208 href: tellsHref(base),
210209 icon: studio ? "clock" : "issue",
211210 ...(facts.openIssues === null ? {} : { count: facts.openIssues }),
212211 current: active === "issues",
@@ -215,9 +214,9 @@ export function scopeHeader(
215214 {
216215 // "Look" is the five-word state a green pull is in, and the name of
217216 // the picture card on one — not the noun for this list, which is the
218 // same one `/changes` and "Every change" already use.
219 label: studio ? "Changes" : "Pulls",
220 href: studio ? changesHref(base) : `${base}/pulls`,
217 // same one `/pulls` already uses.
218 label: "Pulls",
219 href: changesHref(base),
221220 icon: "pull",
222221 ...(facts.openPulls === null ? {} : { count: facts.openPulls }),
223222 current: active === "pulls",
@@ -383,8 +382,8 @@ export function repoPalette(ctx: Ctx, repo: Repo): PaletteItem[] {
383382 return [
384383 { t: `${name} — Studio`, h: base, c: "This repo" },
385384 { t: `${name} — Files`, h: `${base}/files`, c: "This repo" },
386 { t: `${name} — Told`, h: tellsHref(base), c: "This repo" },
387 { t: `${name} — Changes`, h: changesHref(base), c: "This repo" },
385 { t: `${name} — Issues`, h: tellsHref(base), c: "This repo" },
386 { t: `${name} — Pull requests`, h: changesHref(base), c: "This repo" },
388387 // Telling the crew is for who may direct it (`mayDirectCrew`: a
389388 // writer, or anyone signed in where the owner let outsiders in), so
390389 // nobody else is offered a door that leads nowhere.
src/web/pages/admin-limits.ts +1 −1
@@ -222,7 +222,7 @@ export function limitsPage(ctx: Ctx): Response {
222222 </ul>`,
223223 {
224224 head: html`${icon("history")}
225 <h2>Changes</h2>`,
225 <h2>History</h2>`,
226226 pad: false,
227227 },
228228 )}`;
src/web/pages/capacity.ts +1 −1
@@ -165,7 +165,7 @@ export function capacityPage(ctx: Ctx): Response {
165165 </ul>`,
166166 {
167167 head: html`${icon("history")}
168 <h2>Changes</h2>`,
168 <h2>History</h2>`,
169169 pad: false,
170170 },
171171 )}`;
src/web/pages/search.ts +3 −3
@@ -248,9 +248,9 @@ const WORDS: readonly Words[] = [
248248 ],
249249 [
250250 "issues",
251 "Tells & changes",
252 "Tells and changes",
253 "No tell or change matches",
251 "Issues & pulls",
252 "Issues and pull requests",
253 "No issue or pull request matches",
254254 ],
255255 ["code", "Code", "Code", "No line of code matches"],
256256 ];
src/web/studio/actions.ts +3 −3
@@ -135,11 +135,11 @@ async function tellFromPage(ctx: Ctx, repo: Repo, form: Form): Promise<Response>
135135 const issue = `${repoBase(repo)}/issues/${told.value.issue.number}`;
136136 return page({
137137 ctx,
138 title: `Told · ${repo.name}`,
138 title: `Issue opened · ${repo.name}`,
139139 crumbs: crumbsFor(repo),
140 body: html`${pageHead("Told")}
140 body: html`${pageHead("Issue opened")}
141141 <p>${toldWords(told.value)}</p>
142 <p><a href="${issue}" data-receipt>See your tell, #${String(told.value.issue.number)}</a></p>`,
142 <p><a href="${issue}" data-receipt>See your issue, #${String(told.value.issue.number)}</a></p>`,
143143 });
144144 }
145145
src/web/studio/app.ts +4 −4
@@ -370,11 +370,11 @@ export async function studioApp(
370370 : !ownerFacts
371371 ? html`<dl>
372372 <dt>Shipped</dt>
373 <dd>${shipped} change${shipped === 1 ? "" : "s"}</dd>
373 <dd>${shipped} pull request${shipped === 1 ? "" : "s"}</dd>
374374 </dl>`
375375 : html`<dl>
376376 <dt>Shipped</dt>
377 <dd>${shipped} change${shipped === 1 ? "" : "s"}</dd>
377 <dd>${shipped} pull request${shipped === 1 ? "" : "s"}</dd>
378378 <dt>Runs</dt>
379379 <dd>${weekTotals.runs}</dd>
380380 <dt>Preview</dt>
@@ -444,8 +444,8 @@ export async function studioApp(
444444 // domains — is the admin's, on the app's settings page.
445445 const more = html`<p class="muted small">
446446 <a href="${base}/map">The map</a> ·
447 <a href="${tellsHref(base)}">Everything told</a> ·
448 <a href="${changesHref(base)}">Every change</a>${when(
447 <a href="${tellsHref(base)}">Issues</a> ·
448 <a href="${changesHref(base)}">Pull requests</a>${when(
449449 canAdmin(db, repo, ctx.auth.user),
450450 () => html` · <a href="${base}/settings/app">Environment settings</a>`,
451451 )}
src/web/studio/asks.ts +11 −11
@@ -161,14 +161,14 @@ export interface AskWords {
161161 /** The words for each kind of ask: every ask names its decision, its options and its default. */
162162 export const ASK_WORDS: Readonly<Record<DecisionKind, AskWords>> = {
163163 look: {
164 decision: "Ship this change?",
164 decision: "Ship this pull request?",
165165 options: ["Ship", "Say what is off"],
166166 ifNothing: "it waits; nothing ships",
167167 },
168168 review: {
169 decision: "Review this change: ship it, or say what is off?",
169 decision: "Review this pull request: ship it, or say what is off?",
170170 options: ["Ship", "Say what is off"],
171 ifNothing: "it waits; an agent's change never ships unreviewed",
171 ifNothing: "it waits; an agent's pull request never ships unreviewed",
172172 },
173173 stopped: {
174174 decision: "The check fails and the crew stopped: what should it try?",
@@ -229,7 +229,7 @@ export const KIND_TIER: Readonly<Record<DecisionKind, Consequence>> = {
229229 paused: { score: 80, why: "money: the crew is stopped at its ceiling" },
230230 declined: { score: 70, why: "the planner has stopped for this app" },
231231 stopped: { score: 50, why: "red, and the crew stopped" },
232 review: { score: 45, why: "an agent's change waits for a review" },
232 review: { score: 45, why: "an agent's pull request waits for a review" },
233233 handover: { score: 55, why: "three reviews without an approval: handed to a person" },
234234 parked: { score: 40, why: "parked by the crew" },
235235 look: { score: 30, why: "green, waiting" },
@@ -994,7 +994,7 @@ function lineOf(c: AskCandidate): string {
994994 : `"${title}" is green, waiting for your look`;
995995 }
996996
997 /** Why an agent's change waits for a person's review, in a clause. */
997 /** Why an agent's pull request waits for a person's review, in a clause. */
998998 const reviewWhy = (wait: ReviewWait | undefined): string =>
999999 wait?.why === "rounds"
10001000 ? `the reviewer asked for changes three times, since ${wait.since.slice(0, 10)}`
@@ -1006,11 +1006,11 @@ const reviewWhy = (wait: ReviewWait | undefined): string =>
10061006
10071007 /** A collapsed row in a line: how many, and of what. */
10081008 export const ROW_PLURAL: Readonly<Record<DecisionKind, (n: number) => string>> = {
1009 look: (n) => `${n} green changes wait for your look`,
1010 review: (n) => `${n} agent changes wait for your review`,
1011 stopped: (n) => `the crew stopped on ${n} changes`,
1009 look: (n) => `${n} green pull requests wait for your look`,
1010 review: (n) => `${n} agent pull requests wait for your review`,
1011 stopped: (n) => `the crew stopped on ${n} pull requests`,
10121012 parked: (n) => `the crew parked ${n} issues after three failed runs`,
1013 handover: (n) => `${n} changes had three reviews asking for changes and wait for you`,
1013 handover: (n) => `${n} pull requests had three reviews asking for changes and wait for you`,
10141014 declined: (n) => `the planner declined ${n} times and waits for you`,
10151015 proposal: (n) => `${n} waves wait for your nod`,
10161016 paused: (n) => `${n} pauses at the ceiling`,
@@ -1102,7 +1102,7 @@ export function askLinesFor(
11021102 ...about,
11031103 line,
11041104 number: only.pull!.number,
1105 link: `${base}/changes/${only.pull!.number}`,
1105 link: `${base}/pulls/${only.pull!.number}`,
11061106 };
11071107 });
11081108 }
@@ -1230,7 +1230,7 @@ export function decisionsFor(
12301230 repo: c.repo,
12311231 pull: c.pull,
12321232 who: c.who,
1233 says: `${c.who}'s "${c.pull.title}" is green and waits for a review: ${reviewWhy(c.reviewWait)}. An agent's change never ships unreviewed; ship it, or say what is off.`,
1233 says: `${c.who}'s "${c.pull.title}" is green and waits for a review: ${reviewWhy(c.reviewWait)}. An agent's pull request never ships unreviewed; ship it, or say what is off.`,
12341234 short: `green; waits for a review — ${reviewWhy(c.reviewWait)}`,
12351235 };
12361236 if (c.kind === "look" && c.pull) {
src/web/studio/branch_tell.ts +2 −2
@@ -65,8 +65,8 @@ export function tellsAnswered(
6565 * and — when that tell is closed — what a person can act on. Never a verdict:
6666 * the change's word is judged elsewhere and is not touched by this. */
6767 export function tellLine(base: string, t: AnsweredTell): Html {
68 const link = html`<a href="${tellHref(base, t.number)}">tell #${t.number}</a>`;
68 const link = html`<a href="${tellHref(base, t.number)}">issue #${t.number}</a>`;
6969 return t.closed
70 ? html`for ${link} — its tell is already done`
70 ? html`for ${link} — its issue is already done`
7171 : html`for ${link}`;
7272 }
src/web/studio/feed.ts +4 −4
@@ -30,16 +30,16 @@ export const FEED_FIRST_PAGE = 20;
3030
3131 const RUN_LINK = /^\/[^/]+\/[^/]+\/runs\/[A-Za-z0-9_-]+$/;
3232
33 const KIND_LABEL: Record<FeedItem["kind"], string> = {
33 export const KIND_LABEL: Record<FeedItem["kind"], string> = {
3434 run: "Run",
3535 ask: "Needs you",
36 pull: "Change",
36 pull: "Pull request",
3737 decision: "Decision",
3838 map: "Map",
3939 cost: "Cost",
4040 milestone: "Watching",
4141 choose: "Choose",
42 tell: "Told",
42 tell: "Issue",
4343 reply: "Reply",
4444 look: "Look",
4545 release: "Release",
@@ -196,7 +196,7 @@ export function feedNote(): Html {
196196 }
197197
198198 const CHIP_LABEL: Record<KindChip, string> = {
199 reviews: "Changes",
199 reviews: "Reviews",
200200 decisions: "Decisions",
201201 crew: "Crew words",
202202 releases: "Releases",
src/web/studio/lists.ts +4 −4
@@ -134,7 +134,7 @@ function wordFilterBar(
134134 ${seg([
135135 { label: "Open", href: href(undefined), current: open },
136136 ...words.map((w) => ({
137 label: w[0]!.toUpperCase() + w.slice(1),
137 label: w === "told" ? "Not started" : w[0]!.toUpperCase() + w.slice(1),
138138 href: href(w),
139139 current: current === w,
140140 })),
@@ -366,7 +366,7 @@ export async function tellsList(ctx: Ctx): Promise<Response> {
366366 title: "Nothing here",
367367 note: emptyNote(
368368 f.word,
369 record === undefined ? "No issue" : "Nothing told",
369 "No issue",
370370 record === undefined
371371 ? "Nothing open."
372372 : "Nothing open. Tell the crew what you want and it shows up here.",
@@ -499,10 +499,10 @@ export async function changesList(ctx: Ctx): Promise<Response> {
499499 title: "Nothing here",
500500 note: emptyNote(
501501 f.word,
502 "No change",
502 "No pull request",
503503 record === undefined
504504 ? "Nothing open."
505 : "Nothing open. A change is the crew's proposed edit to your app; the crew opens them as it works.",
505 : "Nothing open. A pull request is the crew's proposed edit to your app; the crew opens them as it works.",
506506 ),
507507 })
508508 : listCard(
src/web/studio/nouns.ts +7 −7
@@ -20,20 +20,20 @@ import type { Repo } from "../../core/repos.ts";
2020 import type { Ctx } from "../../http/context.ts";
2121
2222 /** Everything told — the studio's own door onto `/issues`. */
23 export const tellsHref = (base: string): string => `${base}/tells`;
23 export const tellsHref = (base: string): string => `${base}/issues`;
2424
2525 /** Every change — the studio's own door onto `/pulls`. */
26 export const changesHref = (base: string): string => `${base}/changes`;
26 export const changesHref = (base: string): string => `${base}/pulls`;
2727
2828 /** One tell: the same page `/issues/:number` reaches, under the studio's
2929 * own noun (`tellPage`, `src/web/pages/issues.ts`). */
3030 export const tellHref = (base: string, number: number): string =>
31 `${base}/tells/${number}`;
31 `${base}/issues/${number}`;
3232
3333 /** One change: the same page `/pulls/:number` reaches, under the studio's
3434 * own noun (`changePage`, `src/web/studio/change.ts`). */
3535 export const changeHref = (base: string, number: number): string =>
36 `${base}/changes/${number}`;
36 `${base}/pulls/${number}`;
3737
3838 /**
3939 * The one rule for whether a page speaks the studio's words on this repo:
@@ -55,9 +55,9 @@ export function studioRecord(ctx: Ctx, repo: Repo): AppRecord | undefined {
5555 * none of those is here.
5656 */
5757 export const PAGE_TITLES = {
58 tells: { studio: "Everything told", dev: "Issues" },
59 changes: { studio: "Every change", dev: "Pull requests" },
60 runs: { studio: "Every run", dev: "Runs" },
58 tells: { studio: "Issues", dev: "Issues" },
59 changes: { studio: "Pull requests", dev: "Pull requests" },
60 runs: { studio: "Runs", dev: "Runs" },
6161 compose: { studio: "Tell the crew", dev: "New issue" },
6262 settings: { studio: "Settings", dev: "Settings" },
6363 } as const;
src/web/studio/tell.ts +1 −1
@@ -419,7 +419,7 @@ async function studioTell(
419419 action: `${thread}/comments`,
420420 ...(mayClose ? { stateAction: `${thread}/state` } : {}),
421421 state: issue.state,
422 closeLabel: plain ? "Close issue" : "Close tell",
422 closeLabel: "Close issue",
423423 crewNote: threadNote(ctx.app.db, repo, issue),
424424 reasons: true,
425425 })}
test/asks-expiry.test.ts +1 −1
@@ -190,7 +190,7 @@ describe("asks that expire, hold and collapse", () => {
190190 const lines = askLinesFor(app.db, aliceUser);
191191 expect(lines.map((l) => l.id)).toEqual([`look:${apples.id}`]);
192192 expect(lines[0]!.link).toBe(
193 `/${repo.ownerName}/${repo.name}/changes/${apples.number}`,
193 `/${repo.ownerName}/${repo.name}/pulls/${apples.number}`,
194194 );
195195 });
196196
test/audit.test.ts +1 −1
@@ -17,7 +17,7 @@ import {
1717 contractChanges,
1818 crossingsWaiting,
1919 verdictChanges,
20 } from "../src/contract/changes.ts";
20 } from "../src/contract/pulls.ts";
2121 import { recordProbe } from "../src/contract/probes.ts";
2222 import { recordDecision } from "../src/core/decisions.ts";
2323 import { getAppByRepo } from "../src/core/apps.ts";
test/carried-deploy.test.ts +1 −1
@@ -123,6 +123,6 @@ describe("a production deploy carries what it records", () => {
123123 })
124124 ).text();
125125 expect(page).toContain('id="run-carries"');
126 expect(page).toContain(`/changes/${two.number}`);
126 expect(page).toContain(`/pulls/${two.number}`);
127127 }, 180_000);
128128 });
test/feed-page.test.ts +1 −1
@@ -95,7 +95,7 @@ describe("the feed on the home page", () => {
9595 expect(text).toContain('href="/alice/open/runs/r1"');
9696 expect(text).toContain('action="/alice/open/runs/r1/steer"');
9797 const item = readFeed(app.db, alice).items[0]!;
98 const tell = feedCard({ ...item, kind: "pull", link: "/alice/open/changes/1" }).text;
98 const tell = feedCard({ ...item, kind: "pull", link: "/alice/open/pulls/1" }).text;
9999 expect(tell).toContain('action="/alice/open/tell"');
100100 expect(tell).toContain('data-feed="dismissed"');
101101 expect(tell).toContain('data-feed="muted"');
test/first-login.test.ts +1 −1
@@ -212,7 +212,7 @@ describe("the first login to a spawned forge", () => {
212212 expect(home).toContain("Your crew has its direction:");
213213 expect(home).not.toContain("already at work");
214214 expect(home).toContain("atlas");
215 expect(home).toMatch(/href="\/marias\/bakery\/tells\/\d+"[^>]*>[^<]*Run Maria/);
215 expect(home).toMatch(/href="\/marias\/bakery\/issues\/\d+"[^>]*>[^<]*Run Maria/);
216216 // Each app with its way in.
217217 expect(home).toContain('href="/marias/bakery"');
218218 });
test/here-manifest.test.ts +1 −1
@@ -319,7 +319,7 @@ describe("the manifest: what you can do here, as who you are", () => {
319319 headBranch: "mine",
320320 });
321321 if (!own.ok) throw new Error(String(own.error));
322 const ownBody = (await manifest(`/acme/game/changes/${own.value.number}`)).body;
322 const ownBody = (await manifest(`/acme/game/pulls/${own.value.number}`)).body;
323323 expect(ownBody.here.pull).toEqual({ number: own.value.number, runs: true });
324324 });
325325 });
test/holds.test.ts +1 −1
@@ -678,7 +678,7 @@ describe("a hold is set, shown and lifted", () => {
678678
679679 test("the change page offers the hold, then says who holds it and why, with the way to let it go", async () => {
680680 const cookie = await signIn("alice");
681 const change = `/alice/garden/changes/${pull.number}`;
681 const change = `/alice/garden/pulls/${pull.number}`;
682682 const before = await page(change, cookie);
683683 expect(before).toContain("Hold this change");
684684 expect(before).toContain(
test/home-feed.test.ts +1 −1
@@ -134,7 +134,7 @@ describe("home is the feed", () => {
134134 // carries what was said.
135135 expect(text).toContain("Water the tomatoes at dawn");
136136 expect(text).toMatch(
137 /href="\/alice\/garden\/tells\/1"[^>]*data-feed-open>Water the tomatoes at dawn</,
137 /href="\/alice\/garden\/issues\/1"[^>]*data-feed-open>Water the tomatoes at dawn</,
138138 );
139139 // A reply names the tell it answers.
140140 expect(text).toContain("on “Water the tomatoes at dawn”: Mulch them first");
test/home-walk.test.ts +2 −2
@@ -75,7 +75,7 @@ test("composer, timeline, a tell, a crew member's run and pull, a share, the app
7575 });
7676 expect(posted.status).toBe(303);
7777 expect(await home(alice)).toMatch(
78 /href="\/alice\/garden\/tells\/1"[^>]*data-feed-open>Plant the beans</,
78 /href="\/alice\/garden\/issues\/1"[^>]*data-feed-open>Plant the beans</,
7979 );
8080
8181 // The crew member's run and pull are posts under its name.
@@ -94,7 +94,7 @@ test("composer, timeline, a tell, a crew member's run and pull, a share, the app
9494 const page = await home(alice);
9595 expect(page).toContain("Sorted the seed list");
9696 expect(page).toMatch(/fcard-who">scribe<\/strong\s*>\s*<span[^>]*data-mark="crew"/);
97 expect(page).toContain("a change was opened");
97 expect(page).toContain("opened a pull request");
9898
9999 // A share reaches another person as a post that says who shared it.
100100 const shared = await share(app, alice, `event:${run.id}`, ["bob"]);
test/issues.test.ts +1 −1
@@ -117,7 +117,7 @@ describe("issue pages end to end", () => {
117117
118118 const list = await (await fetch(`${base}/mel/proj/issues`)).text();
119119 expect(list).toContain("First bug");
120 expect(list).toContain('href="/mel/proj/tells/1"');
120 expect(list).toContain('href="/mel/proj/issues/1"');
121121
122122 const detail = await (await fetch(`${base}/mel/proj/issues/1`)).text();
123123 expect(detail).toContain("<strong>broken</strong>");
test/name-marks.test.ts +1 −1
@@ -266,7 +266,7 @@ describe("a name always says who it is", () => {
266266 app: "alice/garden",
267267 actor,
268268 at: new Date().toISOString(),
269 link: `/alice/garden/changes/${pull.number}`,
269 link: `/alice/garden/pulls/${pull.number}`,
270270 what: "Beds",
271271 reason: "",
272272 score: 1,
test/one-vocabulary.test.ts added +112
@@ -0,0 +1,112 @@
1 /**
2 * One vocabulary (#3241): issues and pull requests are called that in every
3 * mode. /tells and /changes are retired names that answer 301 to the lists
4 * and pages they used to be, and no nav, page or feed string says "Told" or
5 * "Changes" as the noun for them.
6 */
7
8 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
9 import { mkdtemp, rm } from "node:fs/promises";
10 import { tmpdir } from "node:os";
11 import { join } from "node:path";
12 import { createApp, type App } from "../src/app.ts";
13 import { enableApp } from "../src/actions/apps.ts";
14 import { openIssue } from "../src/actions/issues.ts";
15 import { commitToBranch, createRepo } from "../src/actions/repos.ts";
16 import { createUser, type User } from "../src/core/users.ts";
17 import { serve, type Servers } from "../src/http/server.ts";
18 import { promote } from "./helpers/members.ts";
19
20 describe("issues and pull requests keep their names", () => {
21 let dataDir: string;
22 let app: App;
23 let servers: Servers;
24 let base: string;
25 let cookie: string;
26
27 const get = (path: string) =>
28 fetch(`${base}${path}`, { headers: { cookie }, redirect: "manual" });
29
30 beforeAll(async () => {
31 dataDir = await mkdtemp(join(tmpdir(), "forge-vocab-"));
32 app = createApp({ dataDir, port: 0 });
33 servers = await serve(app);
34 base = servers.url;
35 const a = await createUser(app.db, {
36 origin: "seed",
37 trusted: true,
38 username: "alice",
39 email: "[email protected]",
40 password: "a-good-passphrase",
41 adminIfFirst: true,
42 });
43 if (!a.ok) throw new Error(a.error);
44 promote(app.db, a.value as User);
45 cookie = (
46 (
47 await fetch(`${base}/signin`, {
48 method: "POST",
49 body: new URLSearchParams({ username: "alice", password: "a-good-passphrase" }),
50 redirect: "manual",
51 })
52 ).headers.get("set-cookie") ?? ""
53 ).split(";")[0]!;
54 const made = await createRepo(app, a.value, { name: "notes", visibility: "private", description: "" });
55 if (!made.ok) throw new Error(String(made.error));
56 const seeded = await commitToBranch(app, a.value, made.value, {
57 message: "Start",
58 files: [
59 { path: "package.json", content: '{"name":"notes","scripts":{"start":"bun run server.ts"}}\n' },
60 { path: "server.ts", content: "Bun.serve({ port: Number(process.env.PORT), fetch: () => new Response('ok') });\n" },
61 ],
62 });
63 if (!seeded.ok) throw new Error(JSON.stringify(seeded.error));
64 const enabled = await enableApp(app, a.value, made.value, { slug: "notes" });
65 if (!enabled.ok) throw new Error(String(enabled.error));
66 const issue = openIssue(app, a.value, made.value, { title: "Water the plants" });
67 if (!issue.ok) throw new Error(String(issue.error));
68 });
69
70 afterAll(async () => {
71 servers.stop();
72 app.close();
73 await rm(dataDir, { recursive: true, force: true });
74 });
75
76 test("/tells and /changes answer 301 to the lists and pages, keeping the query", async () => {
77 for (const [from, to] of [
78 ["/alice/notes/tells", "/alice/notes/issues"],
79 ["/alice/notes/tells?word=shipped", "/alice/notes/issues?word=shipped"],
80 ["/alice/notes/tells/1", "/alice/notes/issues/1"],
81 ["/alice/notes/tells/new", "/alice/notes/issues/new"],
82 ["/alice/notes/changes", "/alice/notes/pulls"],
83 ["/alice/notes/changes/2", "/alice/notes/pulls/2"],
84 ] as const) {
85 const res = await get(from);
86 expect(res.status, from).toBe(301);
87 expect(res.headers.get("location"), from).toBe(to);
88 }
89 });
90
91 test("the nav, the lists and the app page say Issues and Pulls, never Told or Changes", async () => {
92 for (const path of ["/alice/notes", "/alice/notes/issues", "/alice/notes/pulls", "/"]) {
93 const html = await (await get(path)).text();
94 expect(html.match(/>\s*(Told|Changes|Everything told|Every change)\s*</)?.[0], path).toBeUndefined();
95 expect(html, path).not.toMatch(/href="[^"]*\/(tells|changes)(\/|"|\?)/);
96 }
97 const app_ = await (await get("/alice/notes")).text();
98 expect(app_).toMatch(/>\s*Issues\s*</);
99 expect(app_).toMatch(/>\s*Pulls\s*</);
100 expect(app_).toContain('href="/alice/notes/issues"');
101 expect(app_).toContain('href="/alice/notes/pulls"');
102 });
103
104 test("the feed says issue and pull request", async () => {
105 const html = await (await get("/")).text();
106 expect(html).not.toMatch(/>\s*Told\s*</);
107 const { KIND_LABEL } = await import("../src/web/studio/feed.ts");
108 expect(KIND_LABEL.tell).toBe("Issue");
109 expect(KIND_LABEL.pull).toBe("Pull request");
110 for (const word of Object.values(KIND_LABEL)) expect(word).not.toMatch(/^(Told|Changes?)$/);
111 });
112 });
test/pull-checks-line-route.test.ts +1 −1
@@ -156,7 +156,7 @@ test("once the check has passed, the line has no beat, no counts, and reads as p
156156
157157 test("the change page the owner lands on draws the same live line, with the counts", async () => {
158158 app.db.run("UPDATE run SET state = 'running', finished_at = NULL WHERE id = ?", [runId]);
159 const res = await fetch(`${servers.url}/alice/open/changes/${numbers["open"]}`, {
159 const res = await fetch(`${servers.url}/alice/open/pulls/${numbers["open"]}`, {
160160 headers: { cookie: `forge_session=${createSession(app.db, alice.id).token}` },
161161 });
162162 expect(res.status).toBe(200);
test/sealed-issues.test.ts +2 −2
@@ -118,9 +118,9 @@ const SINGLES = (n: number, p: number) => [
118118 `/api/v1/repos/alice/square/runs/${runId}`,
119119 `/api/v1/repos/alice/square/runs/${runId}/log`,
120120 `/alice/square/issues/${n}`,
121 `/alice/square/tells/${n}`,
121 `/alice/square/issues/${n}`,
122 `/alice/square/pulls/${p}`,
122123 `/alice/square/pulls/${p}`,
123 `/alice/square/changes/${p}`,
124124 `/alice/square/runs/${runId}`,
125125 ];
126126
test/studio-changes.test.ts +47 −47
@@ -371,7 +371,7 @@ describe("the studio, continued", () => {
371371 expect(issues).not.toContain(`href="/alice/plainlists/issues?word=told"`);
372372 expect(issues).not.toContain(`href="/alice/plainlists/issues?word=look"`);
373373 expect(issues).toContain(
374 `href="/alice/plainlists/tells/${told.value.number}"`,
374 `href="/alice/plainlists/issues/${told.value.number}"`,
375375 );
376376 expect(issues).not.toContain("See dev's list");
377377
@@ -388,26 +388,26 @@ describe("the studio, continued", () => {
388388 expect(runs).not.toContain("See dev's list");
389389 });
390390
391 test("/tells and /changes are the studio's own doors onto the same lists /issues and /pulls reach — same words, same filter, same paging", async () => {
391 test("/issues and /pulls are the studio's own doors onto the same lists /issues and /pulls reach — same words, same filter, same paging", async () => {
392392 const told = openIssue(app, alice, repo, {
393393 title: "Door test: a tell",
394 body: "reached through /tells too",
394 body: "reached through /issues too",
395395 });
396396 if (!told.ok) throw new Error(String(told.error));
397397
398398 const viaIssues = await (await get("/alice/notes/issues")).text();
399 const viaTells = await (await get("/alice/notes/tells")).text();
399 const viaTells = await (await get("/alice/notes/issues")).text();
400400 expect(viaTells).toContain("Door test: a tell");
401401 expect(viaTells).toContain('data-word="told"');
402402 // Self-links (the word filter, paging) follow whichever door was used,
403403 // so a dev URL asked for in studio mode still answers exactly as it
404404 // does today.
405 expect(viaTells).toContain(`href="/alice/notes/tells?word=told"`);
405 expect(viaTells).toContain(`href="/alice/notes/issues?word=told"`);
406406 expect(viaIssues).toContain(`href="/alice/notes/issues?word=told"`);
407407
408 const filtered = await (await get("/alice/notes/tells?word=told")).text();
408 const filtered = await (await get("/alice/notes/issues?word=told")).text();
409409 expect(filtered).toContain("Door test: a tell");
410 const other = await (await get("/alice/notes/tells?word=shipped")).text();
410 const other = await (await get("/alice/notes/issues?word=shipped")).text();
411411 expect(other).not.toContain("Door test: a tell");
412412
413413 const branch = await commitToBranch(app, alice, repo, {
@@ -437,18 +437,18 @@ describe("the studio, continued", () => {
437437 finishRun(app.db, doorCheck.id, { state: "ok", summary: "check passed" });
438438
439439 const viaPulls = await (await get("/alice/notes/pulls")).text();
440 const viaChanges = await (await get("/alice/notes/changes")).text();
440 const viaChanges = await (await get("/alice/notes/pulls")).text();
441441 expect(viaChanges).toContain("Door test: a change");
442442 expect(viaChanges).toContain('data-word="look"');
443 expect(viaChanges).toContain(`href="/alice/notes/changes?word=look"`);
443 expect(viaChanges).toContain(`href="/alice/notes/pulls?word=look"`);
444444 expect(viaPulls).toContain(`href="/alice/notes/pulls?word=look"`);
445445
446446 const changeFiltered = await (
447 await get("/alice/notes/changes?word=look")
447 await get("/alice/notes/pulls?word=look")
448448 ).text();
449449 expect(changeFiltered).toContain("Door test: a change");
450450 const changeOther = await (
451 await get("/alice/notes/changes?word=shipped")
451 await get("/alice/notes/pulls?word=shipped")
452452 ).text();
453453 expect(changeOther).not.toContain("Door test: a change");
454454 // A green pull left open now asks the front door too (#208) — close it
@@ -456,7 +456,7 @@ describe("the studio, continued", () => {
456456 expect(setIssueState(app, alice, repo, doorPull, "closed").ok).toBe(true);
457457 });
458458
459 test("/tells and /changes answer a dev-mode viewer, ?mode=dev, and a repository that is not an app with the same list, never a bounce", async () => {
459 test("/issues and /pulls answer a dev-mode viewer, ?mode=dev, and a repository that is not an app with the same list, never a bounce", async () => {
460460 const plain = await createRepo(app, alice, {
461461 name: "doorlists",
462462 visibility: "private",
@@ -465,11 +465,11 @@ describe("the studio, continued", () => {
465465 if (!plain.ok) throw new Error(String(plain.error));
466466
467467 for (const [path, viewer] of [
468 ["/alice/notes/tells", `${cookie}; forge_mode=dev`],
469 ["/alice/notes/changes", `${cookie}; forge_mode=dev`],
470 ["/alice/notes/tells", `${cookie}; forge_mode=studio`],
471 ["/alice/doorlists/tells", cookie],
472 ["/alice/doorlists/changes", cookie],
468 ["/alice/notes/issues", `${cookie}; forge_mode=dev`],
469 ["/alice/notes/pulls", `${cookie}; forge_mode=dev`],
470 ["/alice/notes/issues", `${cookie}; forge_mode=studio`],
471 ["/alice/doorlists/issues", cookie],
472 ["/alice/doorlists/pulls", cookie],
473473 ] as const) {
474474 const res = await get(path, { cookie: viewer });
475475 expect(res.status).toBe(200);
@@ -650,29 +650,29 @@ describe("the studio, continued", () => {
650650 expect(pulls).not.toContain('href="/alice/composelists/pulls/new"');
651651 });
652652
653 test("a reader without access gets the forge's not-found on /tells and /changes, exactly as /issues and /pulls", async () => {
654 const anonTells = await fetch(`${base}/alice/notes/tells`, {
653 test("a reader without access gets the forge's not-found on /issues and /pulls, exactly as /issues and /pulls", async () => {
654 const anonTells = await fetch(`${base}/alice/notes/issues`, {
655655 headers: { cookie: "forge_mode=studio" },
656656 redirect: "manual",
657657 });
658658 expect(anonTells.status).toBe(404);
659659
660 const anonChanges = await fetch(`${base}/alice/notes/changes`, {
660 const anonChanges = await fetch(`${base}/alice/notes/pulls`, {
661661 headers: { cookie: "forge_mode=studio" },
662662 redirect: "manual",
663663 });
664664 expect(anonChanges.status).toBe(404);
665665 });
666666
667 test("/tells/:number and /changes/:number reach the same pages /issues/:number and /pulls/:number reach — one page, the same anchors, and forms that still post to dev's own address", async () => {
667 test("/issues/:number and /pulls/:number reach the same pages /issues/:number and /pulls/:number reach — one page, the same anchors, and forms that still post to dev's own address", async () => {
668668 const told = openIssue(app, alice, repo, {
669669 title: "Door test: one tell",
670 body: "reached through /tells/:number too",
670 body: "reached through /issues/:number too",
671671 });
672672 if (!told.ok) throw new Error(String(told.error));
673673 const n = told.value.number;
674674
675 const viaTell = await get(`/alice/notes/tells/${n}`);
675 const viaTell = await get(`/alice/notes/issues/${n}`);
676676 expect(viaTell.status).toBe(200);
677677 const tellHtml = await viaTell.text();
678678 const viaIssue = await (await get(`/alice/notes/issues/${n}`)).text();
@@ -706,7 +706,7 @@ describe("the studio, continued", () => {
706706 if (!opened.ok) throw new Error(String(opened.error));
707707 const p = opened.value.number;
708708
709 const viaChange = await get(`/alice/notes/changes/${p}`);
709 const viaChange = await get(`/alice/notes/pulls/${p}`);
710710 expect(viaChange.status).toBe(200);
711711 const changeHtml = await viaChange.text();
712712 expect(changeHtml).toContain("Door test: one change");
@@ -725,30 +725,30 @@ describe("the studio, continued", () => {
725725
726726 // The three lists, the app page and the search box all hand out the
727727 // studio's noun, so a person is never given two addresses for one thing.
728 const tells = await (await get("/alice/notes/tells")).text();
729 expect(tells).toContain(`href="/alice/notes/tells/${n}"`);
730 const changes = await (await get("/alice/notes/changes")).text();
731 expect(changes).toContain(`href="/alice/notes/changes/${p}"`);
728 const tells = await (await get("/alice/notes/issues")).text();
729 expect(tells).toContain(`href="/alice/notes/issues/${n}"`);
730 const changes = await (await get("/alice/notes/pulls")).text();
731 expect(changes).toContain(`href="/alice/notes/pulls/${p}"`);
732732 const appPage = await (await get("/alice/notes")).text();
733 expect(appPage).toContain(`href="/alice/notes/changes/${p}"`);
733 expect(appPage).toContain(`href="/alice/notes/pulls/${p}"`);
734734 const search = await (await get("/search?q=Door+test")).text();
735 expect(search).toContain(`/alice/notes/tells/${n}`);
736 expect(search).toContain(`/alice/notes/changes/${p}`);
735 expect(search).toContain(`/alice/notes/issues/${n}`);
736 expect(search).toContain(`/alice/notes/pulls/${p}`);
737737 // The palette's remote rows are folded in the browser; the index tells
738738 // the script which mode it is in, so it folds the same nouns.
739739 expect(appPage).toContain('"studio":true');
740740 });
741741
742 test("/tells/:number answers a dev-mode viewer, ?mode=dev, and a repository that is not an app with the same page, never a bounce", async () => {
742 test("/issues/:number answers a dev-mode viewer, ?mode=dev, and a repository that is not an app with the same page, never a bounce", async () => {
743743 const told = openIssue(app, alice, repo, { title: "Door test: dev's way" });
744744 if (!told.ok) throw new Error(String(told.error));
745745 const n = told.value.number;
746746
747747 for (const res of [
748 await get(`/alice/notes/tells/${n}`, {
748 await get(`/alice/notes/issues/${n}`, {
749749 cookie: `${cookie}; forge_mode=dev`,
750750 }),
751 await get(`/alice/notes/tells/${n}`),
751 await get(`/alice/notes/issues/${n}`),
752752 ]) {
753753 expect(res.status).toBe(200);
754754 expect(await res.text()).toContain("Door test: dev");
@@ -765,18 +765,18 @@ describe("the studio, continued", () => {
765765 });
766766 if (!plainTold.ok) throw new Error(String(plainTold.error));
767767 const plainTell = await get(
768 `/alice/doorpages/tells/${plainTold.value.number}`,
768 `/alice/doorpages/issues/${plainTold.value.number}`,
769769 );
770770 expect(plainTell.status).toBe(200);
771771 expect(await plainTell.text()).toContain("Not an app");
772772 });
773773
774 test("a reader without access gets the forge's not-found on /tells/:number and /changes/:number, exactly as /issues/:number and /pulls/:number", async () => {
774 test("a reader without access gets the forge's not-found on /issues/:number and /pulls/:number, exactly as /issues/:number and /pulls/:number", async () => {
775775 const told = openIssue(app, alice, repo, { title: "Door test: private" });
776776 if (!told.ok) throw new Error(String(told.error));
777777 const n = told.value.number;
778778
779 const anonTell = await fetch(`${base}/alice/notes/tells/${n}`, {
779 const anonTell = await fetch(`${base}/alice/notes/issues/${n}`, {
780780 headers: { cookie: "forge_mode=studio" },
781781 redirect: "manual",
782782 });
@@ -789,9 +789,9 @@ describe("the studio, continued", () => {
789789
790790 // A number that is not a tell is not a tell at either address, and a
791791 // change's number is not one under the tell's own noun.
792 const missing = await get("/alice/notes/tells/99999");
792 const missing = await get("/alice/notes/issues/99999");
793793 expect(missing.status).toBe(404);
794 const anonChange = await fetch(`${base}/alice/notes/changes/1`, {
794 const anonChange = await fetch(`${base}/alice/notes/pulls/1`, {
795795 headers: { cookie: "forge_mode=studio" },
796796 redirect: "manual",
797797 });
@@ -1313,26 +1313,26 @@ describe("the studio, continued", () => {
13131313 const stray = await open("scout/99999-nothing", "Answers nothing");
13141314 const own = await open("revert-22", "A person's branch");
13151315
1316 const list = await (await get("/alice/notes/changes")).text();
1316 const list = await (await get("/alice/notes/pulls")).text();
13171317 const rowOf = (title: string) => {
13181318 const at = list.indexOf(title);
13191319 return list.slice(at, list.indexOf("</a>", at + 400) + 4);
13201320 };
1321 expect(rowOf("Answers the tell")).toContain(`href="/alice/notes/tells/${n}"`);
1321 expect(rowOf("Answers the tell")).toContain(`href="/alice/notes/issues/${n}"`);
13221322 expect(rowOf("Answers the tell")).not.toContain("already done");
13231323 expect(rowOf("Answers nothing")).not.toContain("for tell");
13241324 expect(rowOf("A person's branch")).not.toContain("for tell");
13251325
13261326 setIssueState(app, alice, repo, told.value, "closed");
1327 const closedList = await (await get("/alice/notes/changes")).text();
1328 expect(closedList).toContain("its tell is already done");
1327 const closedList = await (await get("/alice/notes/pulls")).text();
1328 expect(closedList).toContain("its issue is already done");
13291329 const page = await (
1330 await get(`/alice/notes/changes/${answering.number}`)
1330 await get(`/alice/notes/pulls/${answering.number}`)
13311331 ).text();
1332 expect(page).toContain(`href="/alice/notes/tells/${n}"`);
1333 expect(page).toContain("its tell is already done");
1332 expect(page).toContain(`href="/alice/notes/issues/${n}"`);
1333 expect(page).toContain("its issue is already done");
13341334 for (const p of [stray, own]) {
1335 const res = await get(`/alice/notes/changes/${p.number}`);
1335 const res = await get(`/alice/notes/pulls/${p.number}`);
13361336 expect(res.status).toBe(200);
13371337 expect(await res.text()).not.toContain("for tell");
13381338 }
test/studio-door.test.ts +1 −1
@@ -492,7 +492,7 @@ describe("every open pull's preview on the studio page", () => {
492492 expect(production).not.toContain(note);
493493
494494 const changePage = await (
495 await get(`/alice/widget/changes/${pull.number}`)
495 await get(`/alice/widget/pulls/${pull.number}`)
496496 ).text();
497497 expect(changePage).toContain("<h2>Preview</h2>");
498498 expect(changePage).toContain(note);
test/studio-runs.test.ts +1 −1
@@ -510,7 +510,7 @@ describe("working: a run's own page in the studio", () => {
510510 ).text();
511511 expect(page).toContain("Fix the flicker on load");
512512 // The tell it came from, in the studio's own noun (#158).
513 expect(page).toContain(`href="/alice/engine/tells/${tell.value.number}"`);
513 expect(page).toContain(`href="/alice/engine/issues/${tell.value.number}"`);
514514 expect(page).toContain("$0.42 spent");
515515 expect(page).toContain('data-word="working"');
516516 // An agent's own run still speaks in the agent's name (#195).
test/studio-search.test.ts +20 −20
@@ -176,9 +176,9 @@ describe("finding things in the studio: /search", () => {
176176 test("a change and a tell are found too, each saying which app they belong to", async () => {
177177 const html = await (await asAlice("/search?q=chess")).text();
178178 expect(html).toContain("Add a chess clock timer");
179 expect(html).toContain(`/alice/widgets/tells/${tellNumber}`);
179 expect(html).toContain(`/alice/widgets/issues/${tellNumber}`);
180180 expect(html).toContain("Wire up the chess clock");
181 expect(html).toContain(`/alice/widgets/changes/${changeNumber}`);
181 expect(html).toContain(`/alice/widgets/pulls/${changeNumber}`);
182182 expect(html).toContain("alice/widgets");
183183 });
184184
@@ -210,8 +210,8 @@ describe("finding things in the studio: /search", () => {
210210 ).text(),
211211 ]) {
212212 expect(html).toContain("Apps and repositories");
213 expect(html).toContain("Tells and changes");
214 expect(html).toContain(`/alice/widgets/tells/${tellNumber}`);
213 expect(html).toContain("Issues and pull requests");
214 expect(html).toContain(`/alice/widgets/issues/${tellNumber}`);
215215 expect(mainOf(html)).not.toContain('name="mode"');
216216 }
217217 });
@@ -604,8 +604,8 @@ describe("every studio page's headings form one outline", () => {
604604 test("the app page, the three lists, a tell, a change and a run each have one outline with no skipped level", async () => {
605605 const pages: Record<string, string> = {
606606 "the app page": "/alice/outline",
607 "everything told": "/alice/outline/tells",
608 "every change": "/alice/outline/changes",
607 "everything told": "/alice/outline/issues",
608 "every change": "/alice/outline/pulls",
609609 "every run": "/alice/outline/runs",
610610 "a tell": `/alice/outline/issues/${issueNumber}`,
611611 "a change": `/alice/outline/pulls/${pullNumber}`,
@@ -812,10 +812,10 @@ describe("the studio's Stop and Redeploy come back to the page they were pressed
812812 const stopped = await press(
813813 "stop",
814814 "studio",
815 `${base}/alice/notes/changes/1`,
815 `${base}/alice/notes/pulls/1`,
816816 );
817817 expect(stopped.status).toBe(303);
818 expect(stopped.headers.get("location")).toBe("/alice/notes/changes/1");
818 expect(stopped.headers.get("location")).toBe("/alice/notes/pulls/1");
819819 });
820820
821821 test("no referer, or one from somewhere else, falls back to the app's studio page — never the raw /app", async () => {
@@ -1104,11 +1104,11 @@ describe("the studio names a person on the app's page, and the crew only for the
11041104
11051105 test("an anonymous visitor reads one author for one change on all three pages, avatar included", async () => {
11061106 const appPage = await anon("/ivy/pub");
1107 const changes = await anon("/ivy/pub/changes");
1108 const change = await anon(`/ivy/pub/changes/${personPull.number}`);
1107 const changes = await anon("/ivy/pub/pulls");
1108 const change = await anon(`/ivy/pub/pulls/${personPull.number}`);
11091109
1110 const onApp = rowWith(appPage, `/changes/${personPull.number}`);
1111 const onList = rowWith(changes, `/changes/${personPull.number}`);
1110 const onApp = rowWith(appPage, `/pulls/${personPull.number}`);
1111 const onList = rowWith(changes, `/pulls/${personPull.number}`);
11121112 expect(onApp).toContain("ivy");
11131113 expect(onApp).not.toContain("the crew");
11141114 // The same name the list gives, and the same initials beside it.
@@ -1117,7 +1117,7 @@ describe("the studio names a person on the app's page, and the crew only for the
11171117 expect(change).toContain("ivy");
11181118
11191119 // A tell she took herself is hers on the same panel, by the same rule.
1120 const held = rowWith(appPage, `/tells/${heldTell.number}`);
1120 const held = rowWith(appPage, `/issues/${heldTell.number}`);
11211121 expect(held).toContain("ivy");
11221122 expect(held).not.toContain("the crew");
11231123 expect(initialsIn(held)).toBe("i");
@@ -1125,7 +1125,7 @@ describe("the studio names a person on the app's page, and the crew only for the
11251125
11261126 test("the crew's own change and the crew's own run still read as the crew's to that visitor", async () => {
11271127 const appPage = await anon("/ivy/pub");
1128 const onApp = rowWith(appPage, `/changes/${agentPull.number}`);
1128 const onApp = rowWith(appPage, `/pulls/${agentPull.number}`);
11291129 expect(onApp).toContain("the crew");
11301130 expect(onApp).not.toContain("quill");
11311131 expect(initialsIn(onApp)).toBe("tc");
@@ -1134,7 +1134,7 @@ describe("the studio names a person on the app's page, and the crew only for the
11341134 expect(runRow).toContain("the crew");
11351135 expect(runRow).not.toContain("quill");
11361136
1137 const tellRow = rowWith(appPage, `/tells/${waitingTell.number}`);
1137 const tellRow = rowWith(appPage, `/issues/${waitingTell.number}`);
11381138 expect(tellRow).toContain("the crew");
11391139 expect(tellRow).not.toContain("quill");
11401140
@@ -1146,9 +1146,9 @@ describe("the studio names a person on the app's page, and the crew only for the
11461146
11471147 test("the owner still reads the crew by name, and her own change as her own", async () => {
11481148 const appPage = await owner("/ivy/pub");
1149 expect(rowWith(appPage, `/changes/${agentPull.number}`)).toContain("quill");
1149 expect(rowWith(appPage, `/pulls/${agentPull.number}`)).toContain("quill");
11501150 expect(rowWith(appPage, `/runs/${agentRun.id}`)).toContain("quill");
1151 expect(rowWith(appPage, `/changes/${personPull.number}`)).toContain("ivy");
1151 expect(rowWith(appPage, `/pulls/${personPull.number}`)).toContain("ivy");
11521152 });
11531153 });
11541154
@@ -1226,7 +1226,7 @@ describe("the studio's empty lists", () => {
12261226 await setup("blank");
12271227 for (const [path, words] of [
12281228 ["issues", "Tell the crew what you want"],
1229 ["pulls", "A change is the crew"],
1229 ["pulls", "A pull request is the crew"],
12301230 ["runs", "A run is one go"],
12311231 ] as const) {
12321232 const page = await get(`/alice/blank/${path}`);
@@ -1241,10 +1241,10 @@ describe("the studio's empty lists", () => {
12411241 const told = openIssue(app, alice, repo, { title: "Add a tab", body: "" });
12421242 if (!told.ok) throw new Error(String(told.error));
12431243 const issues = await get("/alice/busy/issues?word=shipped");
1244 expect(issues).toContain("Nothing told is shipped yet.");
1244 expect(issues).toContain("No issue is shipped yet.");
12451245 expect(issues).not.toContain("Tell the crew what you want");
12461246 const pulls = await get("/alice/busy/pulls?word=look");
1247 expect(pulls).toContain("No change is look yet.");
1247 expect(pulls).toContain("No pull request is look yet.");
12481248 const runs = await get("/alice/busy/runs?word=stopped");
12491249 expect(runs).toContain("No run is stopped yet.");
12501250 });
test/studio-words.test.ts +14 −21
@@ -88,10 +88,6 @@ const DEV_WORDS: readonly { pattern: RegExp; because: string }[] = [
8888 pattern: /\bmerge\b/i,
8989 because: "the studio's own word for a merge is shipped",
9090 },
91 {
92 pattern: /pull request/i,
93 because: "the studio's own word for a pull is change",
94 },
9591 {
9692 // Bare "issue" also rides the topbar's own live-event wiring
9793 // (`data-live="run.*,pull.*,issue.*,check.*"`) on every page, which is
@@ -521,7 +517,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
521517 word: "app",
522518 path: repoPath,
523519 title: "vocab",
524 shows: [`href="#i-pull"/></svg>Changes`],
520 shows: [`href="#i-pull"/></svg>Pulls`],
525521 hides: [`href="#i-eye"/></svg>Look`, `>Look<`, 'class="where"'],
526522 // #630: the app page is the home in every mode; its code, with dev's
527523 // where strip, is the Files step one tab over.
@@ -542,7 +538,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
542538 // `/pulls/:number`), which the row above already proves.
543539 {
544540 word: "tell (the studio's noun)",
545 path: `${repoPath}/tells/${tellNumber}`,
541 path: `${repoPath}/issues/${tellNumber}`,
546542 shows: [tellTitle, "Close tell"],
547543 title: `${tellTitle} · vocab`,
548544 },
@@ -564,7 +560,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
564560 },
565561 {
566562 word: "look (the studio's noun)",
567 path: `${repoPath}/changes/${openPullNumber}`,
563 path: `${repoPath}/pulls/${openPullNumber}`,
568564 shows: [openPullTitle, "Close change"],
569565 title: `${openPullTitle} · vocab`,
570566 },
@@ -581,8 +577,8 @@ describe("dev's vocabulary never reaches a studio page", () => {
581577 shows: [
582578 tellTitle,
583579 untouchedTitle,
584 `href="${repoPath}/tells/${tellNumber}"`,
585 `href="${repoPath}/tells/${untouchedNumber}"`,
580 `href="${repoPath}/issues/${tellNumber}"`,
581 `href="${repoPath}/issues/${untouchedNumber}"`,
586582 ],
587583 hides: [
588584 `href="${repoPath}/issues/${tellNumber}"`,
@@ -623,7 +619,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
623619 },
624620 {
625621 word: "tells (the studio's noun)",
626 path: `${repoPath}/tells`,
622 path: `${repoPath}/issues`,
627623 shows: [untouchedTitle, tellTitle],
628624 title: "Everything told · vocab",
629625 },
@@ -632,7 +628,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
632628 // own address alike — the tab, the heading and the button all say
633629 // the studio's word, and the form still posts where it always has.
634630 word: "tell the crew (the studio's noun)",
635 path: `${repoPath}/tells/new`,
631 path: `${repoPath}/issues/new`,
636632 shows: [`action="${repoPath}/issues/new"`, "<h1 class=\"mt\">Tell the crew</h1>"],
637633 title: "Tell the crew · vocab",
638634 },
@@ -646,7 +642,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
646642 },
647643 {
648644 word: "changes (the studio's noun)",
649 path: `${repoPath}/changes`,
645 path: `${repoPath}/pulls`,
650646 shows: [openPullTitle, secondChangeTitle],
651647 title: "Every change · vocab",
652648 },
@@ -678,7 +674,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
678674 // The stopped run is not open and moving, so the bare list leaves it
679675 // out — the filter below is where it shows up.
680676 hides: [`href="${repoPath}/runs/${stoppedRunId}"`],
681 title: "Every run · vocab",
677 title: "Runs · vocab",
682678 },
683679 {
684680 word: "runs (stopped)",
@@ -806,8 +802,6 @@ describe("dev's vocabulary never reaches a studio page", () => {
806802 "alice/vocab — Code",
807803 "alice/vocab — Commits",
808804 "alice/vocab — New issue",
809 "alice/vocab — Issues",
810 "alice/vocab — Pull requests",
811805 ]) {
812806 expect(rows.has(t), `palette still offers "${t}" on a studio app page`).toBe(
813807 false,
@@ -816,8 +810,8 @@ describe("dev's vocabulary never reaches a studio page", () => {
816810
817811 // The studio's own nouns, at the studio's own addresses.
818812 expect(rows.get("alice/vocab — Studio")).toBe(repoPath);
819 expect(rows.get("alice/vocab — Told")).toBe(`${repoPath}/tells`);
820 expect(rows.get("alice/vocab — Changes")).toBe(`${repoPath}/changes`);
813 expect(rows.get("alice/vocab — Issues")).toBe(`${repoPath}/issues`);
814 expect(rows.get("alice/vocab — Pull requests")).toBe(`${repoPath}/pulls`);
821815 // The studio's first verb — telling the crew — reachable from the
822816 // palette, landing on the app page where the tell box lives.
823817 expect(rows.get("alice/vocab — Tell the crew")).toBe(`${repoPath}#tell`);
@@ -846,7 +840,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
846840 ["/alice/plain/issues", "Issues · plain"],
847841 ["/alice/plain/issues/new", "New issue · plain"],
848842 ["/alice/plain/pulls", "Pull requests · plain"],
849 ["/alice/plain/runs", "Every run · plain"],
843 ["/alice/plain/runs", "Runs · plain"],
850844 ]);
851845 for (const [path, title] of titles) {
852846 const res = await fetch(`${base}${path}`, {
@@ -856,13 +850,12 @@ describe("dev's vocabulary never reaches a studio page", () => {
856850 expect(res.status, path).toBe(200);
857851 expect(titleOf(await res.text()), path).toBe(title);
858852 }
859 // No studio, no studio door: the compose address under the studio's
860 // noun hands a non-app to dev's own.
853 // The retired compose address moves to the one issue form.
861854 const door = await fetch(`${base}/alice/plain/tells/new`, {
862855 headers: { cookie: `${cookie}; forge_mode=studio` },
863856 redirect: "manual",
864857 });
865 expect(door.status).toBe(303);
858 expect(door.status).toBe(301);
866859 expect(door.headers.get("location")).toBe("/alice/plain/issues/new");
867860 });
868861
test/studio.test.ts +3 −3
@@ -158,7 +158,7 @@ describe("the studio", () => {
158158 // The depth row on every repository's header: Files (or Code), Changes
159159 // (or Pulls) and Runs; Terminal only where SSH is on, which it is not here.
160160 expect(withDev).toContain('href="/alice/notes/files"');
161 expect(withDev).toContain('href="/alice/notes/changes"');
161 expect(withDev).toContain('href="/alice/notes/pulls"');
162162 expect(withDev).toContain('href="/alice/notes/runs"');
163163 expect(withDev).not.toContain('href="/settings/keys#terminal"');
164164 // The toggle's POST is gone with it.
@@ -391,7 +391,7 @@ describe("the studio", () => {
391391 );
392392 expect(lost.status).toBe(303);
393393 expect(lost.headers.get("location")).toBe(
394 `/alice/notes/changes/${evil.number}`,
394 `/alice/notes/pulls/${evil.number}`,
395395 );
396396 });
397397
@@ -1076,7 +1076,7 @@ describe("the studio", () => {
10761076 expect(studio).toContain("Ground work");
10771077 // What it waits on, in the studio's own noun (#158).
10781078 expect(studio).toContain(
1079 `href="/alice/notes/tells/${blocker.value.number}"`,
1079 `href="/alice/notes/issues/${blocker.value.number}"`,
10801080 );
10811081 expect(studio).toContain('data-word="working"');
10821082 expect(studio).toContain("$0.12");
test/tui-tell.test.ts +1 −1
@@ -120,7 +120,7 @@ describe("tell the crew in the terminal", () => {
120120 } as unknown as Told;
121121 const answer = tellAnswer({ ok: true, value });
122122 expect(answer.text).toBe(toldWords(value));
123 expect(answer.text).toContain("Told as #7, but mason could not take it.");
123 expect(answer.text).toContain("Opened as issue #7, but mason could not take it.");
124124 expect(answer.text).not.toContain("is on it");
125125 expect(answer.tone).toBe("danger");
126126 });
test/unfurl.test.ts +7 −7
@@ -166,13 +166,13 @@ describe("the pages", () => {
166166 });
167167
168168 test("a tell opens on its state and first line", async () => {
169 const line = unfurl(await get(`/alice/open/tells/${numbers.tell}`));
169 const line = unfurl(await get(`/alice/open/issues/${numbers.tell}`));
170170 expect(line).toContain("Say hello from open.");
171171 expect(line).not.toContain("Second line");
172172 });
173173
174174 test("a change opens on its word and its own words", async () => {
175 const line = unfurl(await get(`/alice/open/changes/${numbers.change}`));
175 const line = unfurl(await get(`/alice/open/pulls/${numbers.change}`));
176176 expect(line).toContain("Make open better.");
177177 });
178178
@@ -192,8 +192,8 @@ describe("the pages", () => {
192192
193193 test("no sentence uses dev's vocabulary", async () => {
194194 for (const path of [
195 `/alice/open/tells/${numbers.tell}`,
196 `/alice/open/changes/${numbers.change}`,
195 `/alice/open/issues/${numbers.tell}`,
196 `/alice/open/pulls/${numbers.change}`,
197197 `/alice/open/runs/${ids.run}`,
198198 ])
199199 expect(unfurl(await get(path))).not.toMatch(
@@ -203,8 +203,8 @@ describe("the pages", () => {
203203
204204 test("a private tell, change, run and app say 'Private.' and no more", async () => {
205205 for (const path of [
206 `/alice/hush/tells/${numbers.hushTell}`,
207 `/alice/hush/changes/${numbers.hushChange}`,
206 `/alice/hush/issues/${numbers.hushTell}`,
207 `/alice/hush/pulls/${numbers.hushChange}`,
208208 `/alice/hush/runs/${ids.hushRun}`,
209209 "/alice/hush/app",
210210 ]) {
@@ -215,7 +215,7 @@ describe("the pages", () => {
215215 });
216216
217217 test("anonymously a private page is not there at all", async () => {
218 const res = await fetch(`${servers.url}/alice/hush/tells/${numbers.hushTell}`);
218 const res = await fetch(`${servers.url}/alice/hush/issues/${numbers.hushTell}`);
219219 expect(res.status).toBe(404);
220220 });
221221 });
test/web-code.test.ts +2 −2
@@ -446,7 +446,7 @@ describe("the code browser on the web", () => {
446446 });
447447 expect(repo).toBeDefined();
448448 const html = await text("/alice/beacon/issues", alice);
449 expect(html).toContain('href="/alice/beacon/tells/1"');
449 expect(html).toContain('href="/alice/beacon/issues/1"');
450450 expect(html).toContain("data-word=");
451451 expect(await text("/alice/beacon/issues/1", alice)).toContain(
452452 "still flickering",
@@ -458,7 +458,7 @@ describe("the code browser on the web", () => {
458458 test("the search page renders repositories, conversations and code", async () => {
459459 const html = await text("/search?q=lamp", alice);
460460 expect(html).toContain("Apps and repositories");
461 expect(html).toContain("Tells and changes");
461 expect(html).toContain("Issues and pull requests");
462462 expect(html).toContain(">Code");
463463 // A code hit says where it is and shows the line with the query marked.
464464 expect(html).toContain("src/lamp.ts");
test/web-workflows.test.ts +1 −1
@@ -772,7 +772,7 @@ describe("verdicts, threads, and the gate they open", () => {
772772 test("the pull list shows each pull in its word; where it stands on review is one step deeper, on the change", async () => {
773773 // One list (#627): a row is the pull's word, never a review badge.
774774 const list = await bodyOf("ada", "/acme/lib/pulls");
775 expect(list).toContain(`href="/acme/lib/changes/${pullNumber}"`);
775 expect(list).toContain(`href="/acme/lib/pulls/${pullNumber}"`);
776776 expect(list).toContain("data-word=");
777777 expect(words(list)).not.toContain("Needs review");
778778

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs