Public: anyone can read this; the crew can change it.
Main is green again after #16394: its making sleep is named, cookie sites counted, and New forge reads plans once #16400
Check · Review · Land · Live done — Landed and live in production.
fix/main-red-making → main 0 commits
4 files
changed +9
−8
src/web/pages/new-forge.ts +6 −5
| @@ -49,7 +49,7 @@ import { page, redirect } from "../layout.ts"; | ||
| 49 | 49 | import { placeChoiceView } from "../pinned.ts"; |
| 50 | 50 | import { orderCookie } from "./pricing.ts"; |
| 51 | 51 | import { placeChoice } from "../../spawn/making.ts"; |
| 52 | import { FREE, getPlan, getPlans } from "../../settings/plans.ts"; | |
| 52 | import { FREE, getPlans, type Plan } from "../../settings/plans.ts"; | |
| 53 | 53 | import { linkToSend, madeBody, madeJs } from "../forge_made.ts"; |
| 54 | 54 | import { pickList } from "../pick.ts"; |
| 55 | 55 | import { btn, field as formField, selectField } from "../ui.ts"; |
| @@ -253,6 +253,8 @@ function formView( | ||
| 253 | 253 | : null} |
| 254 | 254 | </section> |
| 255 | 255 | </div>`; |
| 256 | // One read of the plans serves the Plan field and where the chosen one runs. | |
| 257 | const plans = getPlans(ctx.app.db); | |
| 256 | 258 | const anon = user === undefined; |
| 257 | 259 | const includedUsd = limitValue(ctx.app.db, "spawn.included_credit_usd"); |
| 258 | 260 | const askUsd = limitValue(ctx.app.db, "billing.ask_cents") / 100; |
| @@ -440,8 +442,8 @@ function formView( | ||
| 440 | 442 | </p> |
| 441 | 443 | </details> |
| 442 | 444 | ${codeField(values.code, errors["code"])} |
| 443 | ${planField(ctx, user, values.plan, errors["plan"])} | |
| 444 | ${placeChoiceView(placeChoice(ctx.app, getPlan(ctx.app.db, values.plan || values.giftPlan), user?.isAdmin === true), values.place, errors["place"])} | |
| 445 | ${planField(plans, user, values.plan, errors["plan"])} | |
| 446 | ${placeChoiceView(placeChoice(ctx.app, plans.find((p) => p.key === (values.plan || values.giftPlan)), user?.isAdmin === true), values.place, errors["place"])} | |
| 445 | 447 | ${anon |
| 446 | 448 | ? null |
| 447 | 449 | : html`<details class="field"${values.saveAs !== "" || errors["recipe"] ? html` open` : null}> |
| @@ -836,8 +838,7 @@ export async function newForgeSubmit(ctx: Ctx): Promise<Response> { | ||
| 836 | 838 | } |
| 837 | 839 | |
| 838 | 840 | /** An admin's plan for the new forge: a paid one runs where paid forges run. Only with paid plans. */ |
| 839 | function planField(ctx: Ctx, user: User | undefined, chosen: string, error: string | undefined): Html | null { | |
| 840 | const plans = getPlans(ctx.app.db); | |
| 841 | function planField(plans: readonly Plan[], user: User | undefined, chosen: string, error: string | undefined): Html | null { | |
| 841 | 842 | if (user?.isAdmin !== true || plans.every((p) => p.key === FREE)) return null; |
| 842 | 843 | return selectField({ |
| 843 | 844 | label: "Plan", |
test/cookie-flags.test.ts +1 −1
| @@ -137,7 +137,7 @@ const UNREACHED: Record<string, { sites: number; why: string }> = { | ||
| 137 | 137 | "src/web/resume_cookie.ts": { sites: 1, why: "the doc comment of keepResumeKey, whose line the home page's start sends; tested in test/start-forge-resume.test.ts" }, |
| 138 | 138 | "src/web/pages/start-forge.ts": { sites: 1, why: "appends the resume key's line from src/web/resume_cookie.ts; tested in test/start-forge-resume.test.ts" }, |
| 139 | 139 | "src/core/idempotency.ts": { sites: 1, why: "names set-cookie only to drop it: a replayed answer never carries the first answer's cookie; sets none; covered by test/idempotency-replay-headers.test.ts" }, |
| 140 | "src/web/pages/new-forge.ts": { sites: 1, why: "appends dropGift(), the gift cookie's clearing line from src/web/gift_cookie.ts, once a forge is made with a gift code" }, | |
| 140 | "src/web/pages/new-forge.ts": { sites: 2, why: "appends dropGift(), the gift cookie's clearing line from src/web/gift_cookie.ts, once a forge is made with a gift code: on the made page and on the redirect to a cloud order's making page" }, | |
| 141 | 141 | }; |
| 142 | 142 | |
| 143 | 143 | const dirs: string[] = []; |
test/job-slices.test.ts +1 −1
| @@ -273,7 +273,7 @@ const UNTIMED: Record<string, string> = { | ||
| 273 | 273 | desk: "expires notes past their time: one indexed delete on the desk table every 30 s (actions/desk.ts); the fixture has no notes", |
| 274 | 274 | ledger: "walks the cost ledger's hash chain at boot and once a day (#12273): file reads proportional to the ledger, off the request path; the fixture has no ledger", |
| 275 | 275 | "full-disk-probe": "one 64 KiB write every 2 s, only while the disk is full; the full-disk test drives probeFull directly", |
| 276 | "order.making": "one ask after a paid order's cloud machine every few seconds, at most 60, only while an order is making in this process: a row read and one call to the cloud (actions/order.ts, followMaking); the fixture has no order; order-cloud.test.ts turns the watch off (tries 0) and asks the order itself", | |
| 276 | "order.making": "one ask after a paid order's cloud machine every few seconds, at most 60, only while an order is making in this process: a row read and one call to the cloud (spawn/making.ts, followMaking); the fixture has no order; order-cloud.test.ts turns the watch off (tries 0) and asks the order itself", | |
| 277 | 277 | "reach-asks": "a one-shot timer in actions/ask_host.ts, armed only while a hosted forge has an ask under an hour old: one signed call to its host over the network and a few rows; the fixture has no host", |
| 278 | 278 | "run-ending": "a one-shot timer in runs/ending.ts, armed only while a cancel waits on a worker here: at its deadline it announces the run once (a row read and one outbox write); run-cancel-stopping.test.ts drives whenEnded directly", |
| 279 | 279 | lane: "a closure in startChecks; starting the checks service starts cell checks — follow-up", |
test/timers-named.test.ts +1 −1
| @@ -114,11 +114,11 @@ const ALLOWED: readonly Allowed[] = [ | ||
| 114 | 114 | ["src/core/v1_proof.ts", "done"], |
| 115 | 115 | ["src/maintenance/checks.ts", "done"], |
| 116 | 116 | ["src/chaos/faults.ts", "r"], |
| 117 | ["src/actions/order.ts", "r"], | |
| 118 | 117 | ["src/perf/sample.ts", "r"], |
| 119 | 118 | ["src/cluster/jobs.ts", "r"], |
| 120 | 119 | ["src/release/serving.ts", "r"], |
| 121 | 120 | ["src/snapshot/service.ts", "r"], |
| 121 | ["src/spawn/making.ts", "r"], | |
| 122 | 122 | ["src/apps/holding.ts", "resolve"], |
| 123 | 123 | ["src/checks/service.ts", "resolve"], |
| 124 | 124 | ["src/checks/install.ts", "() => { signal.removeEventListener("], |
new above
offline