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

First-time studio owner: a cloud bill, an app's deploy and its undo are hard to find #17640

opened this in answer to

Merged 23h 37m ago, live in production

scout/forge:scout/17637-first-time-studio-owner-a-cloud-bill-an → main 0 commits fork 1 thread · 1 unresolved

  • Merged. scout/17637-first-time-studio-owner-a-cloud-bill-an was merged into main as 1c6bd9c.

Review

Sign in to review this change.
12 files changed +44 −9
docs/features/app-page-details.md +2 −2
@@ -7,11 +7,11 @@ row: The app's page: detail on demand
77 A first ask opens a page of one column: the state, the box to tell the crew, and Now. The operator's
88 detail sits behind named disclosures, so the controls differ for a screen reader:
99
10 - **Deploy and log** (under the name): the commit, terminal, build cache and log tail. It opens by
10 - **Show deploy details** (under the name): the commit, terminal, build cache and log tail. It opens by
1111 itself when production errored or its last deploy failed.
1212 - **Run log**: the crew's log tail inside a running Now row.
1313 - **Operator detail** (first-ask page only): variants, drop, environment settings, archive.
1414
15 An app that has run keeps its rail, previews, crew and forks in view as before; only Deploy and log
15 An app that has run keeps its rail, previews, crew and forks in view as before; only Show deploy details
1616 and Run log fold. A disclosure someone has opened stays open when a deploy event refreshes the head.
1717 The terminal has no page layout, so it is unchanged.
docs/features/cloud.md +4
@@ -82,3 +82,7 @@ The ceiling counts only what the forge's own rows say it made. The `cloud-watch`
8282 Not done: adopting an orphan into a pinned row (retire it in the provider's console, or acknowledge it), and a read of the provider's actual bill.
8383
8484 The watch keeps when the standing problems began, so a standing orphan is one notification and one /health card, not one an hour. A forge-named thing made in the last two hours, or named for a live pinned row, is a deploy in flight and not an orphan. A create stays refused until the next hourly reading even after an orphan is retired in the provider's console; the refusal says so.
85
86 ## What the ceiling line counts
87
88 Each account row reads `ceiling $X a month · $Y counted from this account's machines and databases · $Z left`. `$Y` is the forge's own count of what it pinned to the account, not the vendor's bill; Infrastructure shows the bill.
docs/features/service-parked.md +1 −1
@@ -9,7 +9,7 @@ This page is for app authors. A service declares TCP ports in `forge.json` (`app
99 ## What happens
1010
1111 - **Stop.** Stopping the service parks it. Its ports are released at once, so another app may deploy with them.
12 - **Where you see it.** The app page shows, under "Deploy and log", and the terminal's Deploys screen shows under the production heading: `parked: port 25565 released for other apps; a redeploy takes it back, or says who holds it`.
12 - **Where you see it.** The app page shows, under "Show deploy details", and the terminal's Deploys screen shows under the production heading: `parked: port 25565 released for other apps; a redeploy takes it back, or says who holds it`.
1313 - **Redeploy.** A redeploy takes the ports back. If another app now holds one, the deploy fails with `forge.json: port 25565 is already held by <app>; <yours> cannot declare it`, and your app stays parked. Stop that app, or change `app.ports`, then deploy again.
1414 - **Clears.** The note goes when a deploy lands, or when the environment is removed.
1515
docs/features/service-restart.md +1 −1
@@ -15,7 +15,7 @@ This page is for app authors. An app whose `forge.json` declares a `service` has
1515
1616 ## Where you see it
1717
18 After a restart, the app page shows one line under "Deploy and log", and the terminal's Deploys screen shows the same line under the production heading:
18 After a restart, the app page shows one line under "Show deploy details", and the terminal's Deploys screen shows the same line under the production heading:
1919
2020 - `service restarting in 4 s after exit code 2 (restart 3, pause doubles up to 60 s)` while it waits
2121 - `service restarted 3 times after exit code 2` once it is running again
src/tui/screens/deploys.ts +1 −1
@@ -285,7 +285,7 @@ export function deploysScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
285285 pace = appPace(f.app, f.user, repo);
286286 side = appSideLines(f.app, f.user, repo);
287287 const standing = appOnboardingLine(f.app, repo, f.user);
288 onboarding = standing === undefined ? "" : `${standing.text}${standing.href === undefined ? "" : ` ${standing.href}`}`;
288 onboarding = standing === undefined ? "" : `As it stands: ${standing.text}${standing.href === undefined ? "" : ` ${standing.href}`}`;
289289 egress = egressLines(f, repo);
290290 pulls = appPullLines(f.app, f.user, repo);
291291 previews = appPreviews(f.app, f.user, repo);
src/web/onboarding_row.ts +3 −1
@@ -10,8 +10,10 @@ import type { OnboardingLine } from "../apps/onboarding.ts";
1010 import { html, type Html } from "./html.ts";
1111
1212 export function onboardingRow(line: OnboardingLine): Html {
13 // A label first: the line is the state of the app as it already stands, never the result of
14 // opening the disclosure it sits in (#17637).
1315 return html`<p class="muted" data-onboarding="${line.state}">
14 ${line.text}${line.href === undefined || line.linkLabel === undefined
16 As it stands: ${line.text}${line.href === undefined || line.linkLabel === undefined
1517 ? null
1618 : html` <a href="${line.href}">${line.linkLabel}</a>`}
1719 </p>`;
src/web/pages/cloud.ts +1 −1
@@ -81,7 +81,7 @@ function watchFacts(db: Database, a: CloudAccount): { label: string; value: stri
8181
8282 function ceilingLine(db: Database, a: CloudAccount): string {
8383 const s = spendOf(db, a.provider, a.name);
84 return `ceiling $${s.ceilingDollars} a month · the forge reckons ${dollars(s.monthlyCents)} now · ${s.leftCents >= 0 ? `${dollars(s.leftCents)} left` : `${dollars(-s.leftCents)} over`}`;
84 return `ceiling $${s.ceilingDollars} a month · ${dollars(s.monthlyCents)} counted from this account's machines and databases · ${s.leftCents >= 0 ? `${dollars(s.leftCents)} left` : `${dollars(-s.leftCents)} over`}`;
outdated

Principles 1 and 8: this sentence explains itself and points elsewhere in a parenthetical, on every account row. Say what the number is in plain words and move the 'not the bill' note out. Needs a test too.

8585 }
8686
8787 function accountsCard(db: Database, accounts: CloudAccount[], reads: CloudRead[], uses: Map<string, VendorUse[]>): Html {
src/web/studio/previews.ts +1 −1
@@ -359,7 +359,7 @@ export function appPanels(
359359 ${when(copy, (c) => html`${repo.description || url !== undefined ? "· " : ""}${testCopyLink(c)}`)}
360360 </p>`)}
361361 ${disclosure(
362 "Deploy and log",
362 "Show deploy details",
363363 html`${onboarding === undefined
364364 ? when(production, (env) => envFacts(base, env))
365365 : onboardingRow(onboarding)}
test/cloud-page-shape.test.ts +7
@@ -83,3 +83,10 @@ test("a Hetzner row has no project field and no explanation; a DigitalOcean row
8383 expect(page.match(/Cloud project for the forges of/g)).toHaveLength(1);
8484 expect(page).not.toContain("already belongs to one project");
8585 });
86
87 test("the ceiling line says what its dollars count, in plain words", async () => {
88 const page = await (await fetch(`${servers.url}/settings/cloud`, { headers: { cookie } })).text();
89 expect(page.replaceAll("&#39;", "'")).toContain("counted from this account's machines and databases");
90 expect(page).not.toContain("the forge reckons");
91 expect(page).not.toContain("not its bill");
92 });
test/fresh-app.test.ts +1 −1
@@ -146,7 +146,7 @@ test("the first-ask page folds the operator's detail into named disclosures", as
146146 expect(outside).not.toContain(gone);
147147 const names = summaries(page);
148148 expect(names).toContain("Operator detail");
149 expect(names).toContain("Deploy and log");
149 expect(names).toContain("Show deploy details");
150150 expect(new Set(names).size).toBe(names.length);
151151 expect(names).not.toContain("Details");
152152 const operator = blocks.find((b) => b.includes('id="app-details"'))!;
test/onboarding-doors.test.ts +13
@@ -220,3 +220,16 @@ test("the notifier judges a new app afresh on a pull event and tells its owner o
220220 notifier.stop();
221221 }
222222 });
223
224 test("the app page's fold-out is named 'Show deploy details' and holds the 'As it stands:' line", async () => {
225 const page = await (await get("/alice/open/app", true)).text();
226 const at = page.indexOf("Show deploy details");
227 expect(at).toBeGreaterThan(-1);
228 expect(page).not.toContain("Deploy and log");
229 expect(page.slice(at)).toContain("As it stands: ");
230 });
231
232 test("the terminal's deploys screen labels the line 'As it stands:'", async () => {
233 const text = await frame(alice, repos.open!);
234 expect(text).toContain("As it stands:");
235 });
test/studio-labels.test.ts added +9
@@ -0,0 +1,9 @@
1 import { expect, test } from "bun:test";
2 import { onboardingRow } from "../src/web/onboarding_row.ts";
3
4 // #17637: the line inside the fold-out is the app's standing, never the result of opening it.
5 test("the onboarding row says it is the state as it stands", () => {
6 const out = String(onboardingRow({ state: "making", text: "The crew is making it run (pull #3)." }));
7 expect(out).toContain("As it stands:");
8 expect(out).toContain("The crew is making it run (pull #3).");
9 });

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs