Skip to content

[1.13] fix(ci): backport Python CI improvements - #32118

Closed
IceS2 wants to merge 2 commits into
1.13from
backport/ci-improvements-1.13
Closed

IceS2 wants to merge 2 commits into
1.13from
backport/ci-improvements-1.13

Conversation

@IceS2

@IceS2 IceS2 commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Backports the CI prerequisite chain needed before the CVE dependency updates:

Release adaptations add the classifier helper required by the shared workflow, use the 1.13 storage connection factory in network-isolated tests, and preserve workflows already absent from 1.13.

Greptile Summary

This backport consolidates Python CI into a reusable workflow and introduces cached environments, bounded test execution, outcome classification, network-isolated fixtures, and updated GitHub Actions.

  • Builds the backend distribution once and shares it across Python test lanes.
  • Adds deterministic test-result classification and diagnostic artifacts.
  • Updates checkout, cache, authorization, and required-check behavior across CI workflows.
  • Refactors ingestion tests to avoid external network dependencies.

Confidence Score: 4/5

The PR is not yet safe to merge because relevant backend and build changes can still pass the required Python check without running any Python test lane.

The shared path filter continues to omit pom.xml, Makefile, and most openmetadata-service paths; for those changes, the reusable workflow accepts skipped build and test jobs and allows the caller’s required status to succeed.

Files Needing Attention: .github/workflows/py-tests-shared.yml

Important Files Changed

Filename Overview
.github/workflows/py-tests-shared.yml Introduces the reusable Python CI graph, shared distribution build, bounded test lanes, result verification, and artifact handling.
.github/workflows/py-tests.yml Replaces duplicated test jobs with the shared workflow while preserving the caller-owned required-check name.
.github/workflows/py-tests-postgres.yml Migrates PostgreSQL integration testing to the reusable Python workflow and retains its required status gate.
.github/scripts/classify_test_outcome.py Adds structured classification of test failures, hangs, setup failures, missing reports, and infrastructure failures.
.github/actions/setup-openmetadata-test-environment/action.yml Adds exact-key caching and validation for the ingestion Python virtual environment.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Caller[Python caller workflow] --> Shared[Reusable Python workflow]
  Shared --> Filter[Authorize and detect changes]
  Filter --> Build[Build backend distribution]
  Filter --> Unit[Unit and static checks]
  Filter --> Integration[Integration test shards]
  Build --> Integration
  Unit --> Verify[Verify workflow results]
  Integration --> Verify
  Verify --> Required[Caller required status]
Loading

Reviews (2): Last reviewed commit: "fix(ci): add Docker storage configuratio..." | Re-trigger Greptile

@IceS2
IceS2 requested review from a team, akash-jain-10, harshach and tutte as code owners August 26, 2026 14:19
@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.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 26, 2026
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
Comment thread .github/workflows/py-tests-shared.yml Dismissed
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

Comment on lines +249 to +263
deadline = time.monotonic() + 120
result = {}
while time.monotonic() < deadline:
result = _send_ol_event(
job_namespace="airflow_e2e_lineage",
job_name="sample_transform",
inputs=[
{"namespace": "sample_data", "name": "ecommerce_db.shopify.raw_order"}
],
outputs=[
{"namespace": "sample_data", "name": "ecommerce_db.shopify.fact_order"}
],
inputs=[_dataset(SOURCE_TABLE)],
outputs=[_dataset(TARGET_TABLE)],
)
if result.get("lineageEdgesCreated", 0) > 0:
return result
time.sleep(5)

return result

@gitar-bot gitar-bot Bot Aug 26, 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.

💡 Edge Case: ol_lineage_result KeyError masks clean assertion on timeout

When lineage never resolves within the 120s deadline, the ol_lineage_result fixture returns the last _send_ol_event response, which may lack the lineageEdgesCreated key (e.g. an error/non-200 body). The test then does bracket access ol_lineage_result["lineageEdgesCreated"], raising KeyError instead of the intended assertion failure with its diagnostic message. Use .get("lineageEdgesCreated", 0) to preserve the informative failure message.

Use .get() so a timeout produces the intended assertion message rather than a KeyError.:

def test_creates_lineage_edge_for_known_tables(self, ol_lineage_result):
    assert (
        ol_lineage_result.get("lineageEdgesCreated", 0) > 0
    ), f"Expected lineage edges to be created, got: {json.dumps(ol_lineage_result, indent=2)}"

Was this helpful? React with 👍 / 👎

@github-actions

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Core Components - I18n Sync

Core-components t() keys, locale files, or language-set are out of sync. Run yarn check-i18n-all locally.


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

Comment on lines +80 to +88
filters: |
python:
- 'ingestion/**'
- '.github/workflows/py-tests-shared.yml'
- 'openmetadata-spec/**'
- 'openmetadata-service/src/main/java/org/openmetadata/service/resources/**'
- 'openmetadata-service/src/main/java/org/openmetadata/service/JsonPatchMessageBodyReader.java'
- 'openmetadata-service/src/main/java/org/openmetadata/service/JsonPatchProvider.java'
- 'openmetadata-service/src/main/java/org/openmetadata/service/ResourceRegistry.java'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Python CI paths dropped

When a pull request changes pom.xml, Makefile, or openmetadata-service code outside the selected resource files, this filter reports no Python changes and skips every Python lane while the required status succeeds, allowing incompatible backend or build changes to merge without Python validation.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 2 findings

Backports Python CI improvements and workflow optimizations. Consider checking available disk space on /mnt before relocating the Docker root and handling potential KeyErrors for ol_lineage_result timeouts.

💡 Edge Case: ol_lineage_result KeyError masks clean assertion on timeout

📄 ingestion/tests/integration/airflow/test_openlineage_lineage.py:249-263

When lineage never resolves within the 120s deadline, the ol_lineage_result fixture returns the last _send_ol_event response, which may lack the lineageEdgesCreated key (e.g. an error/non-200 body). The test then does bracket access ol_lineage_result["lineageEdgesCreated"], raising KeyError instead of the intended assertion failure with its diagnostic message. Use .get("lineageEdgesCreated", 0) to preserve the informative failure message.

Use .get() so a timeout produces the intended assertion message rather than a KeyError.
def test_creates_lineage_edge_for_known_tables(self, ol_lineage_result):
    assert (
        ol_lineage_result.get("lineageEdgesCreated", 0) > 0
    ), f"Expected lineage edges to be created, got: {json.dumps(ol_lineage_result, indent=2)}"
💡 Edge Case: No free-space check on /mnt before moving Docker root

📄 .github/scripts/configure_docker_storage.sh:13-25 📄 .github/scripts/configure_docker_storage.sh:37-41

When / and /mnt are on different filesystems, the script relocates the Docker data-root to /mnt/docker without verifying /mnt has at least minimum_free_kb free (the check only runs on the same-filesystem branch for /). If /mnt is smaller than expected, Docker moves to a disk that may run out of space during CI. Consider adding a df --output=avail -k /mnt check mirroring the root-filesystem branch before committing the move.

🤖 Prompt for agents
Code Review: Backports Python CI improvements and workflow optimizations. Consider checking available disk space on /mnt before relocating the Docker root and handling potential KeyErrors for ol_lineage_result timeouts.

1. 💡 Edge Case: ol_lineage_result KeyError masks clean assertion on timeout
   Files: ingestion/tests/integration/airflow/test_openlineage_lineage.py:249-263

   When lineage never resolves within the 120s deadline, the `ol_lineage_result` fixture returns the last `_send_ol_event` response, which may lack the `lineageEdgesCreated` key (e.g. an error/non-200 body). The test then does bracket access `ol_lineage_result["lineageEdgesCreated"]`, raising KeyError instead of the intended assertion failure with its diagnostic message. Use `.get("lineageEdgesCreated", 0)` to preserve the informative failure message.

   Fix (Use .get() so a timeout produces the intended assertion message rather than a KeyError.):
   def test_creates_lineage_edge_for_known_tables(self, ol_lineage_result):
       assert (
           ol_lineage_result.get("lineageEdgesCreated", 0) > 0
       ), f"Expected lineage edges to be created, got: {json.dumps(ol_lineage_result, indent=2)}"

2. 💡 Edge Case: No free-space check on /mnt before moving Docker root
   Files: .github/scripts/configure_docker_storage.sh:13-25, .github/scripts/configure_docker_storage.sh:37-41

   When / and /mnt are on different filesystems, the script relocates the Docker data-root to /mnt/docker without verifying /mnt has at least `minimum_free_kb` free (the check only runs on the same-filesystem branch for /). If /mnt is smaller than expected, Docker moves to a disk that may run out of space during CI. Consider adding a `df --output=avail -k /mnt` check mirroring the root-filesystem branch before committing the move.

Options

Display: compact → Showing less information.

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

@IceS2 IceS2 closed this Aug 27, 2026

This branch was previously deployed

1 inactive deployment
test — 816849fb Deployed Aug 26, 2026 by IceS2 via playwright-knowledge-graph-postgresql #4571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants