Skip to content

Fix deterministic Scheduled full regression workflow failures #143

Description

@alexeygrigorev

Outcome

Restore the dedicated Scheduled full regression workflow so a selected run can complete every required component, retain valid digest-bound evidence, and become a trustworthy coverage anchor again. The correction is workflow/test-infrastructure only; product behavior and the deployed runtime remain unchanged.

Authority and exact baseline

The accepted planner is authoritative. For an empty scheduled diff at this base it selects profile=full, browser_profile=core, Django command make test, and Playwright command make test-playwright-core. The current drift API intentionally permits a fresh GitHub Actions component to record a newer patch revision of the same hosted-runner image family while retaining the component's actual concrete image in its envelope; different families, local runners, or any other environment change still fail closed.

Confirmed failing boundary

  • Latest scheduled run: https://github.com/DataTalksClub/website/actions/runs/31662645190 — terminal failure at exact SHA c86120e673b80068df541e95a8965531915bacea.
  • Same-SHA push run: https://github.com/DataTalksClub/website/actions/runs/31655624461 — terminal success, including quality, Django, Playwright, container, aggregate gate, publish, and deploy.
  • The scheduled selector chose run_full with reason=retry_after_failure; its retained plan and selector envelope are valid and record one assertion.
  • Successful scheduled components: container (12 retained assertions), migrations (16 tests), and factories (139 tests).
  • full-regression and scheduled-gate failed only because required upstream components were non-successful. Their fail-closed behavior is correct and must be preserved.

Three independent deterministic workflow defects are confirmed:

  1. Runner drift was not propagated to the scheduled workflow. The selector planned ubuntu24@20260720.247.2; the quality job ran on ubuntu24@20260810.271.1. The complete quality command passed, including 502 CI-policy tests, but environment capture failed with VerificationError: executing component environment does not match the authorized plan. The same-workflow drift flags added to .github/workflows/ci.yml at c86120e are absent from the corresponding scheduled environment-capture and evidence-recording calls.
  2. Scheduled component checkouts are shallow. Compatibility passed 304 tests and Django discovered 1,759 tests, then content.tests.test_event_description_bridge.PublicEventDescriptionTests.test_projection_preserves_baseline_identity_and_empty_rollback_is_luma_free failed because scripts.build_event_description_bridge._load_projection_events() could not read 4cad269d576217679ac6c9ce02286e7939d8b043:content/public_projection/events.json. The selector checkout has full history, but the Django checkout defaults to depth 1. Parallel-test teardown then emitted the secondary TypeError: cannot pickle 'traceback' object; it is not a separate root cause.
  3. Scheduled Playwright bypasses the plan's exact command binding. The workflow ran make test-playwright; 177 tests passed with 3 deselected. Recording then failed with ci.evidence.EvidenceError: evidence command does not match the verification plan because the retained plan authorizes make test-playwright-core.

The green same-SHA push run and successful raw component commands rule out a product/runtime regression, production-data problem, GitHub outage, or flaky-test explanation. Rerunning this unchanged workflow is not a correction: the shallow history and Playwright command mismatch are deterministic, and runner allocation could only mask the first defect.

Scope

Expected change surface is deliberately limited to:

  • .github/workflows/scheduled-full-regression.yml;
  • ci/tests/test_workflows.py.

Implement all of the following:

  • Pass --allow-hosted-runner-drift symmetrically to every scheduled fresh evidence-producing component's ci.verification environment and ci.verification record invocation: selector, quality, evidence validation, Django, Playwright, and container. Keep the actual concrete component environment in each envelope.
  • Make every actions/checkout@v4 step in the scheduled workflow check out exact ${{ github.sha }} with fetch-depth: 0. This includes component and aggregate/gate jobs, so history-dependent verification cannot vary by job checkout depth.
  • Run and record exactly make test-playwright-core, matching the current shared plan. Do not change planner policy to authorize the broader suite for this repair.
  • Extend workflow-contract coverage so these three properties cannot drift independently again, while retaining the existing fail-closed gate, evidence, permissions, concurrency, and no-deployment assertions.

If implementation requires a change to ci/evidence.py, ci/verification.py, ci/ownership.json, planner policy, application code, dependencies, or the Make target contracts, return to PM before expanding scope: current main already supplies the required APIs and commands.

Non-goals

  • No Django application, model, migration, template, static asset, public page, Studio/admin API, or deployed-runtime behavior change.
  • No change to the ownership graph, evidence schema, environment-matching semantics, validity/reuse policy, four-bucket report, or accepted Run change-selective CI with four-hour full regression #104/Reuse digest-bound QA evidence without weakening coverage #113 selection policy.
  • No test deletion, quarantine, expectation weakening, or change to the Ship reviewed event descriptions without public Luma CTAs #131 accepted-baseline/rollback contract.
  • No change to cron, concurrency, history-anchor selection, artifact retention, normal push CI, publish/deploy/probe behavior, AWS authority, secrets, or production data.
  • No new scheduled workflow_dispatch trigger and no rerun of the known-broken SHA as evidence of a fix.
  • No product screenshots: this internal workflow/test-infrastructure change has render_impact=false; screenshots are not_applicable.

Dependencies

No open dependency blocks implementation. #104 and #113 are accepted baselines already present on main; the same-family hosted-runner drift API is present at c86120e. #131 supplies the existing history-dependent regression test that exposed the shallow checkout, but no #131 behavior changes in this issue.

Acceptance criteria

  • Every scheduled ci.verification environment and matching ci.verification record call for selector, quality, evidence validation, Django, Playwright, and container explicitly opts into same-workflow hosted-runner drift; contract tests fail if either half is missing.
  • Fresh same-family hosted-runner patch drift can produce a valid envelope containing the component's actual concrete runner image, while a different runner family, local runner, or any other environment difference remains rejected by the existing evidence contract.
  • Every scheduled checkout is pinned to exact ${{ github.sha }} with fetch-depth: 0; the Django job can resolve commit 4cad269d576217679ac6c9ce02286e7939d8b043 and content/public_projection/events.json from that commit.
  • Scheduled Playwright executes and records byte-for-byte make test-playwright-core, equal to the shared planner-authorized command for browser_profile=core; the workflow does not authorize itself by changing planner policy.
  • A selected scheduled run still requires successful selector, quality, factories, migrations, Django, Playwright, container, full-regression, and scheduled-gate outcomes. Missing, malformed, mismatched, or failed component evidence cannot create an aggregate envelope or coverage anchor.
  • The scheduled workflow retains contents: read plus actions: read only, exact cron/queued concurrency, and no environment, service, id-token, AWS, publish, deploy, probe, production-data, or repository-write authority.
  • Focused workflow/evidence contract tests and the graph-selected full local verification pass. The candidate changes only the scheduled workflow and CI contract tests, with screenshots explicitly not_applicable.
  • After merge, normal push CI is terminal green and one fresh naturally scheduled run at that exact merged main SHA is terminal green with valid retained component and aggregate evidence. A manual-equivalent check may supplement local verification but does not replace this exact scheduled result or become an anchor.

Required BDD and contract scenarios

  1. Hosted runner patch drift: Given a plan produced on ubuntu24@A and a fresh scheduled component assigned ubuntu24@B, when that component captures and records its environment, then the scheduled invocation explicitly allows same-family patch drift and retains ubuntu24@B; when family/locality or another dimension differs, the existing validator rejects it.
  2. Symmetric invocation coverage: Given each scheduled evidence-producing job, when workflow YAML is parsed, then every environment-capture call and every matching record call contains the explicit drift flag. Omitting the flag from either side fails make test-ci.
  3. History-dependent Django: Given exact scheduled SHA c86120e... and the Ship reviewed event descriptions without public Luma CTAs #131 baseline revision, when the scheduled Django checkout is established, then both the exact head and 4cad269d...:content/public_projection/events.json are resolvable before make test; all other scheduled checkouts use the same full-history exact-SHA contract.
  4. Exact browser command: Given the retained plan has browser_profile=core, when the scheduled Playwright job runs and records evidence, then both command strings are exactly make test-playwright-core. A workflow/plan or execution/recording mismatch fails the contract test and evidence recording.
  5. Fail-closed aggregation: Given any required job failure, missing artifact, malformed envelope, command/environment mismatch, or incomplete component set, when full-regression and scheduled-gate evaluate the run, then both fail and no scheduled state anchor is retained. Given all valid components, both may succeed.
  6. Least privilege and product preservation: Given the corrected workflow, when its contract is inspected, then cron, queueing, read-only permissions, absence of deployment/cloud authority, and exact component dependencies are unchanged; the git diff contains no product/runtime/template/model/migration/dependency change.

Verification and handoff

Engineering must follow the versioned plan/report workflow from _docs/PROCESS.md, including exact base/head, graph and plan digests, four buckets, commands/counts, and frozen uncommitted handoff. At minimum, run the focused workflow/evidence tests through make test-ci; the graph-derived full verification remains authoritative for this .github/**/test-infrastructure change.

Independent QA must recompute the plan from the frozen base/head, inspect the complete diff, run every planned rerun, and directly verify all acceptance criteria. Screenshots must be reported as not_applicable, not pending or silently omitted.

After tester PASS and product acceptance, commit with Refs #143 and deliver through the repository's local merge process. On-call first observes the exact push CI run. Keep #143 open until a later naturally scheduled run executes at the exact merged SHA and the selector, quality, factories, migrations, Django, Playwright, container, full-regression, and scheduled-gate jobs are all successful. Inspect the retained envelopes/report for exact source SHA, commands, concrete environment identities, counts, artifact digests, and a successful scheduled state. The scheduled workflow must not publish or deploy. Close #143 only after that automated operational gate passes; no human label is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must-have or release-blockingbugSomething isn't workinginfraArea: infraoperationsArea: operationstestingArea: testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions