Skip to content

test(ui): centralize cron controller fixtures - #117643

Merged
steipete merged 1 commit into
mainfrom
codex/goal100k-ui-cron-controller-fixtures-0801-2d45
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/goal100k-ui-cron-controller-fixtures-0801-2d45

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace duplicated hand-written Cron state initialization with the canonical production createInitialCronState({ connected: true }), preserving a fresh state, form, error object, and arrays for every test.
  • Consolidate repeated mocked Gateway add/update/list/status responses and common Cron job shapes into private typed, per-test fixture factories.
  • Keep custom wrapped responses, read-only script/list paths, validation failures, deferred request races, async errors, explicit null/undefined clearing, agent routing, and lossless decimal/BigInt schedules unchanged.
  • Exactly one test file: 135 added / 626 deleted = 491 fewer test LOC; production delta 0; no test removals, fixture packing, or locale changes.

Exact structural parity

TypeScript AST comparison against the pristine current-main file:

  • 77/77 test registrations, 8/8 parameterized tables, 101/101 expanded cases.
  • 185/185 direct expectations and 185/185 complete matcher expressions; every test registration, expectation, and matcher has the identical normalized AST hash.
  • Registration SHA-256: 6191f8ad6f05916bfbf7b45f92cf16b5a5bd80c913740bb08dc646b53c9afcd1.
  • Matcher SHA-256: 6940d7cb831a2e90ad2993cc18939ebf05c3108e4ebc1ba40054062f21f984c8.

Independent review

  • Fresh independent gpt-5.6-sol xhigh review: CLEAN, no P0–P3 findings; verified canonical state freshness, all Gateway response branches, fixture ownership, request ordering, async/deferred errors, scheduling/BigInt and production neutrality.

Validation

Trusted Blacksmith Testbox, exact reviewed source:

  • CI=1 pnpm test ui/src/lib/cron/index.test.ts ui/src/pages/cron/cron-page.test.ts ui/src/pages/cron/timezone-suggestions.test.ts ui/src/pages/cron/view.test.ts — 162 passed across 4 files, including all 101 original Cron controller cases.
  • pnpm tsgo:core:test — PASS.
  • pnpm tsgo:ui — PASS.
  • CI=1 pnpm check:changed — PASS; all three Knip scans clean, i18n baseline unchanged, formatter/guards/typecheck clean, typed lint 0 warnings and 0 errors.
  • Current advanced main synthetic merge — clean, no touched-file drift.
✓ ui/src/lib/cron/index.test.ts (101 tests)
✓ ui/src/pages/cron/view.test.ts (42 tests)
✓ ui/src/pages/cron/cron-page.test.ts (17 tests)
✓ ui/src/pages/cron/timezone-suggestions.test.ts (2 tests)

Test Files  4 passed (4)
     Tests  162 passed (162)

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete steipete self-assigned this Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 5:30 PM ET / 21:30 UTC.

ClawSweeper review

What this changes

The branch centralizes Cron controller test state, mock Gateway responses, and common Cron job shapes in typed helper factories within ui/src/lib/cron/index.test.ts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This is a correct, production-neutral Cron test-fixture consolidation. It remains open for the assigned maintainer’s normal merge decision because it carries the protected maintainer label.

Priority: P3
Reviewed head: 68daa44494b11cbf9b0d5da8541c54fd912b71a2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, production-neutral refactor that adopts the controller’s canonical state initializer and retains explicit exceptional mock paths.
Proof confidence 🌊 off-meta tidepool Not applicable: This internal test-only refactor has no user-facing behavior to demonstrate; the supplied focused test and typecheck results are the relevant proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This internal test-only refactor has no user-facing behavior to demonstrate; the supplied focused test and typecheck results are the relevant proof.
Evidence reviewed 5 items Canonical state owner: createInitialCronState constructs all Cron state fields with fresh form, object, and array values; the submitted test helper delegates to it with connected: true before applying test overrides.
Full one-file diff: The diff adds the production initializer import plus shared request/job factories and replaces repeated equivalent test setup; git diff --check reported no whitespace errors.
Existing coverage retained: Both main and PR head contain 77 direct test registrations, while specialized request handlers remain for list totals, request failures, deferred races, and null-clearing paths.
Findings None None.
Security None None.

How this fits together

The Control UI Cron controller owns scheduled-job form, list, status, and mutation state and calls Gateway Cron RPCs to load or change it. The affected tests provide fresh state and mocked RPC responses before verifying controller transitions and serialized payloads.

flowchart LR
  A[Controller test cases] --> B[State and RPC fixtures]
  B --> C[Cron controller]
  C --> D[Gateway Cron calls]
  C --> E[Updated Cron state]
  D --> F[Mock responses]
  E --> G[Test assertions]
  F --> G
Loading

Decision needed

Question Recommendation
Should the assigned maintainer merge this tested one-file Cron test-fixture cleanup? Merge after normal review: Accept the test-only consolidation because it reuses the production state owner and preserves focused specialized mock paths.

Why: The patch appears correct, but the active maintainer label requires an explicit maintainer decision rather than an automated cleanup outcome.

Before merge

  • Add real behavior proof - Not applicable: This internal test-only refactor has no user-facing behavior to demonstrate; the supplied focused test and typecheck results are the relevant proof.
Agent review details

Security

None.

PR surface

Tests -491. Total -491 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 135 626 -491
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 135 626 -491

Review metrics

None.

Technical review

Best possible solution:

Merge the one-file fixture consolidation after the assigned maintainer’s normal review, preserving the canonical initializer and the explicit specialized mocks that protect response-specific controller tests.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR is a test-fixture refactor, not a report of a separate user-visible failure. Its verification path is the focused test suite and direct source comparison.

Is this the best way to solve the issue?

Yes: using createInitialCronState removes duplicated knowledge of controller defaults while typed factory helpers preserve the repeated method-specific mock contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b82dd01ece19.

Labels

Label changes:

  • add P3: This is production-neutral test-suite cleanup for the Control UI Cron controller.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This internal test-only refactor has no user-facing behavior to demonstrate; the supplied focused test and typecheck results are the relevant proof.

Label justifications:

  • P3: This is production-neutral test-suite cleanup for the Control UI Cron controller.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This internal test-only refactor has no user-facing behavior to demonstrate; the supplied focused test and typecheck results are the relevant proof.

Evidence

What I checked:

  • Canonical state owner: createInitialCronState constructs all Cron state fields with fresh form, object, and array values; the submitted test helper delegates to it with connected: true before applying test overrides. (ui/src/lib/cron/index.ts:227, b82dd01ece19)
  • Full one-file diff: The diff adds the production initializer import plus shared request/job factories and replaces repeated equivalent test setup; git diff --check reported no whitespace errors. (ui/src/lib/cron/index.test.ts:29, 68daa44494b1)
  • Existing coverage retained: Both main and PR head contain 77 direct test registrations, while specialized request handlers remain for list totals, request failures, deferred races, and null-clearing paths. (ui/src/lib/cron/index.test.ts:2255, 68daa44494b1)
  • Feature history: git blame attributes the current initializer to Peter Steinberger’s commit, and recent Cron test history includes adjacent fixes by Peter Steinberger, Masato Hoshino, and xingzhou. (ui/src/lib/cron/index.ts:227, 9a2930437352)
  • Protected active item: The supplied PR context records a maintainer label and assignment to steipete on August 1, 2026; protected-label policy requires explicit maintainer handling.

Likely related people:

  • steipete: Git blame attributes createInitialCronState to Peter Steinberger, and the supplied timeline assigns this PR to steipete. (role: initializer author and current assignee; confidence: high; commits: 9a2930437352, 68daa44494b1; files: ui/src/lib/cron/index.ts, ui/src/lib/cron/index.test.ts)
  • Masato Hoshino: Recent history shows a Control UI Cron interval-preservation fix in the affected test/controller area. (role: recent adjacent contributor; confidence: medium; commits: bbaaac4b449b; files: ui/src/lib/cron/index.test.ts)
  • xingzhou: Recent history shows Cron decimal-validation work in the same controller test surface. (role: recent adjacent contributor; confidence: medium; commits: 0c067fbfa46b; files: ui/src/lib/cron/index.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 99f9c43 into main Aug 1, 2026
85 of 91 checks passed
@steipete
steipete deleted the codex/goal100k-ui-cron-controller-fixtures-0801-2d45 branch August 1, 2026 21:40
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant