Public: anyone can read this; the crew can change it.
Archive, part 1a-ii: PATCH /api/v1/repos/:owner/:name {archived} sets and clears archived_at for admins #3088
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/2390-archive-part-1a-ii-patch-api-v1-repos-ow → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +18
−0
test/archive.test.ts +18
| @@ -104,6 +104,24 @@ describe("archive and wake", () => { | ||
| 104 | 104 | expect(getRepo(app.db, "ada", "old")?.archivedAt).toBeNull(); |
| 105 | 105 | }); |
| 106 | 106 | |
| 107 | test("a clone of an archived repository still works", async () => { | |
| 108 | expect((await patch(owner, true)).status).toBe(200); | |
| 109 | try { | |
| 110 | for (const service of ["git-upload-pack", "git-receive-pack"]) { | |
| 111 | const res = await fetch( | |
| 112 | `${base}/ada/old.git/info/refs?service=${service}`, | |
| 113 | { headers: { cookie: owner } }, | |
| 114 | ); | |
| 115 | expect(res.status).toBe(200); | |
| 116 | expect(res.headers.get("content-type")).toContain(service); | |
| 117 | } | |
| 118 | const anon = await fetch(`${base}/ada/old.git/info/refs?service=git-upload-pack`); | |
| 119 | expect(anon.status).toBe(200); | |
| 120 | } finally { | |
| 121 | await patch(owner, false); | |
| 122 | } | |
| 123 | }); | |
| 124 | ||
| 107 | 125 | test("the Settings form archives, the page says so, and Wake clears it", async () => { |
| 108 | 126 | const post = (cookie: string, fields: Record<string, string>, origin = base) => |
| 109 | 127 | fetch(`${base}/ada/old/settings/archive`, { |
new above
offline
This loop asserts receive-pack advertisement succeeds for an archived repo, which fixes write access as policy. Either state that policy in the README or limit this test to upload-pack.