Skip to content

Fix MV3 CI failures and harden CI workflows - #280

Merged
guyghost merged 2 commits into
developfrom
guyghost-fix-ci-and-harden-workflows
Jul 29, 2026
Merged

Fix MV3 CI failures and harden CI workflows#280
guyghost merged 2 commits into
developfrom
guyghost-fix-ci-and-harden-workflows

Conversation

@guyghost

Copy link
Copy Markdown
Owner

Summary

CI was failing on develop from two distinct causes. This PR fixes both and tightens the supply-chain posture of the workflows.

  • Flaky DevToolsActivePort poll (intermittent). waitForDevToolsEndpoint polls every 2ms. Real Chromium (and Node writeFile) do open(O_TRUNC) then write() non-atomically, so during the mid-write window the file exists at 0 bytes. parseDevToolsActivePort('') threw "exactly two canonical lines", an error outside the retry set (ENOENT, DEVTOOLS_ENDPOINT_CHANGED), which made the failure fatal. Added EndpointEmptyDuringCaptureError (DEVTOOLS_ENDPOINT_EMPTY), a stat.size === 0 guard, and admitted it to the retry set. A deterministic regression test reproduces the empty mid-write file and confirms the poller waits for content to land (15/15 stable repeats).
  • Stale onboarding assertion (consistent). navigation.test.ts asserted getByText('Premier lancement'), copy that only exists in the now-orphaned OnboardingWizard.svelte (zero imports since the machine-driven onboarding redesign). Repointed the assertion at the real welcome hero heading rendered by OnboardingWelcome, and updated the mv3-packaged-harness and packaged-tab-scenarios models to match (Model -> Review -> Implement -> Verify).
  • CI hardening. playwright.mv3.config.ts went from retries: 0 to retries: CI ? 1 : 0, so a single Chromium/MV3-lifecycle flake no longer fails the gate while a consistent bug still fails on both attempts (mirrors the browser-e2e config). release.yml was the only workflow still using floating major-version tags (@vN); all 7 actions are now pinned to verified commit SHAs (annotated tags dereferenced to their commits), consistent with ci.yml and connector-health.yml. Zero floating version tags remain across all workflows.

Verification

  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build

Targeted: tests/unit/mv3/devtools-endpoint.test.ts passes 24/24, stable across 15 deterministic repeats.

Note on pnpm test: the full extension unit suite reports 26 failures, all in four release-artifact files (canonical-artifact, mv3-artifact, package-sealed-dist, verify-release-artifact), all with TREE_ROOT_INVALID: Descriptor scanner interpreter is not an attested native binary. This is a pre-existing macOS-host quirk in the release-integrity attestation subsystem, untouched by this PR (none of these files are in the change set). These same tests pass in CI; the latest develop run had Quality PASSED.

Checklist

  • No secrets, cookies, session tokens, or generated release artifacts committed
  • Core code remains pure; I/O stays in shell modules
  • Svelte changes use Svelte 5 runes only (N/A - no Svelte changes in this PR)
  • Documentation updated when behavior or setup changes (both .model.md files updated to match the corrected assertion and the empty-file retry semantics)

guyghost and others added 2 commits July 29, 2026 22:13
…ing assertion

The DevToolsActivePort poller (2ms cadence) hit Chromium's non-atomic
write window: the file exists at 0 bytes while open(O_TRUNC)->write() is
in flight, so parseDevToolsActivePort('') threw "exactly two canonical
lines" - an error outside the retry set (ENOENT, DEVTOOLS_ENDPOINT_CHANGED),
making the failure fatal. Add EndpointEmptyDuringCaptureError
(DEVTOOLS_ENDPOINT_EMPTY), guard on stat.size === 0, and admit it to the
retry set. A deterministic regression test reproduces the empty mid-write
window and confirms the poller waits for content to land.

The cold-boot onboarding test asserted 'Premier lancement', copy that only
exists in the orphaned OnboardingWizard.svelte (zero imports since the
machine-driven redesign). Point the assertion at the real welcome hero
heading rendered by OnboardingWelcome, and update the harness/scenario
models to match.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The packaged MV3 gate drives a real Chromium + MV3 service-worker
lifecycle, which has inherent transient failure modes (the
DevToolsActivePort empty-write race fixed separately is one example).
Set retries to 1 under CI (0 locally) so a single flake no longer fails
the gate while a consistent bug still fails on both attempts - mirroring
the browser-e2e config.

Pin every action in release.yml to its verified commit SHA (dereferenced
through annotated tags where needed). release.yml was the only workflow
still using floating major-version tags (@vn), leaving it exposed to
tag-repointing and inconsistent with ci.yml/connector-health.yml. Zero
floating version tags remain across all workflows.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 20:22
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pulse Ready Ready Preview Jul 29, 2026 8:23pm
pulse-dashboard Ready Ready Preview Jul 29, 2026 8:23pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses two CI breakages in the MV3 Playwright harness (a flake in DevToolsActivePort polling and a stale onboarding assertion) and hardens CI/release workflows by reducing flake sensitivity and pinning GitHub Actions to commit SHAs.

Changes:

  • Treat a zero-byte DevToolsActivePort file as a transient state (DEVTOOLS_ENDPOINT_EMPTY) and retry polling until content lands, with a regression unit test.
  • Update the packaged onboarding E2E assertion to target the real OnboardingWelcome hero heading and align the packaged harness/scenario models.
  • Improve CI robustness/hardening: enable 1 retry for MV3 Playwright runs in CI and pin all actions in release.yml to verified commit SHAs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/extension/tests/unit/mv3/devtools-endpoint.test.ts Adds regression coverage for the empty mid-write DevToolsActivePort admission window.
apps/extension/tests/mv3/harness/devtools-endpoint.ts Introduces DEVTOOLS_ENDPOINT_EMPTY and retries empty-file reads during endpoint polling.
apps/extension/tests/e2e-extension/navigation.test.ts Replaces a stale onboarding copy assertion with a stable hero-heading assertion.
apps/extension/src/models/packaged-tab-scenarios.model.md Updates the packaged scenario spec to reflect the new onboarding assertion semantics.
apps/extension/src/models/mv3-packaged-harness.model.md Documents that zero-byte DevToolsActivePort files are retried like ENOENT during polling.
apps/extension/playwright.mv3.config.ts Enables a single retry in CI to absorb transient MV3/Chromium lifecycle flakes.
.github/workflows/release.yml Pins previously floating GitHub Actions versions to specific commit SHAs.

@guyghost
guyghost merged commit 6829696 into develop Jul 29, 2026
8 of 9 checks passed
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