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
scout/forge:scout/3241-issues-and-pull-requests-are-called-issu → main 1 commit fork
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."; | ||
| 158 | 158 | /** What happened, in the sentence both doors say. */ |
| 159 | 159 | export function toldWords(told: Told): string { |
| 160 | 160 | 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.`; | |
| 162 | 162 | const r = told.routed; |
| 163 | 163 | const who = r.builder.user.username; |
| 164 | 164 | return told.assigned |
| 165 | 165 | ? `${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.`; | |
| 167 | 167 | } |
src/feed/items.ts +8 −8
| @@ -340,7 +340,7 @@ function fromEvent( | ||
| 340 | 340 | ...(pull?.authorIsAgent ? [`by ${pull.authorName}`] : []), |
| 341 | 341 | ].join(", "); |
| 342 | 342 | 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}`; | |
| 344 | 344 | switch (e.kind) { |
| 345 | 345 | case "run.finished": { |
| 346 | 346 | const state = p["state"] === "failed" ? "failed" : "ok"; |
| @@ -364,11 +364,11 @@ function fromEvent( | ||
| 364 | 364 | }; |
| 365 | 365 | } |
| 366 | 366 | 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}` }; | |
| 368 | 368 | 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}` }; | |
| 370 | 370 | 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)}` : ""}` }; | |
| 372 | 372 | case "look.taken": |
| 373 | 373 | return { ...common, kind: "look", link: base(repo), what: "a new picture of it is ready" }; |
| 374 | 374 | case "app.serving": |
| @@ -380,15 +380,15 @@ function fromEvent( | ||
| 380 | 380 | return { |
| 381 | 381 | ...common, |
| 382 | 382 | 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), | |
| 385 | 385 | }; |
| 386 | 386 | } |
| 387 | 387 | case "issue.commented": |
| 388 | 388 | case "pull.commented": { |
| 389 | 389 | if (number === undefined) return undefined; |
| 390 | 390 | 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. | |
| 392 | 392 | const on = clip( |
| 393 | 393 | (e.kind === "issue.commented" ? subjects.issue(repo.id, number)?.title : title) ?? |
| 394 | 394 | `#${number}`, |
| @@ -399,7 +399,7 @@ function fromEvent( | ||
| 399 | 399 | kind: "reply", |
| 400 | 400 | link: |
| 401 | 401 | e.kind === "issue.commented" |
| 402 | ? `${base(repo)}/tells/${number}` | |
| 402 | ? `${base(repo)}/issues/${number}` | |
| 403 | 403 | : change, |
| 404 | 404 | what: said === "" ? `replied on “${on}”` : `on “${on}”: ${clip(said)}`, |
| 405 | 405 | }; |
src/http/server.ts +11 −7
| @@ -222,7 +222,6 @@ import { | ||
| 222 | 222 | issueThreadFragment, |
| 223 | 223 | newIssuePage, |
| 224 | 224 | newIssueSubmit, |
| 225 | newTellPage, | |
| 226 | 225 | } from "../web/pages/issues.ts"; |
| 227 | 226 | import { tellPage } from "../web/studio/tell.ts"; |
| 228 | 227 | import { tellHerePage } from "../web/studio/tell_here.ts"; |
| @@ -331,7 +330,6 @@ import { | ||
| 331 | 330 | } from "../web/pages/crew.ts"; |
| 332 | 331 | import { newPullPage, newPullSubmit } from "../web/pages/pulls.ts"; |
| 333 | 332 | import { |
| 334 | changePage, | |
| 335 | 333 | pullPage, |
| 336 | 334 | pullStateFragment, |
| 337 | 335 | } from "../web/studio/change.ts"; |
| @@ -621,6 +619,13 @@ const gitChallenge = () => | ||
| 621 | 619 | |
| 622 | 620 | // ---- the public server ---- |
| 623 | 621 | |
| 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 | ||
| 624 | 629 | export function buildRouter(): Router<Handler> { |
| 625 | 630 | const router = new Router<Handler>(); |
| 626 | 631 | |
| @@ -1063,9 +1068,8 @@ export function buildRouter(): Router<Handler> { | ||
| 1063 | 1068 | // One issue page, at `/issues/:number` and `/tells/:number` alike, for |
| 1064 | 1069 | // every repository and every viewer. The literal /tells is registered |
| 1065 | 1070 | // 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")); | |
| 1069 | 1073 | router.add("GET", "/:owner/:name/report", reportPage); |
| 1070 | 1074 | router.add("POST", "/:owner/:name/report", reportSubmit); |
| 1071 | 1075 | router.add("GET", "/:owner/:name/reports", reportsPage); |
| @@ -1136,8 +1140,8 @@ export function buildRouter(): Router<Handler> { | ||
| 1136 | 1140 | // the studio's own noun. See the tells above for the rule; the forms that |
| 1137 | 1141 | // ship, close and comment keep posting under /pulls/:number. |
| 1138 | 1142 | 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")); | |
| 1141 | 1145 | router.add("GET", "/:owner/:name/pulls/new", newPullPage); |
| 1142 | 1146 | router.add("POST", "/:owner/:name/pulls/new", newPullSubmit); |
| 1143 | 1147 | router.add("GET", "/:owner/:name/pulls/:number", pullPage); |
src/web/chrome.ts +8 −9
| @@ -203,10 +203,9 @@ export function scopeHeader( | ||
| 203 | 203 | }, |
| 204 | 204 | ]), |
| 205 | 205 | { |
| 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), | |
| 210 | 209 | icon: studio ? "clock" : "issue", |
| 211 | 210 | ...(facts.openIssues === null ? {} : { count: facts.openIssues }), |
| 212 | 211 | current: active === "issues", |
| @@ -215,9 +214,9 @@ export function scopeHeader( | ||
| 215 | 214 | { |
| 216 | 215 | // "Look" is the five-word state a green pull is in, and the name of |
| 217 | 216 | // 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), | |
| 221 | 220 | icon: "pull", |
| 222 | 221 | ...(facts.openPulls === null ? {} : { count: facts.openPulls }), |
| 223 | 222 | current: active === "pulls", |
| @@ -383,8 +382,8 @@ export function repoPalette(ctx: Ctx, repo: Repo): PaletteItem[] { | ||
| 383 | 382 | return [ |
| 384 | 383 | { t: `${name} — Studio`, h: base, c: "This repo" }, |
| 385 | 384 | { 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" }, | |
| 388 | 387 | // Telling the crew is for who may direct it (`mayDirectCrew`: a |
| 389 | 388 | // writer, or anyone signed in where the owner let outsiders in), so |
| 390 | 389 | // 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 { | ||
| 222 | 222 | </ul>`, |
| 223 | 223 | { |
| 224 | 224 | head: html`${icon("history")} |
| 225 | <h2>Changes</h2>`, | |
| 225 | <h2>History</h2>`, | |
| 226 | 226 | pad: false, |
| 227 | 227 | }, |
| 228 | 228 | )}`; |
src/web/pages/capacity.ts +1 −1
| @@ -165,7 +165,7 @@ export function capacityPage(ctx: Ctx): Response { | ||
| 165 | 165 | </ul>`, |
| 166 | 166 | { |
| 167 | 167 | head: html`${icon("history")} |
| 168 | <h2>Changes</h2>`, | |
| 168 | <h2>History</h2>`, | |
| 169 | 169 | pad: false, |
| 170 | 170 | }, |
| 171 | 171 | )}`; |
src/web/pages/search.ts +3 −3
| @@ -248,9 +248,9 @@ const WORDS: readonly Words[] = [ | ||
| 248 | 248 | ], |
| 249 | 249 | [ |
| 250 | 250 | "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", | |
| 254 | 254 | ], |
| 255 | 255 | ["code", "Code", "Code", "No line of code matches"], |
| 256 | 256 | ]; |
src/web/studio/actions.ts +3 −3
| @@ -135,11 +135,11 @@ async function tellFromPage(ctx: Ctx, repo: Repo, form: Form): Promise<Response> | ||
| 135 | 135 | const issue = `${repoBase(repo)}/issues/${told.value.issue.number}`; |
| 136 | 136 | return page({ |
| 137 | 137 | ctx, |
| 138 | title: `Told · ${repo.name}`, | |
| 138 | title: `Issue opened · ${repo.name}`, | |
| 139 | 139 | crumbs: crumbsFor(repo), |
| 140 | body: html`${pageHead("Told")} | |
| 140 | body: html`${pageHead("Issue opened")} | |
| 141 | 141 | <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>`, | |
| 143 | 143 | }); |
| 144 | 144 | } |
| 145 | 145 |
src/web/studio/app.ts +4 −4
| @@ -370,11 +370,11 @@ export async function studioApp( | ||
| 370 | 370 | : !ownerFacts |
| 371 | 371 | ? html`<dl> |
| 372 | 372 | <dt>Shipped</dt> |
| 373 | <dd>${shipped} change${shipped === 1 ? "" : "s"}</dd> | |
| 373 | <dd>${shipped} pull request${shipped === 1 ? "" : "s"}</dd> | |
| 374 | 374 | </dl>` |
| 375 | 375 | : html`<dl> |
| 376 | 376 | <dt>Shipped</dt> |
| 377 | <dd>${shipped} change${shipped === 1 ? "" : "s"}</dd> | |
| 377 | <dd>${shipped} pull request${shipped === 1 ? "" : "s"}</dd> | |
| 378 | 378 | <dt>Runs</dt> |
| 379 | 379 | <dd>${weekTotals.runs}</dd> |
| 380 | 380 | <dt>Preview</dt> |
| @@ -444,8 +444,8 @@ export async function studioApp( | ||
| 444 | 444 | // domains — is the admin's, on the app's settings page. |
| 445 | 445 | const more = html`<p class="muted small"> |
| 446 | 446 | <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( | |
| 449 | 449 | canAdmin(db, repo, ctx.auth.user), |
| 450 | 450 | () => html` · <a href="${base}/settings/app">Environment settings</a>`, |
| 451 | 451 | )} |
src/web/studio/asks.ts +11 −11
| @@ -161,14 +161,14 @@ export interface AskWords { | ||
| 161 | 161 | /** The words for each kind of ask: every ask names its decision, its options and its default. */ |
| 162 | 162 | export const ASK_WORDS: Readonly<Record<DecisionKind, AskWords>> = { |
| 163 | 163 | look: { |
| 164 | decision: "Ship this change?", | |
| 164 | decision: "Ship this pull request?", | |
| 165 | 165 | options: ["Ship", "Say what is off"], |
| 166 | 166 | ifNothing: "it waits; nothing ships", |
| 167 | 167 | }, |
| 168 | 168 | 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?", | |
| 170 | 170 | 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", | |
| 172 | 172 | }, |
| 173 | 173 | stopped: { |
| 174 | 174 | decision: "The check fails and the crew stopped: what should it try?", |
| @@ -229,7 +229,7 @@ export const KIND_TIER: Readonly<Record<DecisionKind, Consequence>> = { | ||
| 229 | 229 | paused: { score: 80, why: "money: the crew is stopped at its ceiling" }, |
| 230 | 230 | declined: { score: 70, why: "the planner has stopped for this app" }, |
| 231 | 231 | 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" }, | |
| 233 | 233 | handover: { score: 55, why: "three reviews without an approval: handed to a person" }, |
| 234 | 234 | parked: { score: 40, why: "parked by the crew" }, |
| 235 | 235 | look: { score: 30, why: "green, waiting" }, |
| @@ -994,7 +994,7 @@ function lineOf(c: AskCandidate): string { | ||
| 994 | 994 | : `"${title}" is green, waiting for your look`; |
| 995 | 995 | } |
| 996 | 996 | |
| 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. */ | |
| 998 | 998 | const reviewWhy = (wait: ReviewWait | undefined): string => |
| 999 | 999 | wait?.why === "rounds" |
| 1000 | 1000 | ? `the reviewer asked for changes three times, since ${wait.since.slice(0, 10)}` |
| @@ -1006,11 +1006,11 @@ const reviewWhy = (wait: ReviewWait | undefined): string => | ||
| 1006 | 1006 | |
| 1007 | 1007 | /** A collapsed row in a line: how many, and of what. */ |
| 1008 | 1008 | 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`, | |
| 1012 | 1012 | 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`, | |
| 1014 | 1014 | declined: (n) => `the planner declined ${n} times and waits for you`, |
| 1015 | 1015 | proposal: (n) => `${n} waves wait for your nod`, |
| 1016 | 1016 | paused: (n) => `${n} pauses at the ceiling`, |
| @@ -1102,7 +1102,7 @@ export function askLinesFor( | ||
| 1102 | 1102 | ...about, |
| 1103 | 1103 | line, |
| 1104 | 1104 | number: only.pull!.number, |
| 1105 | link: `${base}/changes/${only.pull!.number}`, | |
| 1105 | link: `${base}/pulls/${only.pull!.number}`, | |
| 1106 | 1106 | }; |
| 1107 | 1107 | }); |
| 1108 | 1108 | } |
| @@ -1230,7 +1230,7 @@ export function decisionsFor( | ||
| 1230 | 1230 | repo: c.repo, |
| 1231 | 1231 | pull: c.pull, |
| 1232 | 1232 | 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.`, | |
| 1234 | 1234 | short: `green; waits for a review — ${reviewWhy(c.reviewWait)}`, |
| 1235 | 1235 | }; |
| 1236 | 1236 | if (c.kind === "look" && c.pull) { |
src/web/studio/branch_tell.ts +2 −2
| @@ -65,8 +65,8 @@ export function tellsAnswered( | ||
| 65 | 65 | * and — when that tell is closed — what a person can act on. Never a verdict: |
| 66 | 66 | * the change's word is judged elsewhere and is not touched by this. */ |
| 67 | 67 | 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>`; | |
| 69 | 69 | return t.closed |
| 70 | ? html`for ${link} — its tell is already done` | |
| 70 | ? html`for ${link} — its issue is already done` | |
| 71 | 71 | : html`for ${link}`; |
| 72 | 72 | } |
src/web/studio/feed.ts +4 −4
| @@ -30,16 +30,16 @@ export const FEED_FIRST_PAGE = 20; | ||
| 30 | 30 | |
| 31 | 31 | const RUN_LINK = /^\/[^/]+\/[^/]+\/runs\/[A-Za-z0-9_-]+$/; |
| 32 | 32 | |
| 33 | const KIND_LABEL: Record<FeedItem["kind"], string> = { | |
| 33 | export const KIND_LABEL: Record<FeedItem["kind"], string> = { | |
| 34 | 34 | run: "Run", |
| 35 | 35 | ask: "Needs you", |
| 36 | pull: "Change", | |
| 36 | pull: "Pull request", | |
| 37 | 37 | decision: "Decision", |
| 38 | 38 | map: "Map", |
| 39 | 39 | cost: "Cost", |
| 40 | 40 | milestone: "Watching", |
| 41 | 41 | choose: "Choose", |
| 42 | tell: "Told", | |
| 42 | tell: "Issue", | |
| 43 | 43 | reply: "Reply", |
| 44 | 44 | look: "Look", |
| 45 | 45 | release: "Release", |
| @@ -196,7 +196,7 @@ export function feedNote(): Html { | ||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | const CHIP_LABEL: Record<KindChip, string> = { |
| 199 | reviews: "Changes", | |
| 199 | reviews: "Reviews", | |
| 200 | 200 | decisions: "Decisions", |
| 201 | 201 | crew: "Crew words", |
| 202 | 202 | releases: "Releases", |
src/web/studio/lists.ts +4 −4
| @@ -134,7 +134,7 @@ function wordFilterBar( | ||
| 134 | 134 | ${seg([ |
| 135 | 135 | { label: "Open", href: href(undefined), current: open }, |
| 136 | 136 | ...words.map((w) => ({ |
| 137 | label: w[0]!.toUpperCase() + w.slice(1), | |
| 137 | label: w === "told" ? "Not started" : w[0]!.toUpperCase() + w.slice(1), | |
| 138 | 138 | href: href(w), |
| 139 | 139 | current: current === w, |
| 140 | 140 | })), |
| @@ -366,7 +366,7 @@ export async function tellsList(ctx: Ctx): Promise<Response> { | ||
| 366 | 366 | title: "Nothing here", |
| 367 | 367 | note: emptyNote( |
| 368 | 368 | f.word, |
| 369 | record === undefined ? "No issue" : "Nothing told", | |
| 369 | "No issue", | |
| 370 | 370 | record === undefined |
| 371 | 371 | ? "Nothing open." |
| 372 | 372 | : "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> { | ||
| 499 | 499 | title: "Nothing here", |
| 500 | 500 | note: emptyNote( |
| 501 | 501 | f.word, |
| 502 | "No change", | |
| 502 | "No pull request", | |
| 503 | 503 | record === undefined |
| 504 | 504 | ? "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.", | |
| 506 | 506 | ), |
| 507 | 507 | }) |
| 508 | 508 | : listCard( |
src/web/studio/nouns.ts +7 −7
| @@ -20,20 +20,20 @@ import type { Repo } from "../../core/repos.ts"; | ||
| 20 | 20 | import type { Ctx } from "../../http/context.ts"; |
| 21 | 21 | |
| 22 | 22 | /** 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`; | |
| 24 | 24 | |
| 25 | 25 | /** 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`; | |
| 27 | 27 | |
| 28 | 28 | /** One tell: the same page `/issues/:number` reaches, under the studio's |
| 29 | 29 | * own noun (`tellPage`, `src/web/pages/issues.ts`). */ |
| 30 | 30 | export const tellHref = (base: string, number: number): string => |
| 31 | `${base}/tells/${number}`; | |
| 31 | `${base}/issues/${number}`; | |
| 32 | 32 | |
| 33 | 33 | /** One change: the same page `/pulls/:number` reaches, under the studio's |
| 34 | 34 | * own noun (`changePage`, `src/web/studio/change.ts`). */ |
| 35 | 35 | export const changeHref = (base: string, number: number): string => |
| 36 | `${base}/changes/${number}`; | |
| 36 | `${base}/pulls/${number}`; | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * 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 { | ||
| 55 | 55 | * none of those is here. |
| 56 | 56 | */ |
| 57 | 57 | 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" }, | |
| 61 | 61 | compose: { studio: "Tell the crew", dev: "New issue" }, |
| 62 | 62 | settings: { studio: "Settings", dev: "Settings" }, |
| 63 | 63 | } as const; |
src/web/studio/tell.ts +1 −1
| @@ -419,7 +419,7 @@ async function studioTell( | ||
| 419 | 419 | action: `${thread}/comments`, |
| 420 | 420 | ...(mayClose ? { stateAction: `${thread}/state` } : {}), |
| 421 | 421 | state: issue.state, |
| 422 | closeLabel: plain ? "Close issue" : "Close tell", | |
| 422 | closeLabel: "Close issue", | |
| 423 | 423 | crewNote: threadNote(ctx.app.db, repo, issue), |
| 424 | 424 | reasons: true, |
| 425 | 425 | })} |
test/asks-expiry.test.ts +1 −1
| @@ -190,7 +190,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 190 | 190 | const lines = askLinesFor(app.db, aliceUser); |
| 191 | 191 | expect(lines.map((l) => l.id)).toEqual([`look:${apples.id}`]); |
| 192 | 192 | expect(lines[0]!.link).toBe( |
| 193 | `/${repo.ownerName}/${repo.name}/changes/${apples.number}`, | |
| 193 | `/${repo.ownerName}/${repo.name}/pulls/${apples.number}`, | |
| 194 | 194 | ); |
| 195 | 195 | }); |
| 196 | 196 |
test/audit.test.ts +1 −1
| @@ -17,7 +17,7 @@ import { | ||
| 17 | 17 | contractChanges, |
| 18 | 18 | crossingsWaiting, |
| 19 | 19 | verdictChanges, |
| 20 | } from "../src/contract/changes.ts"; | |
| 20 | } from "../src/contract/pulls.ts"; | |
| 21 | 21 | import { recordProbe } from "../src/contract/probes.ts"; |
| 22 | 22 | import { recordDecision } from "../src/core/decisions.ts"; |
| 23 | 23 | 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", () => { | ||
| 123 | 123 | }) |
| 124 | 124 | ).text(); |
| 125 | 125 | expect(page).toContain('id="run-carries"'); |
| 126 | expect(page).toContain(`/changes/${two.number}`); | |
| 126 | expect(page).toContain(`/pulls/${two.number}`); | |
| 127 | 127 | }, 180_000); |
| 128 | 128 | }); |
test/feed-page.test.ts +1 −1
| @@ -95,7 +95,7 @@ describe("the feed on the home page", () => { | ||
| 95 | 95 | expect(text).toContain('href="/alice/open/runs/r1"'); |
| 96 | 96 | expect(text).toContain('action="/alice/open/runs/r1/steer"'); |
| 97 | 97 | 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; | |
| 99 | 99 | expect(tell).toContain('action="/alice/open/tell"'); |
| 100 | 100 | expect(tell).toContain('data-feed="dismissed"'); |
| 101 | 101 | 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", () => { | ||
| 212 | 212 | expect(home).toContain("Your crew has its direction:"); |
| 213 | 213 | expect(home).not.toContain("already at work"); |
| 214 | 214 | 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/); | |
| 216 | 216 | // Each app with its way in. |
| 217 | 217 | expect(home).toContain('href="/marias/bakery"'); |
| 218 | 218 | }); |
test/here-manifest.test.ts +1 −1
| @@ -319,7 +319,7 @@ describe("the manifest: what you can do here, as who you are", () => { | ||
| 319 | 319 | headBranch: "mine", |
| 320 | 320 | }); |
| 321 | 321 | 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; | |
| 323 | 323 | expect(ownBody.here.pull).toEqual({ number: own.value.number, runs: true }); |
| 324 | 324 | }); |
| 325 | 325 | }); |
test/holds.test.ts +1 −1
| @@ -678,7 +678,7 @@ describe("a hold is set, shown and lifted", () => { | ||
| 678 | 678 | |
| 679 | 679 | test("the change page offers the hold, then says who holds it and why, with the way to let it go", async () => { |
| 680 | 680 | const cookie = await signIn("alice"); |
| 681 | const change = `/alice/garden/changes/${pull.number}`; | |
| 681 | const change = `/alice/garden/pulls/${pull.number}`; | |
| 682 | 682 | const before = await page(change, cookie); |
| 683 | 683 | expect(before).toContain("Hold this change"); |
| 684 | 684 | expect(before).toContain( |
test/home-feed.test.ts +1 −1
| @@ -134,7 +134,7 @@ describe("home is the feed", () => { | ||
| 134 | 134 | // carries what was said. |
| 135 | 135 | expect(text).toContain("Water the tomatoes at dawn"); |
| 136 | 136 | 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</, | |
| 138 | 138 | ); |
| 139 | 139 | // A reply names the tell it answers. |
| 140 | 140 | 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 | ||
| 75 | 75 | }); |
| 76 | 76 | expect(posted.status).toBe(303); |
| 77 | 77 | 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</, | |
| 79 | 79 | ); |
| 80 | 80 | |
| 81 | 81 | // 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 | ||
| 94 | 94 | const page = await home(alice); |
| 95 | 95 | expect(page).toContain("Sorted the seed list"); |
| 96 | 96 | 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"); | |
| 98 | 98 | |
| 99 | 99 | // A share reaches another person as a post that says who shared it. |
| 100 | 100 | 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", () => { | ||
| 117 | 117 | |
| 118 | 118 | const list = await (await fetch(`${base}/mel/proj/issues`)).text(); |
| 119 | 119 | expect(list).toContain("First bug"); |
| 120 | expect(list).toContain('href="/mel/proj/tells/1"'); | |
| 120 | expect(list).toContain('href="/mel/proj/issues/1"'); | |
| 121 | 121 | |
| 122 | 122 | const detail = await (await fetch(`${base}/mel/proj/issues/1`)).text(); |
| 123 | 123 | 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", () => { | ||
| 266 | 266 | app: "alice/garden", |
| 267 | 267 | actor, |
| 268 | 268 | at: new Date().toISOString(), |
| 269 | link: `/alice/garden/changes/${pull.number}`, | |
| 269 | link: `/alice/garden/pulls/${pull.number}`, | |
| 270 | 270 | what: "Beds", |
| 271 | 271 | reason: "", |
| 272 | 272 | 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 | ||
| 156 | 156 | |
| 157 | 157 | test("the change page the owner lands on draws the same live line, with the counts", async () => { |
| 158 | 158 | 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"]}`, { | |
| 160 | 160 | headers: { cookie: `forge_session=${createSession(app.db, alice.id).token}` }, |
| 161 | 161 | }); |
| 162 | 162 | expect(res.status).toBe(200); |
test/sealed-issues.test.ts +2 −2
| @@ -118,9 +118,9 @@ const SINGLES = (n: number, p: number) => [ | ||
| 118 | 118 | `/api/v1/repos/alice/square/runs/${runId}`, |
| 119 | 119 | `/api/v1/repos/alice/square/runs/${runId}/log`, |
| 120 | 120 | `/alice/square/issues/${n}`, |
| 121 | `/alice/square/tells/${n}`, | |
| 121 | `/alice/square/issues/${n}`, | |
| 122 | `/alice/square/pulls/${p}`, | |
| 122 | 123 | `/alice/square/pulls/${p}`, |
| 123 | `/alice/square/changes/${p}`, | |
| 124 | 124 | `/alice/square/runs/${runId}`, |
| 125 | 125 | ]; |
| 126 | 126 |
test/studio-changes.test.ts +47 −47
| @@ -371,7 +371,7 @@ describe("the studio, continued", () => { | ||
| 371 | 371 | expect(issues).not.toContain(`href="/alice/plainlists/issues?word=told"`); |
| 372 | 372 | expect(issues).not.toContain(`href="/alice/plainlists/issues?word=look"`); |
| 373 | 373 | expect(issues).toContain( |
| 374 | `href="/alice/plainlists/tells/${told.value.number}"`, | |
| 374 | `href="/alice/plainlists/issues/${told.value.number}"`, | |
| 375 | 375 | ); |
| 376 | 376 | expect(issues).not.toContain("See dev's list"); |
| 377 | 377 | |
| @@ -388,26 +388,26 @@ describe("the studio, continued", () => { | ||
| 388 | 388 | expect(runs).not.toContain("See dev's list"); |
| 389 | 389 | }); |
| 390 | 390 | |
| 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 () => { | |
| 392 | 392 | const told = openIssue(app, alice, repo, { |
| 393 | 393 | title: "Door test: a tell", |
| 394 | body: "reached through /tells too", | |
| 394 | body: "reached through /issues too", | |
| 395 | 395 | }); |
| 396 | 396 | if (!told.ok) throw new Error(String(told.error)); |
| 397 | 397 | |
| 398 | 398 | 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(); | |
| 400 | 400 | expect(viaTells).toContain("Door test: a tell"); |
| 401 | 401 | expect(viaTells).toContain('data-word="told"'); |
| 402 | 402 | // Self-links (the word filter, paging) follow whichever door was used, |
| 403 | 403 | // so a dev URL asked for in studio mode still answers exactly as it |
| 404 | 404 | // does today. |
| 405 | expect(viaTells).toContain(`href="/alice/notes/tells?word=told"`); | |
| 405 | expect(viaTells).toContain(`href="/alice/notes/issues?word=told"`); | |
| 406 | 406 | expect(viaIssues).toContain(`href="/alice/notes/issues?word=told"`); |
| 407 | 407 | |
| 408 | const filtered = await (await get("/alice/notes/tells?word=told")).text(); | |
| 408 | const filtered = await (await get("/alice/notes/issues?word=told")).text(); | |
| 409 | 409 | 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(); | |
| 411 | 411 | expect(other).not.toContain("Door test: a tell"); |
| 412 | 412 | |
| 413 | 413 | const branch = await commitToBranch(app, alice, repo, { |
| @@ -437,18 +437,18 @@ describe("the studio, continued", () => { | ||
| 437 | 437 | finishRun(app.db, doorCheck.id, { state: "ok", summary: "check passed" }); |
| 438 | 438 | |
| 439 | 439 | 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(); | |
| 441 | 441 | expect(viaChanges).toContain("Door test: a change"); |
| 442 | 442 | 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"`); | |
| 444 | 444 | expect(viaPulls).toContain(`href="/alice/notes/pulls?word=look"`); |
| 445 | 445 | |
| 446 | 446 | const changeFiltered = await ( |
| 447 | await get("/alice/notes/changes?word=look") | |
| 447 | await get("/alice/notes/pulls?word=look") | |
| 448 | 448 | ).text(); |
| 449 | 449 | expect(changeFiltered).toContain("Door test: a change"); |
| 450 | 450 | const changeOther = await ( |
| 451 | await get("/alice/notes/changes?word=shipped") | |
| 451 | await get("/alice/notes/pulls?word=shipped") | |
| 452 | 452 | ).text(); |
| 453 | 453 | expect(changeOther).not.toContain("Door test: a change"); |
| 454 | 454 | // A green pull left open now asks the front door too (#208) — close it |
| @@ -456,7 +456,7 @@ describe("the studio, continued", () => { | ||
| 456 | 456 | expect(setIssueState(app, alice, repo, doorPull, "closed").ok).toBe(true); |
| 457 | 457 | }); |
| 458 | 458 | |
| 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 () => { | |
| 460 | 460 | const plain = await createRepo(app, alice, { |
| 461 | 461 | name: "doorlists", |
| 462 | 462 | visibility: "private", |
| @@ -465,11 +465,11 @@ describe("the studio, continued", () => { | ||
| 465 | 465 | if (!plain.ok) throw new Error(String(plain.error)); |
| 466 | 466 | |
| 467 | 467 | 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], | |
| 473 | 473 | ] as const) { |
| 474 | 474 | const res = await get(path, { cookie: viewer }); |
| 475 | 475 | expect(res.status).toBe(200); |
| @@ -650,29 +650,29 @@ describe("the studio, continued", () => { | ||
| 650 | 650 | expect(pulls).not.toContain('href="/alice/composelists/pulls/new"'); |
| 651 | 651 | }); |
| 652 | 652 | |
| 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`, { | |
| 655 | 655 | headers: { cookie: "forge_mode=studio" }, |
| 656 | 656 | redirect: "manual", |
| 657 | 657 | }); |
| 658 | 658 | expect(anonTells.status).toBe(404); |
| 659 | 659 | |
| 660 | const anonChanges = await fetch(`${base}/alice/notes/changes`, { | |
| 660 | const anonChanges = await fetch(`${base}/alice/notes/pulls`, { | |
| 661 | 661 | headers: { cookie: "forge_mode=studio" }, |
| 662 | 662 | redirect: "manual", |
| 663 | 663 | }); |
| 664 | 664 | expect(anonChanges.status).toBe(404); |
| 665 | 665 | }); |
| 666 | 666 | |
| 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 () => { | |
| 668 | 668 | const told = openIssue(app, alice, repo, { |
| 669 | 669 | title: "Door test: one tell", |
| 670 | body: "reached through /tells/:number too", | |
| 670 | body: "reached through /issues/:number too", | |
| 671 | 671 | }); |
| 672 | 672 | if (!told.ok) throw new Error(String(told.error)); |
| 673 | 673 | const n = told.value.number; |
| 674 | 674 | |
| 675 | const viaTell = await get(`/alice/notes/tells/${n}`); | |
| 675 | const viaTell = await get(`/alice/notes/issues/${n}`); | |
| 676 | 676 | expect(viaTell.status).toBe(200); |
| 677 | 677 | const tellHtml = await viaTell.text(); |
| 678 | 678 | const viaIssue = await (await get(`/alice/notes/issues/${n}`)).text(); |
| @@ -706,7 +706,7 @@ describe("the studio, continued", () => { | ||
| 706 | 706 | if (!opened.ok) throw new Error(String(opened.error)); |
| 707 | 707 | const p = opened.value.number; |
| 708 | 708 | |
| 709 | const viaChange = await get(`/alice/notes/changes/${p}`); | |
| 709 | const viaChange = await get(`/alice/notes/pulls/${p}`); | |
| 710 | 710 | expect(viaChange.status).toBe(200); |
| 711 | 711 | const changeHtml = await viaChange.text(); |
| 712 | 712 | expect(changeHtml).toContain("Door test: one change"); |
| @@ -725,30 +725,30 @@ describe("the studio, continued", () => { | ||
| 725 | 725 | |
| 726 | 726 | // The three lists, the app page and the search box all hand out the |
| 727 | 727 | // 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}"`); | |
| 732 | 732 | 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}"`); | |
| 734 | 734 | 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}`); | |
| 737 | 737 | // The palette's remote rows are folded in the browser; the index tells |
| 738 | 738 | // the script which mode it is in, so it folds the same nouns. |
| 739 | 739 | expect(appPage).toContain('"studio":true'); |
| 740 | 740 | }); |
| 741 | 741 | |
| 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 () => { | |
| 743 | 743 | const told = openIssue(app, alice, repo, { title: "Door test: dev's way" }); |
| 744 | 744 | if (!told.ok) throw new Error(String(told.error)); |
| 745 | 745 | const n = told.value.number; |
| 746 | 746 | |
| 747 | 747 | for (const res of [ |
| 748 | await get(`/alice/notes/tells/${n}`, { | |
| 748 | await get(`/alice/notes/issues/${n}`, { | |
| 749 | 749 | cookie: `${cookie}; forge_mode=dev`, |
| 750 | 750 | }), |
| 751 | await get(`/alice/notes/tells/${n}`), | |
| 751 | await get(`/alice/notes/issues/${n}`), | |
| 752 | 752 | ]) { |
| 753 | 753 | expect(res.status).toBe(200); |
| 754 | 754 | expect(await res.text()).toContain("Door test: dev"); |
| @@ -765,18 +765,18 @@ describe("the studio, continued", () => { | ||
| 765 | 765 | }); |
| 766 | 766 | if (!plainTold.ok) throw new Error(String(plainTold.error)); |
| 767 | 767 | const plainTell = await get( |
| 768 | `/alice/doorpages/tells/${plainTold.value.number}`, | |
| 768 | `/alice/doorpages/issues/${plainTold.value.number}`, | |
| 769 | 769 | ); |
| 770 | 770 | expect(plainTell.status).toBe(200); |
| 771 | 771 | expect(await plainTell.text()).toContain("Not an app"); |
| 772 | 772 | }); |
| 773 | 773 | |
| 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 () => { | |
| 775 | 775 | const told = openIssue(app, alice, repo, { title: "Door test: private" }); |
| 776 | 776 | if (!told.ok) throw new Error(String(told.error)); |
| 777 | 777 | const n = told.value.number; |
| 778 | 778 | |
| 779 | const anonTell = await fetch(`${base}/alice/notes/tells/${n}`, { | |
| 779 | const anonTell = await fetch(`${base}/alice/notes/issues/${n}`, { | |
| 780 | 780 | headers: { cookie: "forge_mode=studio" }, |
| 781 | 781 | redirect: "manual", |
| 782 | 782 | }); |
| @@ -789,9 +789,9 @@ describe("the studio, continued", () => { | ||
| 789 | 789 | |
| 790 | 790 | // A number that is not a tell is not a tell at either address, and a |
| 791 | 791 | // 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"); | |
| 793 | 793 | 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`, { | |
| 795 | 795 | headers: { cookie: "forge_mode=studio" }, |
| 796 | 796 | redirect: "manual", |
| 797 | 797 | }); |
| @@ -1313,26 +1313,26 @@ describe("the studio, continued", () => { | ||
| 1313 | 1313 | const stray = await open("scout/99999-nothing", "Answers nothing"); |
| 1314 | 1314 | const own = await open("revert-22", "A person's branch"); |
| 1315 | 1315 | |
| 1316 | const list = await (await get("/alice/notes/changes")).text(); | |
| 1316 | const list = await (await get("/alice/notes/pulls")).text(); | |
| 1317 | 1317 | const rowOf = (title: string) => { |
| 1318 | 1318 | const at = list.indexOf(title); |
| 1319 | 1319 | return list.slice(at, list.indexOf("</a>", at + 400) + 4); |
| 1320 | 1320 | }; |
| 1321 | expect(rowOf("Answers the tell")).toContain(`href="/alice/notes/tells/${n}"`); | |
| 1321 | expect(rowOf("Answers the tell")).toContain(`href="/alice/notes/issues/${n}"`); | |
| 1322 | 1322 | expect(rowOf("Answers the tell")).not.toContain("already done"); |
| 1323 | 1323 | expect(rowOf("Answers nothing")).not.toContain("for tell"); |
| 1324 | 1324 | expect(rowOf("A person's branch")).not.toContain("for tell"); |
| 1325 | 1325 | |
| 1326 | 1326 | 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"); | |
| 1329 | 1329 | const page = await ( |
| 1330 | await get(`/alice/notes/changes/${answering.number}`) | |
| 1330 | await get(`/alice/notes/pulls/${answering.number}`) | |
| 1331 | 1331 | ).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"); | |
| 1334 | 1334 | 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}`); | |
| 1336 | 1336 | expect(res.status).toBe(200); |
| 1337 | 1337 | expect(await res.text()).not.toContain("for tell"); |
| 1338 | 1338 | } |
test/studio-door.test.ts +1 −1
| @@ -492,7 +492,7 @@ describe("every open pull's preview on the studio page", () => { | ||
| 492 | 492 | expect(production).not.toContain(note); |
| 493 | 493 | |
| 494 | 494 | const changePage = await ( |
| 495 | await get(`/alice/widget/changes/${pull.number}`) | |
| 495 | await get(`/alice/widget/pulls/${pull.number}`) | |
| 496 | 496 | ).text(); |
| 497 | 497 | expect(changePage).toContain("<h2>Preview</h2>"); |
| 498 | 498 | 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", () => { | ||
| 510 | 510 | ).text(); |
| 511 | 511 | expect(page).toContain("Fix the flicker on load"); |
| 512 | 512 | // 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}"`); | |
| 514 | 514 | expect(page).toContain("$0.42 spent"); |
| 515 | 515 | expect(page).toContain('data-word="working"'); |
| 516 | 516 | // 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", () => { | ||
| 176 | 176 | test("a change and a tell are found too, each saying which app they belong to", async () => { |
| 177 | 177 | const html = await (await asAlice("/search?q=chess")).text(); |
| 178 | 178 | expect(html).toContain("Add a chess clock timer"); |
| 179 | expect(html).toContain(`/alice/widgets/tells/${tellNumber}`); | |
| 179 | expect(html).toContain(`/alice/widgets/issues/${tellNumber}`); | |
| 180 | 180 | expect(html).toContain("Wire up the chess clock"); |
| 181 | expect(html).toContain(`/alice/widgets/changes/${changeNumber}`); | |
| 181 | expect(html).toContain(`/alice/widgets/pulls/${changeNumber}`); | |
| 182 | 182 | expect(html).toContain("alice/widgets"); |
| 183 | 183 | }); |
| 184 | 184 | |
| @@ -210,8 +210,8 @@ describe("finding things in the studio: /search", () => { | ||
| 210 | 210 | ).text(), |
| 211 | 211 | ]) { |
| 212 | 212 | 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}`); | |
| 215 | 215 | expect(mainOf(html)).not.toContain('name="mode"'); |
| 216 | 216 | } |
| 217 | 217 | }); |
| @@ -604,8 +604,8 @@ describe("every studio page's headings form one outline", () => { | ||
| 604 | 604 | test("the app page, the three lists, a tell, a change and a run each have one outline with no skipped level", async () => { |
| 605 | 605 | const pages: Record<string, string> = { |
| 606 | 606 | "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", | |
| 609 | 609 | "every run": "/alice/outline/runs", |
| 610 | 610 | "a tell": `/alice/outline/issues/${issueNumber}`, |
| 611 | 611 | "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 | ||
| 812 | 812 | const stopped = await press( |
| 813 | 813 | "stop", |
| 814 | 814 | "studio", |
| 815 | `${base}/alice/notes/changes/1`, | |
| 815 | `${base}/alice/notes/pulls/1`, | |
| 816 | 816 | ); |
| 817 | 817 | 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"); | |
| 819 | 819 | }); |
| 820 | 820 | |
| 821 | 821 | 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 | ||
| 1104 | 1104 | |
| 1105 | 1105 | test("an anonymous visitor reads one author for one change on all three pages, avatar included", async () => { |
| 1106 | 1106 | 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}`); | |
| 1109 | 1109 | |
| 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}`); | |
| 1112 | 1112 | expect(onApp).toContain("ivy"); |
| 1113 | 1113 | expect(onApp).not.toContain("the crew"); |
| 1114 | 1114 | // 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 | ||
| 1117 | 1117 | expect(change).toContain("ivy"); |
| 1118 | 1118 | |
| 1119 | 1119 | // 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}`); | |
| 1121 | 1121 | expect(held).toContain("ivy"); |
| 1122 | 1122 | expect(held).not.toContain("the crew"); |
| 1123 | 1123 | 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 | ||
| 1125 | 1125 | |
| 1126 | 1126 | test("the crew's own change and the crew's own run still read as the crew's to that visitor", async () => { |
| 1127 | 1127 | const appPage = await anon("/ivy/pub"); |
| 1128 | const onApp = rowWith(appPage, `/changes/${agentPull.number}`); | |
| 1128 | const onApp = rowWith(appPage, `/pulls/${agentPull.number}`); | |
| 1129 | 1129 | expect(onApp).toContain("the crew"); |
| 1130 | 1130 | expect(onApp).not.toContain("quill"); |
| 1131 | 1131 | 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 | ||
| 1134 | 1134 | expect(runRow).toContain("the crew"); |
| 1135 | 1135 | expect(runRow).not.toContain("quill"); |
| 1136 | 1136 | |
| 1137 | const tellRow = rowWith(appPage, `/tells/${waitingTell.number}`); | |
| 1137 | const tellRow = rowWith(appPage, `/issues/${waitingTell.number}`); | |
| 1138 | 1138 | expect(tellRow).toContain("the crew"); |
| 1139 | 1139 | expect(tellRow).not.toContain("quill"); |
| 1140 | 1140 | |
| @@ -1146,9 +1146,9 @@ describe("the studio names a person on the app's page, and the crew only for the | ||
| 1146 | 1146 | |
| 1147 | 1147 | test("the owner still reads the crew by name, and her own change as her own", async () => { |
| 1148 | 1148 | const appPage = await owner("/ivy/pub"); |
| 1149 | expect(rowWith(appPage, `/changes/${agentPull.number}`)).toContain("quill"); | |
| 1149 | expect(rowWith(appPage, `/pulls/${agentPull.number}`)).toContain("quill"); | |
| 1150 | 1150 | 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"); | |
| 1152 | 1152 | }); |
| 1153 | 1153 | }); |
| 1154 | 1154 | |
| @@ -1226,7 +1226,7 @@ describe("the studio's empty lists", () => { | ||
| 1226 | 1226 | await setup("blank"); |
| 1227 | 1227 | for (const [path, words] of [ |
| 1228 | 1228 | ["issues", "Tell the crew what you want"], |
| 1229 | ["pulls", "A change is the crew"], | |
| 1229 | ["pulls", "A pull request is the crew"], | |
| 1230 | 1230 | ["runs", "A run is one go"], |
| 1231 | 1231 | ] as const) { |
| 1232 | 1232 | const page = await get(`/alice/blank/${path}`); |
| @@ -1241,10 +1241,10 @@ describe("the studio's empty lists", () => { | ||
| 1241 | 1241 | const told = openIssue(app, alice, repo, { title: "Add a tab", body: "" }); |
| 1242 | 1242 | if (!told.ok) throw new Error(String(told.error)); |
| 1243 | 1243 | 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."); | |
| 1245 | 1245 | expect(issues).not.toContain("Tell the crew what you want"); |
| 1246 | 1246 | 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."); | |
| 1248 | 1248 | const runs = await get("/alice/busy/runs?word=stopped"); |
| 1249 | 1249 | expect(runs).toContain("No run is stopped yet."); |
| 1250 | 1250 | }); |
test/studio-words.test.ts +14 −21
| @@ -88,10 +88,6 @@ const DEV_WORDS: readonly { pattern: RegExp; because: string }[] = [ | ||
| 88 | 88 | pattern: /\bmerge\b/i, |
| 89 | 89 | because: "the studio's own word for a merge is shipped", |
| 90 | 90 | }, |
| 91 | { | |
| 92 | pattern: /pull request/i, | |
| 93 | because: "the studio's own word for a pull is change", | |
| 94 | }, | |
| 95 | 91 | { |
| 96 | 92 | // Bare "issue" also rides the topbar's own live-event wiring |
| 97 | 93 | // (`data-live="run.*,pull.*,issue.*,check.*"`) on every page, which is |
| @@ -521,7 +517,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 521 | 517 | word: "app", |
| 522 | 518 | path: repoPath, |
| 523 | 519 | title: "vocab", |
| 524 | shows: [`href="#i-pull"/></svg>Changes`], | |
| 520 | shows: [`href="#i-pull"/></svg>Pulls`], | |
| 525 | 521 | hides: [`href="#i-eye"/></svg>Look`, `>Look<`, 'class="where"'], |
| 526 | 522 | // #630: the app page is the home in every mode; its code, with dev's |
| 527 | 523 | // where strip, is the Files step one tab over. |
| @@ -542,7 +538,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 542 | 538 | // `/pulls/:number`), which the row above already proves. |
| 543 | 539 | { |
| 544 | 540 | word: "tell (the studio's noun)", |
| 545 | path: `${repoPath}/tells/${tellNumber}`, | |
| 541 | path: `${repoPath}/issues/${tellNumber}`, | |
| 546 | 542 | shows: [tellTitle, "Close tell"], |
| 547 | 543 | title: `${tellTitle} · vocab`, |
| 548 | 544 | }, |
| @@ -564,7 +560,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 564 | 560 | }, |
| 565 | 561 | { |
| 566 | 562 | word: "look (the studio's noun)", |
| 567 | path: `${repoPath}/changes/${openPullNumber}`, | |
| 563 | path: `${repoPath}/pulls/${openPullNumber}`, | |
| 568 | 564 | shows: [openPullTitle, "Close change"], |
| 569 | 565 | title: `${openPullTitle} · vocab`, |
| 570 | 566 | }, |
| @@ -581,8 +577,8 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 581 | 577 | shows: [ |
| 582 | 578 | tellTitle, |
| 583 | 579 | untouchedTitle, |
| 584 | `href="${repoPath}/tells/${tellNumber}"`, | |
| 585 | `href="${repoPath}/tells/${untouchedNumber}"`, | |
| 580 | `href="${repoPath}/issues/${tellNumber}"`, | |
| 581 | `href="${repoPath}/issues/${untouchedNumber}"`, | |
| 586 | 582 | ], |
| 587 | 583 | hides: [ |
| 588 | 584 | `href="${repoPath}/issues/${tellNumber}"`, |
| @@ -623,7 +619,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 623 | 619 | }, |
| 624 | 620 | { |
| 625 | 621 | word: "tells (the studio's noun)", |
| 626 | path: `${repoPath}/tells`, | |
| 622 | path: `${repoPath}/issues`, | |
| 627 | 623 | shows: [untouchedTitle, tellTitle], |
| 628 | 624 | title: "Everything told · vocab", |
| 629 | 625 | }, |
| @@ -632,7 +628,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 632 | 628 | // own address alike — the tab, the heading and the button all say |
| 633 | 629 | // the studio's word, and the form still posts where it always has. |
| 634 | 630 | word: "tell the crew (the studio's noun)", |
| 635 | path: `${repoPath}/tells/new`, | |
| 631 | path: `${repoPath}/issues/new`, | |
| 636 | 632 | shows: [`action="${repoPath}/issues/new"`, "<h1 class=\"mt\">Tell the crew</h1>"], |
| 637 | 633 | title: "Tell the crew · vocab", |
| 638 | 634 | }, |
| @@ -646,7 +642,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 646 | 642 | }, |
| 647 | 643 | { |
| 648 | 644 | word: "changes (the studio's noun)", |
| 649 | path: `${repoPath}/changes`, | |
| 645 | path: `${repoPath}/pulls`, | |
| 650 | 646 | shows: [openPullTitle, secondChangeTitle], |
| 651 | 647 | title: "Every change · vocab", |
| 652 | 648 | }, |
| @@ -678,7 +674,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 678 | 674 | // The stopped run is not open and moving, so the bare list leaves it |
| 679 | 675 | // out — the filter below is where it shows up. |
| 680 | 676 | hides: [`href="${repoPath}/runs/${stoppedRunId}"`], |
| 681 | title: "Every run · vocab", | |
| 677 | title: "Runs · vocab", | |
| 682 | 678 | }, |
| 683 | 679 | { |
| 684 | 680 | word: "runs (stopped)", |
| @@ -806,8 +802,6 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 806 | 802 | "alice/vocab — Code", |
| 807 | 803 | "alice/vocab — Commits", |
| 808 | 804 | "alice/vocab — New issue", |
| 809 | "alice/vocab — Issues", | |
| 810 | "alice/vocab — Pull requests", | |
| 811 | 805 | ]) { |
| 812 | 806 | expect(rows.has(t), `palette still offers "${t}" on a studio app page`).toBe( |
| 813 | 807 | false, |
| @@ -816,8 +810,8 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 816 | 810 | |
| 817 | 811 | // The studio's own nouns, at the studio's own addresses. |
| 818 | 812 | 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`); | |
| 821 | 815 | // The studio's first verb — telling the crew — reachable from the |
| 822 | 816 | // palette, landing on the app page where the tell box lives. |
| 823 | 817 | expect(rows.get("alice/vocab — Tell the crew")).toBe(`${repoPath}#tell`); |
| @@ -846,7 +840,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 846 | 840 | ["/alice/plain/issues", "Issues · plain"], |
| 847 | 841 | ["/alice/plain/issues/new", "New issue · plain"], |
| 848 | 842 | ["/alice/plain/pulls", "Pull requests · plain"], |
| 849 | ["/alice/plain/runs", "Every run · plain"], | |
| 843 | ["/alice/plain/runs", "Runs · plain"], | |
| 850 | 844 | ]); |
| 851 | 845 | for (const [path, title] of titles) { |
| 852 | 846 | const res = await fetch(`${base}${path}`, { |
| @@ -856,13 +850,12 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 856 | 850 | expect(res.status, path).toBe(200); |
| 857 | 851 | expect(titleOf(await res.text()), path).toBe(title); |
| 858 | 852 | } |
| 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. | |
| 861 | 854 | const door = await fetch(`${base}/alice/plain/tells/new`, { |
| 862 | 855 | headers: { cookie: `${cookie}; forge_mode=studio` }, |
| 863 | 856 | redirect: "manual", |
| 864 | 857 | }); |
| 865 | expect(door.status).toBe(303); | |
| 858 | expect(door.status).toBe(301); | |
| 866 | 859 | expect(door.headers.get("location")).toBe("/alice/plain/issues/new"); |
| 867 | 860 | }); |
| 868 | 861 |
test/studio.test.ts +3 −3
| @@ -158,7 +158,7 @@ describe("the studio", () => { | ||
| 158 | 158 | // The depth row on every repository's header: Files (or Code), Changes |
| 159 | 159 | // (or Pulls) and Runs; Terminal only where SSH is on, which it is not here. |
| 160 | 160 | expect(withDev).toContain('href="/alice/notes/files"'); |
| 161 | expect(withDev).toContain('href="/alice/notes/changes"'); | |
| 161 | expect(withDev).toContain('href="/alice/notes/pulls"'); | |
| 162 | 162 | expect(withDev).toContain('href="/alice/notes/runs"'); |
| 163 | 163 | expect(withDev).not.toContain('href="/settings/keys#terminal"'); |
| 164 | 164 | // The toggle's POST is gone with it. |
| @@ -391,7 +391,7 @@ describe("the studio", () => { | ||
| 391 | 391 | ); |
| 392 | 392 | expect(lost.status).toBe(303); |
| 393 | 393 | expect(lost.headers.get("location")).toBe( |
| 394 | `/alice/notes/changes/${evil.number}`, | |
| 394 | `/alice/notes/pulls/${evil.number}`, | |
| 395 | 395 | ); |
| 396 | 396 | }); |
| 397 | 397 | |
| @@ -1076,7 +1076,7 @@ describe("the studio", () => { | ||
| 1076 | 1076 | expect(studio).toContain("Ground work"); |
| 1077 | 1077 | // What it waits on, in the studio's own noun (#158). |
| 1078 | 1078 | expect(studio).toContain( |
| 1079 | `href="/alice/notes/tells/${blocker.value.number}"`, | |
| 1079 | `href="/alice/notes/issues/${blocker.value.number}"`, | |
| 1080 | 1080 | ); |
| 1081 | 1081 | expect(studio).toContain('data-word="working"'); |
| 1082 | 1082 | expect(studio).toContain("$0.12"); |
test/tui-tell.test.ts +1 −1
| @@ -120,7 +120,7 @@ describe("tell the crew in the terminal", () => { | ||
| 120 | 120 | } as unknown as Told; |
| 121 | 121 | const answer = tellAnswer({ ok: true, value }); |
| 122 | 122 | 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."); | |
| 124 | 124 | expect(answer.text).not.toContain("is on it"); |
| 125 | 125 | expect(answer.tone).toBe("danger"); |
| 126 | 126 | }); |
test/unfurl.test.ts +7 −7
| @@ -166,13 +166,13 @@ describe("the pages", () => { | ||
| 166 | 166 | }); |
| 167 | 167 | |
| 168 | 168 | 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}`)); | |
| 170 | 170 | expect(line).toContain("Say hello from open."); |
| 171 | 171 | expect(line).not.toContain("Second line"); |
| 172 | 172 | }); |
| 173 | 173 | |
| 174 | 174 | 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}`)); | |
| 176 | 176 | expect(line).toContain("Make open better."); |
| 177 | 177 | }); |
| 178 | 178 | |
| @@ -192,8 +192,8 @@ describe("the pages", () => { | ||
| 192 | 192 | |
| 193 | 193 | test("no sentence uses dev's vocabulary", async () => { |
| 194 | 194 | 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}`, | |
| 197 | 197 | `/alice/open/runs/${ids.run}`, |
| 198 | 198 | ]) |
| 199 | 199 | expect(unfurl(await get(path))).not.toMatch( |
| @@ -203,8 +203,8 @@ describe("the pages", () => { | ||
| 203 | 203 | |
| 204 | 204 | test("a private tell, change, run and app say 'Private.' and no more", async () => { |
| 205 | 205 | 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}`, | |
| 208 | 208 | `/alice/hush/runs/${ids.hushRun}`, |
| 209 | 209 | "/alice/hush/app", |
| 210 | 210 | ]) { |
| @@ -215,7 +215,7 @@ describe("the pages", () => { | ||
| 215 | 215 | }); |
| 216 | 216 | |
| 217 | 217 | 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}`); | |
| 219 | 219 | expect(res.status).toBe(404); |
| 220 | 220 | }); |
| 221 | 221 | }); |
test/web-code.test.ts +2 −2
| @@ -446,7 +446,7 @@ describe("the code browser on the web", () => { | ||
| 446 | 446 | }); |
| 447 | 447 | expect(repo).toBeDefined(); |
| 448 | 448 | 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"'); | |
| 450 | 450 | expect(html).toContain("data-word="); |
| 451 | 451 | expect(await text("/alice/beacon/issues/1", alice)).toContain( |
| 452 | 452 | "still flickering", |
| @@ -458,7 +458,7 @@ describe("the code browser on the web", () => { | ||
| 458 | 458 | test("the search page renders repositories, conversations and code", async () => { |
| 459 | 459 | const html = await text("/search?q=lamp", alice); |
| 460 | 460 | expect(html).toContain("Apps and repositories"); |
| 461 | expect(html).toContain("Tells and changes"); | |
| 461 | expect(html).toContain("Issues and pull requests"); | |
| 462 | 462 | expect(html).toContain(">Code"); |
| 463 | 463 | // A code hit says where it is and shows the line with the query marked. |
| 464 | 464 | 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", () => { | ||
| 772 | 772 | test("the pull list shows each pull in its word; where it stands on review is one step deeper, on the change", async () => { |
| 773 | 773 | // One list (#627): a row is the pull's word, never a review badge. |
| 774 | 774 | 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}"`); | |
| 776 | 776 | expect(list).toContain("data-word="); |
| 777 | 777 | expect(words(list)).not.toContain("Needs review"); |
| 778 | 778 |
new above
offline