[py] run affected python tests per-browser on PR, full suite on schedule#17643
[py] run affected python tests per-browser on PR, full suite on schedule#17643titusfortner wants to merge 1 commit into
Conversation
Review Summary by Qodo(Agentic_describe updated until commit 79bfb73)Run affected Python tests per-browser on PR, full suite on schedule
WalkthroughsDescription• Run only affected Python tests per-browser on PR, full suite on schedule • Pass target list from main CI workflow to Python workflow via inputs • Update rerun-failures script to handle bazel query results • Remove build job dependency for test jobs, keep only on schedule/manual • Use bazel query intersection to filter tests by affected targets Diagramflowchart LR
CI["ci.yml<br/>Read Targets"] -->|"py_targets"| PY["ci-python.yml<br/>Receive targets input"]
PY -->|"Schedule/Manual"| BUILD["Build Job"]
PY -->|"PR: affected only"| REMOTE["Remote Tests<br/>bazel query intersect"]
PY -->|"PR: affected only"| BROWSER["Browser Tests<br/>bazel query intersect"]
RERUN["rerun-failures.sh<br/>Parse query results"] -.->|"Enhanced"| REMOTE
RERUN -.->|"Enhanced"| BROWSER
File Changes1. scripts/github-actions/rerun-failures.sh
|
Code Review by Qodo
1. Build job skips scheduled runs
|
|
Code review by qodo was updated up to the latest commit decdc1c |
decdc1c to
eb7cf50
Compare
|
Code review by qodo was updated up to the latest commit eb7cf50 |
| jobs: | ||
| build: | ||
| name: Build | ||
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
1. Build job skips scheduled runs 📘 Rule violation ☼ Reliability
In .github/workflows/ci-python.yml, both the build and unit-tests jobs are gated on github.event_name == 'schedule', but the workflow is only invoked via workflow_call/workflow_dispatch from .github/workflows/ci.yml, so on scheduled CI the called workflow’s event name is workflow_call and these jobs will be skipped. This can silently eliminate intended scheduled build and unit-test coverage and reduce CI safety.
Agent Prompt
## Issue description
In the reusable workflow `.github/workflows/ci-python.yml`, the `build` and `unit-tests` jobs are gated by `if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'`. When this workflow is executed via `workflow_call` from `.github/workflows/ci.yml` (including scheduled runs), `github.event_name` in the called workflow evaluates to `workflow_call`, so these jobs are skipped unintentionally.
## Issue Context
`.github/workflows/ci.yml` is the workflow that triggers on `schedule` and calls `ci-python.yml` via `uses: ./.github/workflows/ci-python.yml`. The called workflow currently has no `schedule` trigger and thus cannot ever have `github.event_name == 'schedule'`; the condition in the called workflow therefore does not reflect the caller’s trigger and prevents the scheduled build and unit-test coverage from running.
## Fix Focus Areas
- .github/workflows/ci-python.yml[15-18]
- .github/workflows/ci-python.yml[48-61]
- .github/workflows/ci.yml[3-12]
- .github/workflows/ci.yml[121-128]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
🔗 Related Issues
Part of #17539 to minimize low signal tests and duplication with RBE.
💥 What does this PR do?
Makes the Python GitHub Actions workflow run only the tests a PR or Push actually affects,
instead of the full suite on every PR. Continues to run existing tests on schedule/manual kickoff
ci.ymlnow passes the affected//pytarget list intoci-python.ymlto run only those targets for PRs and Pulls.[py]is specified in PR message or commit🔧 Implementation Notes
rerun-failures.shis shared infra (all bindings). The change is additive andbackward-compatible — it only affects run commands with a trailing
$(...), which no otherbinding uses today.
rerun-failures.shupdated to support analyzing query results🤖 AI assistance
ci.yml/ci-python.ymlworkflow changes and thererun-failures.shedit, iterated against repeated review.💡 Additional Considerations
bazel queryintersect to--test_tag_filtersafter implementing the necessary tags🔄 Types of changes