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

Merged opened this

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

Merged

scout/forge:scout/2390-archive-part-1a-ii-patch-api-v1-repos-ow → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/2390-archive-part-1a-ii-patch-api-v1-repos-ow was merged into main as e5ac7cb.

Review

Sign in to review this change.
1 file changed +18 −0
test/archive.test.ts +18
@@ -104,6 +104,24 @@ describe("archive and wake", () => {
104104 expect(getRepo(app.db, "ada", "old")?.archivedAt).toBeNull();
105105 });
106106
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}`,

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.

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
107125 test("the Settings form archives, the page says so, and Wake clears it", async () => {
108126 const post = (cookie: string, fields: Record<string, string>, origin = base) =>
109127 fetch(`${base}/ada/old/settings/archive`, {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs