rusackas opened a new pull request, #40719:
URL: https://github.com/apache/superset/pull/40719
> **DRAFT — for evaluation of the mechanism.** This builds on #40718
> (the `changes` job). Please review the tradeoffs below before considering
it.
### SUMMARY
Today the E2E (Cypress + Playwright) workflow runs **in parallel** with
`pre-commit checks`. When a PR has a formatting/lint/type error that
pre-commit
catches in ~4 minutes, the Cypress shards and Playwright jobs (~15–20 min
each,
full Python+Node+asset setup) have already spun up and burned runner minutes
for
nothing.
This makes E2E run **only after `pre-commit checks` completes successfully**.
**Mechanism:**
- Trigger switches from `push`/`pull_request` to `workflow_run` on
`["pre-commit checks"]`. pre-commit itself runs on push (master/release) +
pull_request, so event coverage is preserved.
- The entry `changes` job gates on
`github.event.workflow_run.conclusion == 'success'`. On a pre-commit
failure
it — and every downstream `needs: changes` job — is **skipped**, so no
Cypress/Playwright runners are provisioned.
- `scripts/change_detector.py` gains a `workflow_run` path: it recovers the
originating event / head SHA / PR number from `WF_RUN_*` env vars (fork PRs
don't carry PR context in the payload, so they conservatively
assume-all-changed and run the full suite).
- Checkouts and the push-only `/app/prefix` matrix switch now read
`github.event.workflow_run.*` instead of the live event context.
- A new `report-status` job posts an aggregate **`E2E / required`** commit
status back onto the PR head SHA, because `workflow_run` checks don't
attach
to the PR automatically.
### TRADEOFFS TO EVALUATE (why this is a draft)
1. **Default-branch workflow file.** GitHub always uses the **master** copy
of a
`workflow_run`-triggered workflow. Edits to `superset-e2e.yml` on a PR
branch
won't take effect until merged — this very PR's changes can't be
exercised on
the PR itself.
2. **Branch protection must change.** The individual `cypress-matrix` /
`playwright-tests` checks no longer appear on PRs; **`E2E / required`**
(the
posted commit status) must become the required check instead.
3. **Fork PRs.** `workflow_run.pull_requests` is empty for forks, so they
fall
back to running the full suite (no change-detection narrowing).
### TESTING INSTRUCTIONS
Because of tradeoff #1 this can only be fully validated once on master
(behind
the branch-protection change). The `change_detector.py` `workflow_run`
routing
is unit-verifiable locally:
```
GITHUB_EVENT_NAME=workflow_run WF_RUN_EVENT=pull_request WF_RUN_PR_NUMBER=""
\
python scripts/change_detector.py --event-type workflow_run --sha x --repo
apache/superset
# -> "assuming all changed" (fork/no-PR fallback)
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]