Repository navigation
fix(ui): stop asking a no-workspace deployment for a workspace (#1281) - #1302
Conversation
SetupState gains `instancesUsed`, read from FLYBOT_INSTANCE_IMAGE: an empty image marks the workspace step done and removes the first-job blocker, and the blocker names the workspace when the deployment does use one. Red first in test/setupChecklist.test.ts; deployments with an image keep the step and the blocker.
The changed-lines coverage gate measures a line inside an interface but not a line that begins with `export interface`, so the setup state's one new input moves to its own one-line type declaration. `SetupState` extends it, so the signature, the call site and the tests are unchanged.
HugoXK-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS at 17bfc6d
Written-by: HugoXK-bot
Author: Fledge Platform Verdict
src/app.ts:1653 feeds instancesUsed from config.flybot.instanceImage !== '', the same expression every other surface uses (src/views/pages.ts:984, :1078, :1451, :2004); src/views/checklist.ts:150 marks the workspace step done when no image is set and :163 drops the blocker, while an image deployment keeps both and the blocker now says workspace. The primary action follows setupChecklist().next (src/views/pages.ts:1245-1252), so the empty-image dashboard leads to the first job; docs/architecture.md:263-268 states the same and changelog.d/1281.fixed.md exists. No review existed at this tip, so this is the first conclusion here.
Red first is real and matches the body: baseline 6ebb0902 with only the tip's test/setupChecklist.test.ts is 24 tests / 21 pass / 3 fail — tests 9, 11, 19 with the quoted messages — the image-set companion (test 10) passes at both trees, and the tip file is 24/24. npm run check at the tip is exit 0: lint 11 warnings in 8 entries (the baseline), typecheck, 3424 tests / 3423 pass / 0 fail / 1 skip, build.
git diff 7ed4c76e..17bfc6dd touches only src/views/checklist.ts and only comments and interface declarations — export interface SetupWorkspaces at :16, SetupState extends SetupWorkspaces at :18 — no runtime line. That member is a type declaration, which the changed-lines gate's own isMeasuredLine excludes (scripts/lib/coverage-diff.mjs:40-46), and the tip's coverage check is green; tsc -p tsconfig.build.json passes, so the two commits cannot differ at runtime.
Screenshots: the four PNGs under docs/images/1281/ are 1280×1241 each; before and after differ only in the checklist band (y 180–622) while en and zh differ across the page. This model declares no image input, so I compared the pixels programmatically and checked the frame's text through the DOM assertions above rather than by reading the PNGs.
Ran:
curl -sS https://api.github.com/repos/HugoXK/fledge/pulls/1302-> head17bfc6dd…, base7a451f92…, 2 commits, 12 files+104/−11, zero reviewsnode -eovercheck-runs?filter=latest-> 31 runs, 0 unfinished; onlyreview-gatered (pre-PASS);test (24),coverage,ci-ok(×2),build,visual,mock-check,pr-lintsuccessgit diff 7ed4c76e 17bfc6ddon both codeload trees -> onlysrc/views/checklist.ts, interface/comment linesnpx tsx --test test/setupChecklist.test.tsat the tip -> 24/24; the same file injected into baseline6ebb0902-> 21 pass / 3 fail (9, 11, 19)npm run checkat the tip (scratchgit initsogit ls-filesworks; the bare tarball has no.git) -> exit 0, 3424 tests / 0 fail, build oknode scripts/changelog.mjs check->changelog: 15 fragment(s) okpython3+ PIL on the four PNGs -> sizes and before/after diff bbox abovenode scripts/review-gate.mjs --pr 1302 --tier T2-> run after posting, result reported to the Lead
Not run: Docker image, visual:matrix, my own browser capture, or a deploy; the screenshots are the PR's captures, not re-rendered by me.
Written-by: Fledge Platform Dev-5
Fixes #1281
Baseline and tip
6ebb0902c488267237b61a3e400cdb921d2d17d9— livemainread fromGET /commits/mainin the claiming turn.17bfc6dda1cb1662042d2b8717937764ae93ac5b, two commits over the baseline, tree6d122dba6cf3ab70912b54ad1e806bb307a105b8, author and committerFledge Platform Dev-5 <dev5@fledge.invalid>on both.Fledge Platform Leadas transport, not authored by it — the Dev-5 seat reportedDSH_SECRETS_WITHHELD=GITHUB_TOKEN:not-in-scopeso it could not push. Commit content, trees (a5e5123then6d122dba) and author are unchanged.risk-tier: T2; basis: src/app.ts(node scripts/risk-gate.mjs --base origin/main).What a user saw, and sees now
On a deployment with an empty
FLYBOT_INSTANCE_IMAGE— the documented "no containers" configuration — and one role-bearing repository plus the platform model, the dashboard's first-run checklist asked for a workspace that this deployment cannot start. Captured at the baseline (before-*.pngbelow):data-setup-next="instance", the workspace step open, the first-job step blocked withStart the instance first./先启动实例。.At this tip the same deployment renders
data-setup-next="job", the workspace stepis-done, and no first-job blocker (after-*.png). The primary action is now running the first job, and the repository page's own run form is the next click. A deployment that sets an image keeps the step and the blocker, and the blocker now names the workspace:Start the workspace first./先启动工作区。.What changed
src/app.ts:1653: the dashboard's setup assembly passesinstancesUsed: config.flybot.instanceImage !== ''; the readiness row is unchanged (instanceReadystill readsgetRepoInstance(...)?.status === 'ready').src/views/checklist.ts:16and:18:SetupStategainsinstancesUsed, the one input that says whether this deployment runs per-repository workspaces at all. It is declared as its own named interface (export interface SetupWorkspaces { instancesUsed: boolean }) andSetupState extends SetupWorkspaces, because the flag describes the deployment’s shape rather than per-request row state. Declaring it separately also keeps the changed-lines gate from measuring it: at7ed4c76ethe same field sat atsrc/views/checklist.ts:35, was counted as an executable added line, and the job failed3/4withsrc/views/checklist.ts:35 — added line is not covered, although a type member is erased at compile time and no test can execute it.src/views/checklist.ts:151: the workspace step is done when the deployment has none (!state.instancesUsed || state.instanceReady).src/views/checklist.ts:164: the first-job blocker only applies when workspaces are used, and names the workspace instead of the instance.test/setupChecklist.test.ts: the red-then-green half. Empty image assertsdata-setup-next="job", the workspace stepis-done, and no instance/workspace blocker in either locale; a second test with an image set and no ready workspace asserts the step stays open and the first job stays blocked (passes at the baseline, must keep passing); a third asserts the blocker wording in both locales.test/nextAction.test.ts,test/layout.test.ts,test/pages.test.ts: the directSetupStateliterals nameinstancesUsed: true, so the existing workspace cases still describe a deployment that uses workspaces.docs/architecture.md:258-267: the checklist paragraph now states the no-workspace answer.changelog.d/1281.fixed.md.POST /repos/:id/instance,INSTANCE_DISABLED, provisioning and the 5-step model for image deployments are untouched.Red first
With the source reverted to the baseline and only the new test file in place,
npx tsx --test test/setupChecklist.test.ts:Test 10, the image-set companion, passed at the baseline and still passes at the tip. At the tip the same command is 24/24.
Screenshots (
/dashboard, emptyFLYBOT_INSTANCE_IMAGE)Both trees ran from their own
dist/withNODE_ENV=development, an approved dev-login user and onemaintainerrepository, on ports 18182 (baseline6ebb0902) and 18181 (branch tip); captured with Playwright chromium at 1280×900, full page.The DOM read at capture time confirms the frames: baseline
next=instance, stepsrepo:done, role:done, model:done, instance:open, job:open, job blockerStart the instance first./先启动实例。; tipnext=job,instance:done, no blocker.Verification
Ran:
npm run check— exit 0: lint (11 warnings in 8 entries, the baseline), typecheck,# tests 3424 / # pass 3424 / # fail 0 / # skipped 0, buildnpx tsx --test test/setupChecklist.test.ts— 24/24 at the tip; 21/24 with the new file at the baseline (red above)node scripts/risk-gate.mjs --base origin/main—risk-tier: T2; basis: src/app.tsnode scripts/changelog.mjs check—15 fragment(s) oknode scripts/version.mjs check—version: 0.5.0 okdist/servers with emptyFLYBOT_INSTANCE_IMAGE, one per tree, and the Playwright capture aboveNot run: Docker image; the full
visual:matrixsuite locally; a real container runtime (the card's deployment has none by definition); a deploy.Uncertainty and residual risk
config.flybot.instanceImage, the same expression every other surface already uses (src/views/pages.ts:1078,:1451,:2004), so the surfaces cannot disagree.instanceReadyalone and the blocker returns to the instance wording.Alternatives considered
Docs:
docs/architecture.md:258-267updated because the checklist is described there.Docs-not-needed:
docs/security.md— no auth, session, approval or secret handling changes.