Skip to content

fix(ci): notebook sync readiness signal, lightweight fixture deps#714

Merged
rgbkrk merged 4 commits intomainfrom
ci/verify-stability
Mar 12, 2026
Merged

fix(ci): notebook sync readiness signal, lightweight fixture deps#714
rgbkrk merged 4 commits intomainfrom
ci/verify-stability

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 11, 2026

Three changes to make CI reliable:

data-notebook-synced attribute — NotebookView exposes a data attribute when Automerge sync is complete and cells are rendered. E2E tests wait for this signal instead of polling for cell DOM elements with arbitrary timeouts. Fixes the flaky "element not existing after 5000ms" failures where kernel idle arrived before cells materialized.

waitForNotebookSynced() helper — Replaces waitForCodeCells in executeFirstCell and the smoke test. One canonical wait function backed by a real readiness signal.

Lightweight fixture deps — Replaced pandas, numpy, scipy, matplotlib, seaborn with httpx and markupsafe across all fixture project files. These fixtures test environment detection and kernel launch, not data science imports. Heavy deps added 30+ seconds of install time on CI, causing timeout flakes in the pyproject integration test.

PR submitted by @rgbkrk's agent Quill, via Zed

rgbkrk added 4 commits March 11, 2026 15:03
The smoke spec queries for code cells directly without using
executeFirstCell from helpers, so it missed the waitForCodeCells
fix from PR #709. Same root cause — kernel idle arrives before
cells materialize from Automerge sync.
NotebookView now exposes data-notebook-synced and data-cell-count
attributes on its container. data-notebook-synced is true when
isLoading is false and cells have rendered — the canonical signal
that Automerge sync is complete.

E2E tests use waitForNotebookSynced() instead of polling for cell
DOM elements with arbitrary timeouts. This replaces waitForCodeCells
in executeFirstCell and the smoke test.
pandas, numpy, scipy, matplotlib, seaborn → httpx, markupsafe.

These fixtures exist to test environment detection and kernel launch,
not data science imports. Heavy deps add 30+ seconds of install time
on CI cold runners, causing timeout flakes in integration tests.
@rgbkrk rgbkrk changed the title docs(sync): add Phase A module doc, verify CI stability fix(ci): notebook sync readiness signal, lightweight fixture deps Mar 11, 2026
@rgbkrk rgbkrk requested a review from Copilot March 11, 2026 23:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves CI reliability by adding a deterministic “notebook is ready” signal for E2E tests and by slimming down Python fixture dependencies to reduce install time and timeout flakiness.

Changes:

  • Exposes a data-notebook-synced attribute on NotebookView and adds a waitForNotebookSynced() E2E helper to wait on that signal.
  • Updates E2E specs to use the new wait helper and switches dependency-import assertions from heavy DS libs to lightweight packages.
  • Replaces heavy fixture dependencies (numpy/pandas/matplotlib/etc.) with httpx/markupsafe across fixture manifests and related tests.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/notebook/src/components/NotebookView.tsx Adds DOM data attributes used as an E2E readiness signal.
e2e/helpers.js Introduces waitForNotebookSynced() and updates executeFirstCell() to use it.
e2e/specs/smoke.spec.js Uses the new notebook-synced wait before interacting with cells.
e2e/specs/uv-pyproject.spec.js Updates the pyproject dependency import check to httpx.
e2e/specs/untitled-pyproject.spec.js Updates the pyproject dependency import check to httpx.
e2e/specs/conda-inline.spec.js Updates the conda-inline dependency import check to markupsafe.
python/runtimed/tests/test_daemon_integration.py Updates pyproject auto-detection integration assertion to import httpx.
crates/notebook/src/pyproject.rs Updates fixture-based parsing assertions to match new fixture deps.
crates/runtimed/src/notebook_sync_client.rs Adds module-level docs describing confirm_sync usage.
crates/notebook/fixtures/sample-project/pyproject.toml Replaces DS deps with lightweight deps (httpx, markupsafe).
crates/notebook/fixtures/conda-project/environment.yml Replaces DS deps with markupsafe.
crates/notebook/fixtures/audit-test/pyproject-project/pyproject.toml Replaces DS deps with httpx.
crates/notebook/fixtures/audit-test/pixi-project/pixi.toml Replaces DS deps with markupsafe.
crates/notebook/fixtures/audit-test/conda-env-project/environment.yaml Replaces DS deps with markupsafe.
crates/notebook/fixtures/audit-test/3-conda-inline.ipynb Updates inline conda deps metadata to markupsafe.
crates/notebook/fixtures/audit-test/4-both-deps.ipynb Updates inline conda deps metadata to markupsafe.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

ref={containerRef}
className="flex-1 overflow-y-auto overflow-x-clip overscroll-x-contain py-4 pl-8 pr-4"
style={{ contain: "paint" }}
data-notebook-synced={!isLoading && cells.length > 0}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

data-notebook-synced is computed as !isLoading && cells.length > 0, which means it will never become true for a legitimately empty notebook once loading finishes (cells rendered = empty state). This conflates “sync/loading complete” with “has at least one cell” and can block any E2E wait that wants to proceed on an empty-but-loaded notebook (e.g., before clicking “Add code cell”). Consider separating these concerns (e.g., a data-notebook-loaded={!isLoading} readiness signal plus using data-cell-count when a test specifically needs cells), or adjust the attribute naming/logic so an empty notebook can still be considered ready.

Suggested change
data-notebook-synced={!isLoading && cells.length > 0}
data-notebook-synced={!isLoading}

Copilot uses AI. Check for mistakes.
Comment on lines +59 to 60
await typeSlowly("import markupsafe; print(markupsafe.__version__)");
await browser.keys(["Shift", "Enter"]);
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This test now imports markupsafe; the nearby comment that gives an example version string still references a numpy-style version ("1.26.4"). Please update that example to a MarkupSafe-appropriate version to avoid confusion when debugging CI failures.

Copilot uses AI. Check for mistakes.
@rgbkrk rgbkrk marked this pull request as ready for review March 12, 2026 00:08
@rgbkrk rgbkrk merged commit ad05b4d into main Mar 12, 2026
21 checks passed
@rgbkrk rgbkrk deleted the ci/verify-stability branch March 12, 2026 00:08
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