Skip to content

ci(python): run PR static, unit and Airflow API checks in one job - #38691

Merged
tutte merged 3 commits into
ci-python-option2from
ci-python-single-pr-job
Nov 25, 2026
Merged

tutte merged 3 commits into
ci-python-option2from
ci-python-single-pr-job

Conversation

@tutte

@tutte tutte commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • ci-pr.yml: py-static-checks, python-unit and airflow-apis are merged into one python job. It runs for every non-draft PR. Each suite is a step gated by the plan outputs and uses !cancelled(), so a failure in one suite doesn't skip the others. A final step checks the step results and exposes the outcome as a job output. On same-repo PRs, LouisBrunner/checks-action (v3.1.0, pinned SHA) publishes py-checkstyle and, only when that step ran, airflow-apis. The required py-tests-status is a small ubuntu-slim job that checks the plan result, the python job result and its check output.
  • reusable-py-unit.yml and reusable-py-airflow-apis.yml are now the composite actions .github/actions/python-unit and .github/actions/python-airflow-apis. Each caller does the checkout. Inputs are unchanged except ref, which moved to the caller's checkout.
  • ci-merge-queue.yml and ci-nightly.yml keep their separate jobs and matrices, but each job now runs checkout and then the composite action.
  • .github/python-ci/paths.yml filters the new action directories in place of the deleted workflows.
  • test_python_ci.py checks artifact-name uniqueness against the unit action's steps.
  • The ADR 2026-11-11-python-ci-selects-workloads-by-event gets a v4 revision describing this layout.

Notes

  • In the PR job the steps switch Python versions: static checks use the lowest version, unit tests the highest, and Airflow APIs the lowest. Each composite runs setup-python again, so the interpreter on PATH matches each suite.
  • Fork PRs get a read-only GITHUB_TOKEN, so they skip publishing py-checkstyle and airflow-apis; py-tests-status still gates them as a job.
  • py-tests-status runs on every non-draft PR, not only on forks. A job skipped by if reports success, and because it finishes later it would override a failing check of the same name.

Testing

  • pytest .github/scripts/tests/test_python_ci.py (49 passed; the gate fixture covers the python job's check step and both py-tests-status jobs, and a new test asserts the check step covers every suite step) and ingestion/tests/cli_e2e_v2/meta/test_ci_workflow.py (9 passed)
  • All edited YAML parses. I couldn't run actionlint locally, so this PR's own CI run is the end-to-end check.

🤖 Generated with Claude Code

Convert reusable-py-unit.yml and reusable-py-airflow-apis.yml into the
python-unit and python-airflow-apis composite actions. ci-pr.yml runs
static checks, unit tests and Airflow API tests as conditional steps of a
single python job; merge-queue and nightly call the actions from their own
jobs.
@tutte
tutte requested review from a team, akash-jain-10 and harshach as code owners November 25, 2026 13:26
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

if: ${{ needs.plan.outputs.static == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 120

@gitar-bot gitar-bot Bot Nov 25, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: New 120-minute PR job timeout is not stated in the ADR

ci-pr.yml now gives the merged python job timeout-minutes: 120. Before, there were separate budgets: 60 minutes for py-static-checks plus each reusable workflow's own timeout. The v4 revision of docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md covers the single-job layout and the !cancelled() behaviour, but it says nothing about this timeout or how it was picked. One wall-clock limit now covers static checks, model preparation, the unit suite and the Docker/Maven stack startup for Airflow APIs (which can take up to 60 minutes on its own). If the limit is too low, a PR that selects every suite gets cancelled, and the later suites lose their results.

The record would state: "The single python PR job has a 120-minute timeout, sized to cover static checks plus unit tests plus Airflow API stack startup and tests running one after another." Add that sentence to the v4 paragraph, or change the budget to match whatever the real rule is.

Record the timeout rationale in the v4 ADR paragraph:

`python` job, and later suites still run after an earlier step fails. That job's 120-minute
timeout covers static checks, unit tests and Airflow API stack startup and tests run in sequence.
Merge-queue and nightly keep separate jobs.

Was this helpful? React with 👍 / 👎

Drop the py-tests-status aggregate job from ci-pr.yml. The python job now
always runs for non-draft PRs, verifies the selected step results in a
final step, and publishes py-checkstyle, py-tests-status and (when the
Airflow API step ran) airflow-apis through LouisBrunner/checks-action.
Comment thread .github/workflows/ci-pr.yml Resolved
Fork PRs get a read-only token and cannot create check runs. The
py-tests-status job verifies the python job and its gate output on every
non-draft PR. It is never skipped, because a skipped job reports success
and would override a failing check of the same name. The python job
publishes py-checkstyle and airflow-apis only when its token can write
checks.
@gitar-bot

gitar-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 🟡 Medium risk 2 closed / 3 findings

Consolidating Python PR suites and replacing their status checks changes CI gating; a reporting error could misstate validation and block or permit a merge.

Merges the PR static checks, unit tests and Airflow API checks into one python job with per-suite gated steps, and adds a py-tests-status gate job that works on fork PRs. Consider documenting the new 120-minute python job timeout in the v4 ADR revision, since it covers static checks, unit tests and Airflow API stack startup in sequence.

💡 Quality: New 120-minute PR job timeout is not stated in the ADR

📄 .github/workflows/ci-pr.yml:67 📄 docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:52-57

ci-pr.yml now gives the merged python job timeout-minutes: 120. Before, there were separate budgets: 60 minutes for py-static-checks plus each reusable workflow's own timeout. The v4 revision of docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md covers the single-job layout and the !cancelled() behaviour, but it says nothing about this timeout or how it was picked. One wall-clock limit now covers static checks, model preparation, the unit suite and the Docker/Maven stack startup for Airflow APIs (which can take up to 60 minutes on its own). If the limit is too low, a PR that selects every suite gets cancelled, and the later suites lose their results.

The record would state: "The single python PR job has a 120-minute timeout, sized to cover static checks plus unit tests plus Airflow API stack startup and tests running one after another." Add that sentence to the v4 paragraph, or change the budget to match whatever the real rule is.

Record the timeout rationale in the v4 ADR paragraph
`python` job, and later suites still run after an earlier step fails. That job's 120-minute
timeout covers static checks, unit tests and Airflow API stack startup and tests run in sequence.
Merge-queue and nightly keep separate jobs.
✅ 2 closed
✅ Bug: Required py-tests-status never appears on fork PRs

📄 .github/workflows/ci-pr.yml:69-71 📄 .github/workflows/ci-pr.yml:128-142 📄 .github/workflows/ci-pr.yml:13-23
ci-pr.yml runs on pull_request, and for PRs from forks GitHub hands out a read-only GITHUB_TOKEN no matter what the job-level checks: write says. So the three LouisBrunner/checks-action steps fail with 403 and py-tests-status is never created. Before this commit, py-tests-status was a job, so it reported for every PR. Now branch protection keeps waiting for a check that never comes, and every external contributor's PR is blocked. The description mentions this but doesn't fix it. A fix: keep a real py-tests-status job that needs: python and reads a job output set from steps.gate.outcome, which works with a read-only token. Alternatively, publish the checks from a workflow_run-triggered workflow that has write permissions.

✅ Quality: ADR leaves out the branch-protection and fork rules for py-tests-status

📄 docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:55-58 📄 .github/workflows/ci-pr.yml:146-154
This commit turns the required py-tests-status from a job into a Checks API check run. The v4 revision of the ADR says it is published through the Checks API, but it doesn't record the rules the description states. The description says the check "must not be pinned to the GitHub Actions app as its source" and that on fork PRs "the required py-tests-status check would never show up". The repository squash-merges, so these rules would exist only in the PR description. Add a sentence to the record saying: "Branch protection requires py-tests-status by name without pinning its source app, and PRs from forks, which get a read-only token, do not receive the check (or: receive it through <mechanism>)."

🤖 Prompt for agents
Code Review: Merges the PR static checks, unit tests and Airflow API checks into one `python` job with per-suite gated steps, and adds a `py-tests-status` gate job that works on fork PRs. Consider documenting the new 120-minute `python` job timeout in the v4 ADR revision, since it covers static checks, unit tests and Airflow API stack startup in sequence.

1. 💡 Quality: New 120-minute PR job timeout is not stated in the ADR
   Files: .github/workflows/ci-pr.yml:67, docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:52-57

   `ci-pr.yml` now gives the merged `python` job `timeout-minutes: 120`. Before, there were separate budgets: 60 minutes for `py-static-checks` plus each reusable workflow's own timeout. The v4 revision of `docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md` covers the single-job layout and the `!cancelled()` behaviour, but it says nothing about this timeout or how it was picked. One wall-clock limit now covers static checks, model preparation, the unit suite and the Docker/Maven stack startup for Airflow APIs (which can take up to 60 minutes on its own). If the limit is too low, a PR that selects every suite gets cancelled, and the later suites lose their results.
   
   The record would state: "The single `python` PR job has a 120-minute timeout, sized to cover static checks plus unit tests plus Airflow API stack startup and tests running one after another." Add that sentence to the v4 paragraph, or change the budget to match whatever the real rule is.

   Fix (Record the timeout rationale in the v4 ADR paragraph):
   `python` job, and later suites still run after an earlier step fails. That job's 120-minute
   timeout covers static checks, unit tests and Airflow API stack startup and tests run in sequence.
   Merge-queue and nightly keep separate jobs.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@tutte
tutte merged commit 20f4322 into ci-python-option2 Nov 25, 2026
34 of 38 checks passed
@tutte
tutte deleted the ci-python-single-pr-job branch November 25, 2026 14:10
tutte added a commit that referenced this pull request Nov 25, 2026
* Refactor Python CI into event-owned workflows

* Simplify Python CI actions and workflow policy

* Align composite action metadata and names

* Separate Python setup and normalize CI workflows

* Remove redundant connector status and fixture cache input

* Keep test reporting independent of execution

* Share pinned uv setup across local and CI commands

* Simplify Python type checks and nightly helper tests

* Reuse loaded Python environment profiles

* Match nightly coverage producers to main

* Simplify host Python environment preparation

* Simplify Python CI orchestration and preserve pytest exit codes

* Remove redundant Python CI generation and outputs

* Consolidate coverage reporting and remove unused Python CI interfaces

* Simplify reusable CI jobs and clarify workflow responsibilities

* Simplify Python CI and tooling regression tests

* Reduce Python CI runners and repeated setup

* Fix Python CI routing and coverage selection

* Unify Python static check preparation

* Share connector builds and reduce Python CI setup

* Restore Ubuntu 24.04 for Playwright workflows

* Trim Python failure diagnostics

* Run Python lint before type preparation

* Skip redundant Python coverage reports

* Skip successful Python log processing

* Separate test stack startup from Python preparation

* Enable Corepack for Search and SSO browser tests

* Reuse shared Python setup across workflows

* Separate Docker startup from Playwright restoration

* Revert "Separate Docker startup from Playwright restoration"

This reverts commit 8519a30.

* Remove UI coverage configuration tests

* Keep behavioral Playwright cache tests and repair their assertions

* Simplify Playwright planning tests and share summary setup

* Keep merge-queue gate behavior tests and combine retry reporting

* Make performance tests independent and check command status

* Test summary outcomes across supported events

* Verify retained runner diagnostics when Docker fails

* Run Airflow API tests through shared CI entry workflows

* Correct Python CI path selection

* Narrow Python CI path selection

* Simplify CI helper tests

* Rename Python static check jobs

* Share backend image across Python CI runners

* Use generic names for the shared backend image

* Run Python tooling checks only in nightly CI

* Optimize nightly reporting and coverage

* Extract Python Sonar composite action

* Rename classification preparation jobs

* Reduce unnecessary Python PR work

* Remove draft conversion trigger

* Share CLI E2E execution through Nox

* Use configured Python version for operator validation

* Move operator image validation to nightly

* Record shared Java version follow-up

* Remove deferred Java setup note from workflow

* Avoid test compilation in backend image builds

* Remove ingestion image producer disk cleanup

* Reduce Airflow API backend preparation work

* Always reuse the shared CLI ingestion image

* Use configured highest Python for dependency reports

* Move validation workflow follow-up out of source

* Simplify CLI workflow checks and follow caller inputs

* Trim redundant CLI contract inventory tests

* Move release version checks into tooling tests

* Remove unused Python source Makefile variables

* Narrow Nox tool environments and simplify coverage

* Simplify Python test dependencies and fix Airflow arguments

* Derive Sonar Python versions from shared project configuration

* Fix release stamping and CI review regressions

* Allow free-text release base branches

* Narrow Python PR selection and pass nightly tooling explicitly

* Guard the default Python unit worker count

* ci(python): run PR static, unit and Airflow API checks in one job (#38691)

* ci(python): run PR static, unit and Airflow API checks in one job

Convert reusable-py-unit.yml and reusable-py-airflow-apis.yml into the
python-unit and python-airflow-apis composite actions. ci-pr.yml runs
static checks, unit tests and Airflow API tests as conditional steps of a
single python job; merge-queue and nightly call the actions from their own
jobs.

* ci(python): report PR Python results as checks from the python job

Drop the py-tests-status aggregate job from ci-pr.yml. The python job now
always runs for non-draft PRs, verifies the selected step results in a
final step, and publishes py-checkstyle, py-tests-status and (when the
Airflow API step ran) airflow-apis through LouisBrunner/checks-action.

* ci(python): keep py-tests-status as a job so fork PRs report it

Fork PRs get a read-only token and cannot create check runs. The
py-tests-status job verifies the python job and its gate output on every
non-draft PR. It is never skipped, because a skipped job reports success
and would override a failing check of the same name. The python job
publishes py-checkstyle and airflow-apis only when its token can write
checks.

---------

Co-authored-by: Matias Puerta <matias@getcollate.io>
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