Repository navigation
Refactor Python CI into event-owned workflows - #38105
Conversation
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
manerow
left a comment
There was a problem hiding this comment.
Thanks Pablo, both follow-ups are addressed. OK from my side, as long as py-checkstyle comes out of the merge-rules required checks at merge time and the companion PRs land together with this one.
| ref: ${{ needs.plan.outputs.ref }} | ||
| python-version: ${{ needs.plan.outputs.python-lowest }} | ||
|
|
||
| py-tests-status: |
There was a problem hiding this comment.
What is the point of this job? If the previous fail, the checks will fail and the user will get the feedback on the checks
| py-static-checks: | ||
| name: py-static-checks | ||
| needs: plan | ||
| if: ${{ needs.plan.outputs.static == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| with: | ||
| ref: ${{ needs.plan.outputs.ref }} | ||
| persist-credentials: false | ||
| fetch-depth: 1 | ||
| - name: Run Python static checks | ||
| uses: ./.github/actions/python-static-checks | ||
| with: | ||
| python-version: ${{ needs.plan.outputs.python-lowest }} | ||
| check-types: ${{ needs.plan.outputs.python }} | ||
|
|
||
| python-unit: | ||
| needs: plan | ||
| if: ${{ needs.plan.outputs.python == 'true' }} | ||
| uses: ./.github/workflows/reusable-py-unit.yml | ||
| with: | ||
| python-version: ${{ needs.plan.outputs.python-highest }} | ||
| ref: ${{ needs.plan.outputs.ref }} | ||
| collect-coverage: false | ||
| prepare-models: true | ||
|
|
||
| airflow-apis: | ||
| needs: plan | ||
| if: ${{ needs.plan.outputs.airflow-apis == 'true' }} | ||
| uses: ./.github/workflows/reusable-py-airflow-apis.yml | ||
| with: | ||
| ref: ${{ needs.plan.outputs.ref }} | ||
| python-version: ${{ needs.plan.outputs.python-lowest }} |
There was a problem hiding this comment.
Can these jobs be consolidated into 1 or max 2?
There was a problem hiding this comment.
@tutte most of the PRs will either run python-unit or airflow-apis. Can we keep it separated for now? We can iterate later if we see it is an issue
…8691) * 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.
check_pr_workflow_security.py rejected every write scope. Check runs only report results on the PR's own commit, and fork PRs still get a read-only token, so checks is the one write scope PR jobs may request.
Code Review ✅ Approved 🔴 High risk 5 closed / 5 findingsReworks PR and merge-queue required-check gates and permits checks:write; reporting errors could misstate CI status and affect merge eligibility across Python changes. Splits Python CI into event-owned ✅ 5 closed✅ Quality: Deleting py-tests.yml contradicts the Accepted Python CI selection record
✅ Quality: Lint moved to highest Python, contradicting the Accepted CI ADR
✅ Bug: Playwright jobs moved to floating ubuntu-latest while apt deps are noble-pinned
✅ Quality: Guard test for ADR four-worker unit default was removed
✅ Edge Case: Stale Airflow API lock goes unchecked until the nightly run fails
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Split Python CI into event-owned
ci-pr,ci-merge-queueandci-nightlyworkflows. Each declares its workloads and dependencies and invokes reusable runners for one supplied Python version. Unit tests and checks run independently of the backend build; shared reporting remains reachable after test setup failures.Type of change:
High-level design:
ci-prci-merge-queueci-nightlyingestion/pyproject.toml. Nox reuses its loaded profile configuration and owns freshness checks and Python-only generation. Server preparation accepts the same explicit profile; all in-repository callers are migrated. Connector defaults live inci-nightly.yml; jobs, matrices and expected results remain in their event entrypoints.scripts/python_ci.pyreads versions, validates connector selections and verifies declared results.make static-checkswith an isolated typing profile. Exclude_openmetadata_testutilswhile retaining ingestion and Airflow-provider analysis. Static checks run no pytest suite; pytest remains a transitive runtime dependency throughcollate-sqlfluff.py-checkstyleandpy-tests-statuschecks.API dependency resolution, Airflow image installers and release-branch Ruff compatibility remain separate installation paths. Classification archive preparation intentionally uses an isolated
uv pipinstall.Tests:
Unit tests and local checks
twine check. Lockfile and the working application environment stayed unchanged. A local native-build cache mismatch was cleared before the successful retry.git diff --checkpassed.trueand skipped forfalse.No application, API endpoint, connector implementation, schema, migration or UI rendering changes require new application integration tests or a UI recording. Live service startup, hosted artifact transfers and publishing execution remain GitHub validation; local checks do not establish merge readiness. No new line-coverage percentage is claimed for this orchestration change.
Manual validation in GitHub
py-checkstyleandpy-tests-statuschecks are satisfied. Exercise a setup failure after checkout and inspect the reporting summary/artifact.["mysql"], then use the default connector list. Verify full version matrices, helper/offline meta tests only on the highest nightly unit version, four selected unit/integration coverage artifacts, connector reports and one reused backend distribution.Checklist:
REVIEW.md: 84f5d7c.The PR still needs the previously reported
antlr4setup fix before merging.Findings
Summary
Splits Python CI into event-owned workflows with shared build, environment, test, and reporting steps.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD PR[Pull request] --> Plan[Select workloads] Queue[Merge queue] --> Plan Nightly[Nightly] --> Plan Plan --> Checks[Formatting and types] Plan --> Models[Classification models] Plan --> Backend[Shared backend build] Plan --> Image[Shared ingestion image] Models --> Units[Unit tests] Models --> Integration[Integration tests] Backend --> Integration Models --> Connectors[Connector tests] Backend --> Connectors Image --> Connectors Checks --> Status[Required status] Units --> Status Integration --> Status Connectors --> StatusReviews (37) · Last reviewed commit: "Verify retained runner diagnostics when ..." · Reviewed by Greptile
Summary by Gitar
openmetadata-airflow-apisNox/Makefile test flow with lockeduvdependency group and JUnit/coverage outputchecks: writeonly for read-only PR workflow permission validationThis will update automatically on new commits.