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

Full suite red: test/archived-hidden-everywhere.test.ts #15431

Merged opened this in answer to

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

Merged

scout/forge:scout/15429-full-suite-red-test-archived-hidden-ever → main 0 commits fork

  • Merged. scout/15429-full-suite-red-test-archived-hidden-ever was merged into main as 896ce24.

Review

Sign in to review this change.
2 files changed +18 −2
src/web/studio/since.ts +5 −2
@@ -29,13 +29,16 @@ interface Red {
2929 finished_at: string;
3030 }
3131
32 /** Repositories are read through `canRead`, the feed's own check, once each. */
32 /**
33 * Repositories are read through `canRead`, the feed's own check, once each; an archived one is put
34 * away (#1838).
35 */
3336 function readable(db: Database, viewer: User | undefined): (repoId: string) => Repo | undefined {
3437 const seen = new Map<string, Repo | undefined>();
3538 return (id) => {
3639 if (!seen.has(id)) {
3740 const repo = getRepoById(db, id);
38 seen.set(id, repo && canRead(db, repo, viewer) ? repo : undefined);
41 seen.set(id, repo && repo.archivedAt == null && canRead(db, repo, viewer) ? repo : undefined);
3942 }
4043 return seen.get(id);
4144 };
test/home-since-sources.test.ts +13
@@ -69,3 +69,16 @@ test("release and failed lines link to readable pages, the pull when known", ()
6969 expect(hrefs).toContain(`/${repo.ownerName}/${repo.name}/pulls/1`);
7070 expect(hrefs.some((h) => h.startsWith("/api/") || h === "/releases")).toBe(false);
7171 });
72
73 test("an archived repository's landed pull makes no digest line (#15429)", () => {
74 const repo = f.repos.find((r) => r.visibility === "public")!;
75 land(repo.id, H / 3);
76 const name = `${repo.ownerName}/${repo.name}`;
77 expect(eventsSince(db(), f.peer, Date.now() - 3 * H, Date.now()).some((e) => e.repo === name)).toBe(true);
78 db().query("UPDATE repo SET archived_at = ?1 WHERE id = ?2").run(iso(0), repo.id);
79 try {
80 expect(eventsSince(db(), f.peer, Date.now() - 3 * H, Date.now()).some((e) => e.repo === name)).toBe(false);
81 } finally {
82 db().query("UPDATE repo SET archived_at = NULL WHERE id = ?1").run(repo.id);
83 }
84 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs