Skip to content

fix: repair ci — integration mkdtemp dir and stale edit-mode e2e specs#37

Merged
hjohns merged 2 commits into
mainfrom
hjohns/fix-ci
Jul 17, 2026
Merged

fix: repair ci — integration mkdtemp dir and stale edit-mode e2e specs#37
hjohns merged 2 commits into
mainfrom
hjohns/fix-ci

Conversation

@hjohns

@hjohns hjohns commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

CI's Test workflow has been red on every branch since ~June 22. Two independent causes, both pre-existing on main (the docs-only #34 fails identically):

integration (22s crash)

pipeline-roundtrip.test.ts does mkdtempSync(<root>/.cache/…).cache exists on dev machines but not on a fresh CI checkout → ENOENT. Fixed by creating the dir first. Verified locally on a simulated fresh checkout: 10/10 pass.

e2e (12 tests failing)

edit-flow.spec.ts + edit-workflow.spec.ts still tested the removed Edit button / ?edit= param entry flow. Edit mode is now always-on for authenticated users, entry is via workspace selection, and inline editing is click-to-edit. Rewritten against the current model:

  • auto-entered edit mode with a seeded workspace (mirrors real post-login state; fresh logins are redirected to /workspace)
  • click-to-edit inline cells; commit with Enter
  • Unsaved badge assertions instead of the old "N changes" text
  • save-flow mocks extended to the workspace edit-branch API (branches, git/refs) plus an api.github.com catch-all so no test traffic leaves the box
  • dropped tests for affordances that no longer exist (Edit dropdown, exit button, full/inline switch, expert-disabled-outside-edit-mode)

Full local run: 22/22 e2e pass (edit + browse + search), unit suite unaffected.

Unblocks meaningful checks on #34 and #36 — suggest merging this first, then rebasing/re-running those.

Integration: pipeline-roundtrip mkdtemps into <root>/.cache, which exists on
dev machines but not on a fresh CI checkout — create it first.

E2E: edit-flow/edit-workflow specs still tested the removed Edit-button +
?edit= URL-param entry flow, red on every branch since edit mode became
always-on for authenticated users. Rewritten against the current model:

- auto-entered edit mode (workspace seeded in localStorage, as after a real
  login → workspace selection; fresh logins redirect to /workspace)
- inline click-to-edit cells instead of always-rendered form inputs
- Unsaved badge instead of the old 'N changes' text
- save flow mocks the workspace edit-branch API (branches, git/refs) with an
  api.github.com catch-all so nothing hits the network
- dropped tests for removed affordances (Edit dropdown, exit button,
  full/inline switch, expert-disabled-outside-edit)
…on direct-loaded scheme pages

nuxt generate prerenders /scheme; loadDefinitions ran during that SSR pass,
its workspaces.json fetch fails at build time, and the resulting
definitionsLoaded=true + [] state is serialized into the payload. A client
that direct-loads a scheme URL hydrates that state, never retries the fetch,
activeWorkspace stays null, and every save fails with 'Failed to create edit
branch'. (Entering via /workspace masked it — that page loads definitions
client-side in onMounted.)

loadDefinitions now skips SSR entirely and retries when a previous attempt
yielded nothing (covers older poisoned payloads and transient failures).
@hjohns

hjohns commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed a second commit: the CI e2e save-test failure exposed a real bug, not a test problem — the prerendered /scheme payload bakes definitionsLoaded: true + [] (the SSR workspaces.json fetch fails at build time), so any direct load of a scheme URL hydrates poisoned workspace state and saving fails with "Failed to create edit branch". Entering via /workspace masked it because that page loads definitions client-side.

Fix: loadDefinitions() skips SSR and retries when loaded-but-empty. Verified locally against the CI-equivalent static build (nuxt generate + serve .output/public): 22/22 e2e pass, 452/452 unit pass.

@hjohns
hjohns merged commit d091d45 into main Jul 17, 2026
4 of 5 checks passed
@hjohns
hjohns deleted the hjohns/fix-ci branch July 17, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant