Skip to content

ci(test): build Rust extension in nav-hooks-guard before running the guard (#1752)#1753

Merged
johnrtipton merged 1 commit into
mainfrom
fix/nav-hooks-guard-maturin-build-1752
Jun 8, 2026
Merged

ci(test): build Rust extension in nav-hooks-guard before running the guard (#1752)#1753
johnrtipton merged 1 commit into
mainfrom
fix/nav-hooks-guard-maturin-build-1752

Conversation

@johnrtipton

Copy link
Copy Markdown
Contributor

Closes #1752 (item 1).

Problem

nav-hooks-guard (added in #1748, now a blocking CI gate) was the only Rust-extension-dependent job without a maturin develop build step. Its uv/.venv cache key is hashFiles('**/pyproject.toml','**/uv.lock'), so a PR that changes only crates/*.rs (no Python-dep change) restores a previously-built djust and the guard exercises old rendering behavior — a blocking render guard that can pass (or fail) against a stale extension.

Fix

Add uv run maturin develop --release after uv sync --extra dev, mirroring the python-tests and playwright-tests jobs, so the guard always tests freshly-built code.

- name: Install Python dependencies
  run: uv sync --extra dev
+ - name: Build package
+   run: uv run maturin develop --release
- name: Install Playwright

Verification

  • YAML parses; step order correct (Install deps → Build package → Install Playwright); build command byte-identical to the sibling playwright-tests job.
  • The empirical proof is this PR's own CI run: nav-hooks-guard must stay green with the build step (confirms the step works and doesn't break the job).

Follow-ups (remain in #1752)

  • Item 2: blocking-vs-continue-on-error soak for the Playwright-based guard.
  • Item 3: extract a reusable workflow to de-duplicate the ~80% shared server harness between nav-hooks-guard and playwright-tests (would prevent exactly this kind of copy-paste drift).

🤖 Generated with Claude Code

…the guard (#1752)

nav-hooks-guard was the only Rust-extension-dependent CI job without a
`maturin develop` step — it relied on the uv/.venv cache, whose key is
hashFiles(pyproject.toml, uv.lock). A PR changing only crates/*.rs would
restore a previously-built djust and exercise OLD rendering, so this now-
BLOCKING render guard could pass (or fail) against a stale extension.

Add `uv run maturin develop --release` after `uv sync`, mirroring the
python-tests and playwright-tests jobs, so the guard always tests fresh code.

Closes #1752 (item 1; items 2 blocking-soak + 3 CI-dedup remain tracked there).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johnrtipton

Copy link
Copy Markdown
Contributor Author

Code Review (pipeline-run Stage 7) — APPROVE

Single, well-scoped CI fix; closes #1752 item 1.

What it does: .github/workflows/test.yml — inserts a Build package step (uv run maturin develop --release) into nav-hooks-guard between Install Python dependencies (uv sync --extra dev) and Install Playwright, mirroring the identical step in python-tests / playwright-tests.

Correctness:

  • Step ordering right: uv sync populates the env, then maturin develop --release rebuilds the Rust extension fresh, before the server starts and the guard runs. Build command byte-identical to the sibling playwright-tests step.
  • Empirical canary (feat: improve error messages for common LiveView mistakes #252): this PR's nav-hooks-guard ran green with the new step (2m59s vs ~2m09s before — delta is the maturin build), proving the step works and doesn't break the job.

Concern / edge cases considered:

  • Cache interaction: the uv/.venv cache key is still pyproject.toml/uv.lock-only, so a crates-only PR still restores a stale .venv — but maturin develop --release rebuilds the ext on top, so correctness no longer depends on the cache key (remaining effect is a correct Python-dep cache).
  • Build-failure mode: if maturin develop fails the job fails — desired for a blocking render guard (better than testing stale code).
  • CI cost: +~50s on one job; acceptable.

Items 2 (blocking-soak) and 3 (CI dedup) remain tracked in #1752.

APPROVE

@johnrtipton johnrtipton merged commit d901b82 into main Jun 8, 2026
14 checks passed
@johnrtipton johnrtipton deleted the fix/nav-hooks-guard-maturin-build-1752 branch June 8, 2026 00:47
@johnrtipton

Copy link
Copy Markdown
Contributor Author

Retrospective — PR #1753 (#1752 item 1)

Task: add maturin develop --release to the nav-hooks-guard CI job so the blocking render guard never tests a stale cached Rust extension.

Quality: 5/5

Minimal, surgical CI fix; empirically validated by its own green CI run; mirrors the established sibling pattern exactly.

What went well

What could be improved

Verified

  • YAML valid, step order correct, build cmd matches sibling; CI fully green (nav-hooks-guard, playwright, rust, python, demo-checks). Merged squash.

RETRO_COMPLETE

johnrtipton added a commit that referenced this pull request Jun 8, 2026
…dening)

Drains #1751 (close-side </div> + scanner consolidation) and #1752 items 2-3
into v1.0.3; records #1747/#1750/#1748/#1753 already merged toward it.

Audit-bypass-reason: docs-only ROADMAP update via pipeline-drain skill (no retro needed)
johnrtipton added a commit that referenced this pull request Jun 8, 2026
…1752) (#1755)

nav-hooks-guard and playwright-tests duplicated ~9 setup steps (Python/uv/cache/
uv sync/maturin build/playwright install/migrate/start server/wait). #1753 had to
patch the missing maturin step into nav-hooks-guard precisely because the copy had
drifted. Extract the shared harness into .github/actions/djust-playwright-server
(composite); both jobs now `uses:` it after checkout, then run their own test step
+ log upload + server stop.

One definition can't drift a step out of one job (parallel-path-drift, #1646).
Both jobs keep their identity: playwright-tests stays continue-on-error (optional),
nav-hooks-guard stays blocking; test-summary wiring unchanged.

Closes #1752. Item 1 (maturin) shipped in #1753; item 2 (blocking-soak) resolved by
decision — keep nav-hooks-guard blocking (green across #1748/#1753/#1754); item 3
(this dedup).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

tech-debt: harden nav-hooks-guard CI job (maturin build, blocking-soak, dedup) — follow-up to #1748

1 participant