Public: anyone can read this; the crew can change it.
Full suite red: 5 files in check run 01m7p06fjkbtqakhhjbhqkzg94 #14351
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14313-full-suite-red-5-files-in-check-run-01m7 → main 3 commits fork 1 thread · 1 unresolved
3 files
changed +15
−7
src/web/scope.ts +9 −5
| @@ -344,7 +344,7 @@ interface Place { | ||
| 344 | 344 | const PIN_FORM = "where-pin"; |
| 345 | 345 | |
| 346 | 346 | /** The three places, in order, for whichever situation this scope is in. */ |
| 347 | function placesFor(ctx: Ctx, scope: RepoScope): Place[] { | |
| 347 | function placesFor(ctx: Ctx, scope: RepoScope, knownPinned?: boolean): Place[] { | |
| 348 | 348 | const places: Place[] = []; |
| 349 | 349 | const user = ctx.auth.user; |
| 350 | 350 | |
| @@ -415,7 +415,7 @@ function placesFor(ctx: Ctx, scope: RepoScope): Place[] { | ||
| 415 | 415 | const pinned = |
| 416 | 416 | repo !== undefined && |
| 417 | 417 | user !== undefined && |
| 418 | isPinned(ctx.app.db, user.id, repo.id); | |
| 418 | (knownPinned ?? isPinned(ctx.app.db, user.id, repo.id)); | |
| 419 | 419 | if (repo !== undefined && user !== undefined) { |
| 420 | 420 | places.push({ |
| 421 | 421 | label: "this machine", |
| @@ -470,8 +470,12 @@ function placeNode(place: Place): Html { | ||
| 470 | 470 | * the product, so where you are reading from is never a thing you work out |
| 471 | 471 | * from context. |
| 472 | 472 | */ |
| 473 | export function whereStrip(ctx: Ctx, scope: RepoScope): Html { | |
| 474 | const places = placesFor(ctx, scope); | |
| 473 | export function whereStrip( | |
| 474 | ctx: Ctx, | |
| 475 | scope: RepoScope, | |
| 476 | knownPinned?: boolean, | |
| 477 | ): Html { | |
| 478 | const places = placesFor(ctx, scope, knownPinned); | |
| 475 | 479 | return html`<div |
| 476 | 480 | class="where" |
| 477 | 481 | aria-label="Where this repository is read from" |
| @@ -496,7 +500,7 @@ export function whereRow(ctx: Ctx, scope: RepoScope): Html { | ||
| 496 | 500 | const canPin = repo !== undefined && user !== undefined; |
| 497 | 501 | const pinned = canPin && isPinned(ctx.app.db, user.id, repo.id); |
| 498 | 502 | return html`<div class="repo-where"> |
| 499 | ${whereStrip(ctx, scope)} | |
| 503 | ${whereStrip(ctx, scope, canPin ? pinned : undefined)} | |
| 500 | 504 | <span class="spacer"></span> |
| 501 | 505 | ${when( |
| 502 | 506 | canPin, |
test/did-you-mean.test.ts +4 −1
| @@ -21,7 +21,10 @@ let servers: Awaited<ReturnType<typeof serve>>; | ||
| 21 | 21 | // wallet line (#13309). |
| 22 | 22 | const FOUND_QUERIES = 41; |
| 23 | 23 | const BARE_404_QUERIES = 3; // a 404 with no owner/name to suggest from |
| 24 | const NEAR_404_QUERIES = 16; // the same 404 for a mistyped repository | |
| 24 | // The same 404 for a mistyped repository. One of the 17 is the noindex lookup that | |
| 25 | // answerGet makes for every /:owner/:name route before its handler runs (1e71740ab, #14305, | |
| 26 | // src/http/archived_noindex.ts); on a missing repository it finds nothing. | |
| 27 | const NEAR_404_QUERIES = 17; | |
| 25 | 28 | const cookies: Record<string, string> = {}; |
| 26 | 29 | |
| 27 | 30 | beforeAll(async () => { |
test/not-found-search.test.ts +2 −1
| @@ -40,7 +40,8 @@ test("/owner/name offers a search for name; the 404 says once that a private app | ||
| 40 | 40 | expect(body).toContain('name="q" aria-label="Search this forge" placeholder="Search this forge" value="nothing"'); |
| 41 | 41 | expect(body).not.toContain("Search for nothing"); |
| 42 | 42 | expect(body).not.toContain("A private app looks the same"); |
| 43 | expect(body.match(/not visible to you/g)?.length).toBe(1); | |
| 43 | // The share head repeats the description in meta tags; the visible page says it once. | |
| 44 | expect(body.replace(/<head>[\s\S]*?<\/head>/, "").match(/not visible to you/g)?.length).toBe(1); | |
| 44 | 45 | expect(body).toContain("Sign in"); |
| 45 | 46 | }); |
| 46 | 47 |
new above
offline
Do not raise this pin without finding the cause. A mistyped-repo 404 now costs one more query and nobody knows why: this may be a regression the pin was built to catch. Bisect it (git log -S on the 404 path) and fix it, or name the commit that added it and justify it. Also remove the "was 16 ... not measured to a commit" history from the comment.