Skip to content

[2.0] fix(ci): backport Python CI improvements - #32117

Closed
IceS2 wants to merge 1 commit into
2.0from
backport/ci-improvements-2.0
Closed

IceS2 wants to merge 1 commit into
2.0from
backport/ci-improvements-2.0

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 preserve workflows already removed from 2.0 and keep the existing Playwright architecture while applying the required-check and cache behavior.

Greptile Summary

This backport consolidates Python CI into a reusable workflow and updates checkout, cache, test-timeout, dependency, and fixture behavior across CI.

  • Builds the backend distribution once for shared Python integration lanes.
  • Adds bounded Python tests, cached environments, and a pinned spaCy model artifact.
  • Preserves caller-owned required-check names and adjusts safe-to-test label concurrency behavior.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/workflows/py-tests-shared.yml Introduces the reusable Python CI graph for authorization, distribution assembly, artifacts, unit and integration matrices, coverage, and final result verification.
.github/workflows/py-tests.yml Replaces the duplicated MySQL Python pipeline with the shared workflow while retaining the caller-owned required status check.
.github/workflows/py-tests-postgres.yml Replaces the duplicated PostgreSQL integration pipeline with the shared workflow while retaining its required status context.
.github/actions/setup-openmetadata-test-environment/action.yml Adds resolved-Python-version virtual-environment caching with explicit invalidation and broken-environment rebuilding.
ingestion/noxfile.py Bounds unit-test execution and adapts test sessions to the shared preinstalled environment.
ingestion/setup.py Updates test dependencies needed by bounded tests and the preinstalled spaCy artifact.
.github/scripts/classify_test_outcome.py Recognizes pytest-timeout failures and scans both ends of large diagnostic logs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Event[PR, merge group, or manual event] --> Caller[Python workflow caller]
  Caller --> Shared[Reusable py-tests workflow]
  Shared --> Changes[Authorize and detect changes]
  Changes --> Build[Build backend distribution]
  Changes --> Model[Prepare spaCy model]
  Build --> Integration[Integration-test matrix]
  Model --> Integration
  Model --> Unit[Unit-test matrix]
  Integration --> Verify[Verify shared pipeline]
  Unit --> Verify
  Verify --> Status[Caller-owned required status check]
Loading

Reviews (2): Last reviewed commit: "fix(ci): backport Python CI improvements..." | 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 +88 to +98
file_handle.seek(0, os.SEEK_END)
size = file_handle.tell()
file_handle.seek(0)
if size <= DIAGNOSTIC_SCAN_BYTES:
raw_content = file_handle.read()
else:
segment_size = DIAGNOSTIC_SCAN_BYTES // 2
head = file_handle.read(segment_size)
file_handle.seek(-segment_size, os.SEEK_END)
raw_content = head + file_handle.read(segment_size)
content = raw_content.decode("utf-8", errors="replace")

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: Head+tail log scan can miss hang messages in mid-file

In _contains_process_timeout, logs larger than DIAGNOSTIC_SCAN_BYTES are scanned as a 1MB head + 1MB tail, skipping the middle. The previous implementation read the first 2MB contiguously. For a moderately large log (e.g. 3-4MB) where the Timeout (>Ns) from pytest-timeout message lands in the skipped middle region, the run will no longer be classified as hung_test even though the old code would have caught it. Consider scanning the first 2MB (or head+tail with a larger budget) if hang messages can appear anywhere but the very end.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

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

Backports Python CI improvements and caching optimizations to prepare for upcoming dependency updates. Consider expanding the head and tail log scan in _contains_process_timeout to avoid missing timeouts in mid-file.

💡 Edge Case: Head+tail log scan can miss hang messages in mid-file

📄 .github/scripts/classify_test_outcome.py:88-98

In _contains_process_timeout, logs larger than DIAGNOSTIC_SCAN_BYTES are scanned as a 1MB head + 1MB tail, skipping the middle. The previous implementation read the first 2MB contiguously. For a moderately large log (e.g. 3-4MB) where the Timeout (>Ns) from pytest-timeout message lands in the skipped middle region, the run will no longer be classified as hung_test even though the old code would have caught it. Consider scanning the first 2MB (or head+tail with a larger budget) if hang messages can appear anywhere but the very end.

🤖 Prompt for agents
Code Review: Backports Python CI improvements and caching optimizations to prepare for upcoming dependency updates. Consider expanding the head and tail log scan in _contains_process_timeout to avoid missing timeouts in mid-file.

1. 💡 Edge Case: Head+tail log scan can miss hang messages in mid-file
   Files: .github/scripts/classify_test_outcome.py:88-98

   In `_contains_process_timeout`, logs larger than `DIAGNOSTIC_SCAN_BYTES` are scanned as a 1MB head + 1MB tail, skipping the middle. The previous implementation read the first 2MB contiguously. For a moderately large log (e.g. 3-4MB) where the `Timeout (>Ns) from pytest-timeout` message lands in the skipped middle region, the run will no longer be classified as `hung_test` even though the old code would have caught it. Consider scanning the first 2MB (or head+tail with a larger budget) if hang messages can appear anywhere but the very end.

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

@github-actions

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

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

@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

@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.

@github-actions

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 60ab3700c516c8e7e19416b734770b5f17b549eb in Playwright run 32981275284, attempt 1.

✅ 616 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 1h 13m 14s

⏱️ Max setup 2m 57s · max shard execution 18m 9s · max shard-job elapsed before upload 21m 42s · reporting 5s

🌐 216.53 requests/attempt · 2.75 app boots/UI scenario · 8.72% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 216.53 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.75 per UI scenario (1775 boots / 646 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 139 0 0 0 0 0
✅ Shard chromium-02 127 0 0 0 0 0
✅ Shard chromium-03 133 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 31 0 0 0 0 0
✅ Shard ingestion-02 33 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@IceS2 IceS2 closed this Aug 27, 2026

This branch was previously deployed

1 inactive deployment
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