Skip to content

Refs #1745 -- Harden nav/hooks regression guard#1748

Merged
johnrtipton merged 1 commit into
djust-org:mainfrom
BaderEddineBenhirt:ticket-1745-nav-hooks-guard
Jun 8, 2026
Merged

Refs #1745 -- Harden nav/hooks regression guard#1748
johnrtipton merged 1 commit into
djust-org:mainfrom
BaderEddineBenhirt:ticket-1745-nav-hooks-guard

Conversation

@BaderEddineBenhirt

Copy link
Copy Markdown
Contributor

This PR hardens the nav/hooks regression guard.

Changes:

  • installs the hydration MutationObserver before the initial navigation using add_init_script.
  • replaces fixed asyncio.sleep waits with condition-based Playwright waits.
  • adds a dedicated nav-hooks-guard CI job so this regression guard is blocking while the broader Playwright job remains optional.

Tested locally:

  • .venv\Scripts\python tests\playwright\test_nav_hooks.py
  • git diff --check

@johnrtipton

Copy link
Copy Markdown
Contributor

Thanks @BaderEddineBenhirt for the contribution. I'll review run it through the review process.
What has your experience with djust been? Rough, smooth, problems?

@BaderEddineBenhirt

Copy link
Copy Markdown
Contributor Author

Thanks @johnrtipton for the quick response. My experience was mostly smooth. The setup with uv and the demo project was straightforward, and the existing Playwright regression script made the issue easy to understand and reproduce locally. The only slightly rough part was understanding which Playwright checks are intended to be blocking versus optional in CI. That is why I kept the broader Playwright job optional and added a dedicated blocking guard only for the nav/hooks regression.

Overall, the repo was clear to work with.

@johnrtipton johnrtipton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review (pipeline-run Stage 7) — APPROVE with follow-ups

Solid, well-motivated hardening of the #1745 nav/hooks regression guard. All 14 CI checks green (incl. the new nav-hooks-guard, 2m9s). No 🔴 blockers.

Strengths

  • Condition-based waits replace fixed asyncio.sleep — waits on real signals (__demoWidgetMountCount, the djustHookMounted DOM marker, location.pathname, mount-count delta) instead of wall-clock. Faster and far less flaky.
  • Observer installed before goto via add_init_script correctly catches the initial hydration churn (#1737) a post-goto evaluate() could miss; the late-root handling (document observer + DOMContentLoaded re-check) is sound.
  • Not greenwashing: the script return 1 on any collected failure → sys.exit(exit_code) — a real failing gate (verified).
  • Made blocking correctly: added to test-summary needs AND the success AND-condition — it genuinely gates, not just echoed.

🟡 Follow-ups (non-blocking — tracked, not gating this merge)

  1. nav-hooks-guard is the only Rust-dependent CI job without maturin develop --release. Every other ext-dependent job runs uv sync + maturin develop. This job relies on uv's .venv cache (key = hashFiles(pyproject.toml, uv.lock)), so a PR that changes only crates/*.rs (no Python dep change) would test against a stale cached extension — a blocking render guard that can silently pass on stale code. Recommend adding the maturin develop --release step. (Maintainer fast-follow.)
  2. Blocking Playwright job = flake risk to every PR's gate. playwright-tests is intentionally optional because browser jobs flake; promoting a Playwright job to blocking reintroduces that gate-wide. The condition-based waits mitigate it (good); per repo canon a new runner-only job ideally soaks continue-on-error before flipping. Green once here, so low risk — flagged for awareness.
  3. ~80% CI duplication with playwright-tests (server harness). Consider a composite action / reusable workflow to prevent drift.

Minor

  • Run step uses .venv/bin/python while siblings use uv run (cosmetic).
  • Confirm new action pins (checkout@v6, setup-uv@v7, cache@v5, upload-artifact@v7) match versions used elsewhere in this workflow.

Merging; 🟡#1–3 filed as a follow-up. Thanks for the contribution!

APPROVE

@johnrtipton johnrtipton merged commit 41b2732 into djust-org:main Jun 8, 2026
14 checks passed
@johnrtipton

Copy link
Copy Markdown
Contributor

Retrospective — PR #1748 (refs #1745)

Task: harden the nav/hooks Playwright regression guard (condition-based waits + observer-before-nav) and promote it to a blocking CI job. External contribution by @BaderEddineBenhirt.

Quality: 4/5

Well-motivated, correctly-implemented hardening; merged green with no 🔴. Held back from 5 only by the blocking-gate-without-maturin gap (#1752) that a maintainer fast-follow should close.

What went well

What didn't / to improve

Verified

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>
@johnrtipton

Copy link
Copy Markdown
Contributor

@BaderEddineBenhirt thanks for the PR, this has shipped in 1.0.3.

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.

2 participants