Skip to content
47 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

A desktop release goes out with what can be built. Linux is built on g1t's machines in every release; Windows and macOS each wait on a repository variable: a machine registered for them, or for Windows a cross build on Linux once aka.ms and download.visualstudio.microsoft.com are workflow-only domains, which is where the first release stopped. A platform with no machine is skipped and the download page says it is coming, with a word for the visitor whose platform this release lacks. The guide and CONTRIBUTING say so.1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { MIRROR_READ_AREAS, type RepoArea, type RepoMirror, mirrorOffers, mirrorUpdatesWait, mirrorWritable } from "./mirrors.ts";
5
6const mirror = (state: RepoMirror["state"], warm = false): RepoMirror => ({
7 state,
8 remote: "github.com/acme/web",
9 url: "https://github.com/acme/web",
10 since: "2026-10-08T10:00:00Z",
11 warm,
12});
13const AREAS: RepoArea[] = ["code", "issues", "pulls", "agents", "workflows", "deployments", "security", "insights", "settings", "updates"];
14const WORK: RepoArea[] = ["issues", "pulls", "agents", "deployments", "updates"];
15
16test("only a takeover takes writes", () => {
17 assert.equal(mirrorWritable(null), true);
18 assert.equal(mirrorWritable(undefined), true);
19 assert.equal(mirrorWritable(mirror("takeover")), true);
20 for (const state of ["standby", "ci", "handing_back"] as const) assert.equal(mirrorWritable(mirror(state)), false, state);
21});
22
23test("a mirror offers a read-only copy until it is taken over", () => {
24 for (const state of ["standby", "ci", "handing_back"] as const) {
25 for (const area of MIRROR_READ_AREAS) assert.ok(mirrorOffers(mirror(state), area), `${state} ${area}`);
26 for (const area of WORK) assert.ok(!mirrorOffers(mirror(state), area), `${state} ${area}`);
27 }
28 for (const area of AREAS) {
29 assert.ok(mirrorOffers(mirror("takeover"), area), `taken over: ${area}`);
30 assert.ok(mirrorOffers(null, area), `leads: ${area}`);
31 }
32});
33
34test("workflows run in CI failover, during a takeover, and on a standby kept warm", () => {
35 assert.equal(mirrorOffers(mirror("standby"), "workflows"), false);
36 assert.equal(mirrorOffers(mirror("standby", true), "workflows"), true);
37 assert.equal(mirrorOffers(mirror("ci"), "workflows"), true);
38 assert.equal(mirrorOffers(mirror("takeover"), "workflows"), true);
39 assert.equal(mirrorOffers(mirror("handing_back"), "workflows"), false);
40 assert.equal(mirrorOffers(mirror("handing_back", true), "workflows"), false, "nothing starts while handing back");
41});
42
43test("why updates wait names the repository and its remote", () => {
44 const why = mirrorUpdatesWait("acme", "web", mirror("standby"));
45 assert.ok(why.startsWith("Security updates wait until acme/web is taken over or moved to g1t."));
46 assert.ok(why.includes("github.com/acme/web"));
47});