Skip to content

[v3-2-test] Only force the full test matrix on API changes when the contract changes (#68060)#68084

Merged
potiuk merged 2 commits into
v3-2-testfrom
backport-d452d27-v3-2-test
Jun 6, 2026
Merged

[v3-2-test] Only force the full test matrix on API changes when the contract changes (#68060)#68084
potiuk merged 2 commits into
v3-2-testfrom
backport-d452d27-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 5, 2026

Any change under the API directory (airflow-core/src/airflow/api_fastapi/,
the legacy api/, or their test dirs) forced full-tests-needed=true — the whole
~135-job matrix including every provider's tests. The API tree is large and
churns constantly, so this fired on ~1 in 8 PRs and was, by measurement, the
single largest source of unnecessary full-matrix runs.

But only the API contract changing ripples broadly: the generated OpenAPI
spec (consumed by the UI codegen and the generated clients). Plain API
source/test edits that leave the committed spec untouched do not — and a prek
hook regenerates and verifies the spec, so an unchanged spec reliably means an
unchanged contract.

Narrow the full-tests trigger from API_FILES to API_CODEGEN_FILES (the
generated spec / client generator). API source edits still run the API test
type and the fab provider via run_api_tests; they just no longer drag in the
full provider matrix. Spec changes still force the full matrix.

In a 30-day sample (750 merged PRs) this spares ~63 full-matrix runs while
preserving full coverage on the 12 PRs that changed the contract.
(cherry picked from commit d452d27)

Co-authored-by: Shahar Epstein 60007259+shahar1@users.noreply.github.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

…ontract changes (#68060)

Any change under the API directory (airflow-core/src/airflow/api_fastapi/,
the legacy api/, or their test dirs) forced full-tests-needed=true — the whole
~135-job matrix including every provider's tests. The API tree is large and
churns constantly, so this fired on ~1 in 8 PRs and was, by measurement, the
single largest source of unnecessary full-matrix runs.

But only the API *contract* changing ripples broadly: the generated OpenAPI
spec (consumed by the UI codegen and the generated clients). Plain API
source/test edits that leave the committed spec untouched do not — and a prek
hook regenerates and verifies the spec, so an unchanged spec reliably means an
unchanged contract.

Narrow the full-tests trigger from API_FILES to API_CODEGEN_FILES (the
generated spec / client generator). API source edits still run the `API` test
type and the `fab` provider via run_api_tests; they just no longer drag in the
full provider matrix. Spec changes still force the full matrix.

In a 30-day sample (750 merged PRs) this spares ~63 full-matrix runs while
preserving full coverage on the 12 PRs that changed the contract.
(cherry picked from commit d452d27)

Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The backported tests expected mypy-shared-state in the skip-prek-hooks
output, but the shared/state distribution does not exist on v3-2-test,
so that hook is never generated. Drop mypy-shared-state from the two
expected skip-prek-hooks strings so the API-matrix selective-check tests
pass on this branch.
@potiuk potiuk merged commit 4af2a3a into v3-2-test Jun 6, 2026
190 of 191 checks passed
@potiuk potiuk deleted the backport-d452d27-v3-2-test branch June 6, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants