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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1md4xgwelm is past its budget: trevato/forge: "a preview address only where an environment exists, and only for those who may enter the app" failed on… #8217

Merged opened this

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

Merged

scout/forge:scout/8216-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/8216-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 2b943ca.

Review

Sign in to review this change.
1 file changed +3 −22
test/api-pulls-check-preview.test.ts +3 −22
@@ -50,18 +50,8 @@ beforeAll(async () => {
5050 forgeUrl: servers.url,
5151 concurrency: 1,
5252 });
53 await runtime.start();
54 // The pulls here have made-up heads: the runtime must never try to deploy (and so replace or
55 // drop) the environments the test sets up, whatever the load of the machine.
56 // Nor may its event handler or its sweeper act on the pulls and environments set up here.
57 const inner = runtime as unknown as {
58 requestDeploy: () => void;
59 unsubscribe?: () => void;
60 sweeper?: ReturnType<typeof setInterval>;
61 };
62 inner.requestDeploy = () => {};
63 inner.unsubscribe?.();
64 if (inner.sweeper !== undefined) clearInterval(inner.sweeper);
53 // Never started: no reconcile, no event handler, no sweeper, so nothing but this test sets or drops
54 // an environment, whatever the load of the machine. The API finds the runtime by its app.
6555 const u = await createUser(app.db, {
6656 origin: "seed",
6757 trusted: true,
@@ -131,18 +121,9 @@ test("a preview address only where an environment exists, and only for those who
131121 const address = runtime.urlFor(record(), `pull-${pulls["green"]!.number}`);
132122
133123 // A public app: every reader gets the address for the pull that has an environment, null for the rest.
134 const heldNow = () => new Set(runtime.status(record()).map((e) => e.env as string));
135 const before = heldNow();
136124 const open = await listed();
137 const after = heldNow();
138125 expect(open["green"]!["preview"]).toBe(address);
139 // The runtime brings others up (and drops them) on its own while the request runs; an address is
140 // given exactly where one exists, judged on the pulls whose environment held steady across it.
141 for (const item of Object.values(open)) {
142 const env = `pull-${item["number"]}`;
143 if (before.has(env) !== after.has(env)) continue;
144 expect(item["preview"] === null).toBe(!after.has(env));
145 }
126 for (const item of Object.values(open)) if (item["title"] !== "green") expect(item["preview"]).toBeNull();
146127
147128 // A private app on a public repository: a guest and a plain reader get none; the writer does.
148129 app.db.query("UPDATE app SET access = 'private' WHERE repo_id = ?1").run(repoId);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs