Skip to content

fix(ci): clear java checkstyle, python checkstyle and static-check fa… - #32145

Merged
chirag-madlani merged 2 commits into
2.0from
2.0-clean-ci
Aug 27, 2026
Merged

chirag-madlani merged 2 commits into
2.0from
2.0-clean-ci

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #

Two independent things, both aimed at getting a PR opened against 2.0 to a green
python/java CI:

  1. Clear the checkstyle and static-check failures that fire on any PR based on
    2.0 (commit 1).
  2. Backport main's self-sufficient integration tests so the three suites that
    depended on the compose ingestion container stop failing (commit 2).

Why the integration tests were failing

py-tests.yml triggers on pull_request_target, which GitHub resolves from the
default branch. So PRs based on 2.0 are validated by main's
py-tests-shared.yml, not 2.0's own workflow. Main's workflow brings the stack up
with -i false:

command: ./docker/run_local_docker.sh -m no-ui -s true -i false
Running local docker using mode [no-ui] ... including ingestion [false]
Skipping Airflow DAG setup (ingestion disabled)

No openmetadata_ingestion container means no Airflow on :8080 and no sample-data
DAGs. Main can afford that because PR #30714 (2e7662cdb11) made the affected
tests self-sufficient in the same commit that introduced the shared workflow. That
commit never reached 2.0 (git compare 2.0...2e7662cdb11 → diverged), so 2.0
inherited the constraint without the accommodation — deterministic failures on
shard-2 and shard-3 across all Python versions.

Type of change:

  • Bug fix

High-level design:

Backported — already on main (8 files)

All from PR #30714 unless noted.

File Backport fidelity
ingestion/tests/integration/alationsink/test_alationsink.py verbatim
ingestion/tests/integration/alationsink/__init__.py verbatim (empty)
ingestion/tests/integration/ometa/test_ometa_user_api.py verbatim
ingestion/tests/integration/airflow/test_airflow_lineage.py verbatim
ingestion/.dockerignore verbatim
ingestion/tests/integration/airflow/Dockerfile adapted — FROM, pip pin, comment: 3.3.1 → 3.3.0
ingestion/tests/integration/airflow/conftest.py adapted — AIRFLOW_BASE_IMAGE: 3.3.1 → 3.3.0
ingestion/src/metadata/ingestion/source/database/vertica/metadata.py verbatim (# pyright: ignore[reportAttributeAccessIssue] ×2, already on main at the same lines)

What the backported tests now do instead of depending on the ingestion container:

  • airflow — conftest.py + Dockerfile build and run Airflow in a
    testcontainer joined to ometa_network, so the suite owns its DAGs and OM
    connection. test_dag_runs is dropped (main dropped it), so 3 failing tests
    become 2 passing ones.
  • alationsink — builds its own MySQL service → database → schema → 3 tables and
    tears them down, instead of reading sample_data.ecommerce_db.
  • ometa — a test_team_data fixture creates the "Data" team that
    test_es_search_from_name asserts on (yielding the existing one untouched on
    sample-data lanes).
  • .dockerignore — trims the airflow image's build context to src/. Applies
    only to builds whose context is ingestion/, which is exclusively this new image;
    every other image builds from the repository root.

2.0-only — not on main (5 files)

Each exists because main fixed the same problem by relaxing the check in a config
file 2.0 never received, while the enforcement still applies to 2.0.

File Change Why main doesn't need it
.../database/db2/utils.py # noqa: PLC0415 main globally disables PLC0415 in ingestion/pyproject.toml:209; 2.0's config lacks that line
.../database/hive/custom_hive_connection.py # noqa: PLC0415 same
.../database/dbt/metadata.py wrap the test description in Markdown main leaves the call unwrapped and baselines the error (29 reportArgumentType entries vs 2.0's 27)
.../pipeline/dbtcloud/metadata.py pass Uuid through, build StatusType/LastRunStatus, wrap logLink in AnyUrl same — main baselines 13 entries vs 2.0's 7
.../dqtests/TestCaseResolutionStatusResource.java drop 2 unused static imports must not go to main — main genuinely calls listOrEmpty in bulk-create code 2.0 doesn't have

For the four python ones, 2.0 could instead adopt main's config (add PLC0415 to
the ignore list, refresh the two baseline entry sets). The code fixes were chosen
because ingestion/src already carries 262 # noqa: PLC0415 comments — the
branch's own convention — and because fixing the types beats baselining them. All
four are runtime no-ops: pydantic was coercing these values already.

How was this patch tested / verified:

  • mvn spotless:apply → git diff-files --quiet (the exact java-checkstyle
    gate): exits 0.
  • make py_format_check: ruff lint + format clean across 2654 files.
  • basedpyright: 233 → 225 errors locally, exactly the 8 CI errors that reproduce
    on macOS; the 2 vertica ones need sqlalchemy_vertica installed.
  • Airflow test image builds against 2.0's pins: docker build exit 0. The
    critical step, uv pip install "apache-airflow==3.3.0" /tmp/ingestion, resolved
    212 packages with no conflict and left airflow at 3.3.0; airflow db migrate
    succeeded. This is what the 3.3.0 adaptation is for.
  • Container boots on Airflow 3.3.0: a throwaway test exercising only the new
    conftest fixtures confirmed the API issues a JWT via the simple auth manager and
    the dag-processor picks up a DAG from the mounted host dir. Both passed.
  • Unit tests: test_dbtcloud.py 69 passed; dbt tests 47 passed.
  • Collection: 10 tests across the three backported files; the whole airflow dir
    collects 24 with no regression from the new conftest.
  • Every alationsink expectation was checked against 2.0's builder code —
    SERVICE_TYPE_MAPPER[Mysql] → connector_id 116, model_str(None) → "None",
    TABLE_TYPE_MAPPER → TABLE/VIEW, _check_nullable_column →
    None/False/True, and fqn._build leaving dim_::>address unquoted.

The backported tests need a live OpenMetadata server, so their assertions are
unproven until CI runs; the mechanism they depend on is proven.

Known remaining CI failures (pre-existing, out of scope):

  • 4 tests/unit/pii tests — main's workflow installs a pinned
    en_core_web_md==3.8.0 wheel while 2.0's setup.py pins spacy<3.8 → 3.7.5. CI
    logs the mismatch (W095 ... trained with spaCy v3.8.0 ... current version (3.7.5)), degrading NER. Aligning needs main's whole pin cluster
    (numpy>=2,<3, pandas>=2.2.2,<3, spacy>=3.8.2,<3.9, scikit-learn,
    asammdf) — a numpy-2 migration that belongs in its own PR.
  • maven-sonarcloud-ci — main's workflow references
    .github/actions/cache-ui-dist, which doesn't exist on 2.0.
  • BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (1 of 15,313 java
    ITs) — assertNoRepeats(paged.versionKeys()) at BaseEntityIT.java:7288 is the
    only assertion in that test not scoped with ownVersions(...). It saw 17 rows
    where the test creates 15, so ≥2 belonged to other tests writing versions inside
    the same wall-clock window under parallel execution. The filtered correctness
    assertion at 7284–7287 passed. Same unfiltered code is on main; flake, not a
    regression.

…ilures

Java checkstyle: spotless:apply drops two unused static imports in
TestCaseResolutionStatusResource.

Python checkstyle: ruff PLC0415 fires on the two deliberately deferred
optional-dependency imports (sqlalchemy_ibmi, puretransport); annotate them
with the noqa the rest of the codebase already uses for the same pattern.

Static checks: basedpyright reported 10 errors absent from the baseline.
 - dbt: wrap the test description in Markdown, which is what the
   Create*Request models declare.
 - dbtcloud: pass the Uuid through instead of unwrapping it, build the
   status enums explicitly (TaskStatus/PipelineStatus want StatusType,
   PipelineObservability wants LastRunStatus) and wrap logLink in AnyUrl.
 - vertica: the dialect monkey-patches deviate from SQLAlchemy's declared
   signatures by design, so suppress them the way snowflake and exasol do.

Co-Authored-By: Claude Opus 5 <[email protected]>
@harshsoni2024
harshsoni2024 requested review from a team as code owners August 27, 2026 06:10
@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 27, 2026
Comment on lines 600 to +606
return [
TaskStatus(
name=DEFAULT_TASK_NAME,
executionStatus=self._map_run_status(run.state or run.status),
executionStatus=StatusType(self._map_run_status(run.state or run.status)),
startTime=self._parse_timestamp(run.started_at) if run.started_at else None,
endTime=self._parse_timestamp(run.finished_at) if run.finished_at else None,
logLink=run.href,
logLink=AnyUrl(run.href) if run.href else None,

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.

P2 Untested model conversions

The dbt Cloud status, URL, observability, and entity-reference conversions change generated-model behavior without focused regression tests, leaving future mapping or validation changes detectable only during ingestion.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit a75218e3c2c15b50cd454fd7a41e6c3487dfcd10 in Playwright run 33053018012, attempt 1.

✅ 861 passed · ❌ 0 failed · 🟡 1 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) 56m 24s

⏱️ Max setup 3m 2s · max shard execution 18m 15s · max shard-job elapsed before upload 21m 20s · reporting 8s

🌐 212.21 requests/attempt · 2.57 app boots/UI scenario · 30.96% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 30.96% (convergence target: at most 15%).
  • Browser traffic was 212.21 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.57 per UI scenario (2301 boots / 897 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 171 0 0 0 0 0
✅ Shard chromium-02 155 0 0 0 0 0
🟡 Shard chromium-03 170 0 1 0 0 0
✅ Shard chromium-04 143 0 0 0 0 0
✅ Shard chromium-05 155 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
✅ Shard ingestion-02 35 0 0 0 0 0
✅ Shard reindex-01 3 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Delete Pipeline (shard chromium-03, 1 retry)

📦 Download artifacts

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

…-sufficient

Backport of main's tests. PRs based on 2.0 are validated by main's
py-tests-shared.yml, which brings the stack up with `-i false` — no
openmetadata_ingestion container, so no Airflow on :8080 and no sample-data
DAGs. These three suites still depended on both and failed deterministically
on shard-2 and shard-3 across all Python versions.

 - airflow: a conftest that builds and runs Airflow in a testcontainer joined
   to ometa_network, so the suite owns its DAGs and connection. Pinned to
   apache-airflow 3.3.0 to match 2.0's setup.py, where main uses 3.3.1;
   installing 3.3.1 would fight the ingestion package's own pin.
 - alationsink: build the service, database, schema and tables under test
   instead of reading sample_data.ecommerce_db.
 - ometa: a test_team_data fixture creating the "Data" team that
   test_es_search_from_name asserts on.

.dockerignore keeps the airflow image's build context to src/, and only
applies to builds whose context is ingestion/ — every other image builds
from the repository root.

Co-Authored-By: Claude Opus 5 <[email protected]>
@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Clears Java checkstyle, Python checkstyle, and static-check failures by removing unused imports, annotating deferred imports, and updating typing constructs. No issues found.

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

@chirag-madlani
chirag-madlani merged commit c1e9302 into 2.0 Aug 27, 2026
119 of 134 checks passed
@chirag-madlani
chirag-madlani deleted the 2.0-clean-ci branch August 27, 2026 10:12
harshsoni2024 added a commit that referenced this pull request Aug 27, 2026
…-sufficient

Backport of the test half of #32145 (2.0, c1e9302). PRs based on 1.13 are
validated by main's py-tests-shared.yml, which brings the stack up with
`-i false` — no openmetadata_ingestion container, so no Airflow on :8080 and
no sample-data DAGs. These three suites still depended on both and failed
deterministically: four alationsink cases on shard-2, three
test_airflow_lineage cases plus test_es_search_from_name on shard-3, across
every Python version.

 - airflow: a conftest that builds and runs Airflow in a testcontainer joined
   to ometa_network, so the suite owns its DAGs and connection. apache-airflow
   3.3.0 matches this branch's setup.py, the same pin 2.0 uses.
 - alationsink: build the service, database, schema and tables under test
   instead of reading sample_data.ecommerce_db.
 - ometa: a test_team_data fixture creating the "Data" team that
   test_es_search_from_name asserts on.

.dockerignore keeps the airflow image's build context to src/, and only
applies to builds whose context is ingestion/ — every other image builds from
the repository root with the top-level ignore file.

The upstream commit's ingestion/src changes are deliberately omitted: its
PLC0415 annotations and dbt/dbtcloud/vertica suppressions target 2.0's ruff
and 2.0's basedpyright baseline, neither of which applies here. Its
test_ometa_user_api reformatting is also dropped — only the fixture is taken,
so the file stays black-conformant on this branch.

Does not address shard-2's datalake failures (a 400 on recursive service
delete when Airflow is absent), shard-3's trino NO_NODES_AVAILABLE errors, or
test_s3_ingestion.

Co-Authored-By: Claude Opus 5 <[email protected]>
pmbrull pushed a commit that referenced this pull request Aug 28, 2026
* fix(ci): restore the python pipeline on 1.13

PRs targeting 1.13 are validated by main's workflow definitions: the
`pull_request_target` event resolves workflows from the default branch,
while `actions/checkout` puts the 1.13 tree on disk. main's
`py-tests-shared.yml` therefore runs against a checkout that is missing
files it depends on, and every python job goes red regardless of the
diff -- #32154, a Java-only backport, failed identically to #32166.

Three gaps are fixable from this branch:

* `.github/scripts/` does not exist on 1.13 at all. `classify_test_outcome.py`
  exits 2 *after* the tests pass (a postgres shard logged `101 passed` and
  `nox > Session integration-tests was successful`, then failed the job), and
  `configure_docker_storage.sh` exits 127, killing shards 2 and 3 before they
  download anything. Both scripts are copied verbatim from main; they are
  stdlib-only Python and plain bash with no new dependencies. The globs they
  read resolve here -- noxfile.py writes junit/test-results-unit.xml and
  junit/test-results-integration.xml.

* `basedpyright~=1.39.0` floats onto 1.39.10 (released 2026-08-13), which
  reports ~428 errors against this branch's baseline. main pinned
  `==1.39.3` in #27834 to stop exactly this; only the pin is taken here,
  since the rest of that commit conflicts across seven files.

* tests/unit/source/pipeline/openlineage/ is not a package, so its
  test_connection.py collides with the one under
  tests/unit/metadata/ingestion/connections/ and pytest intermittently
  reports `import file mismatch`. main disambiguates with __init__.py.
  Only the leaf marker is added -- enough to make the module name unique
  without renaming every module under tests/unit/source/.

The spaCy 3.8 model mismatch and the ruff-only checkstyle install cannot
be fixed from here; both need main's workflows to probe the checkout.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(integration): make the airflow, alationsink and ometa tests self-sufficient

Backport of the test half of #32145 (2.0, c1e9302). PRs based on 1.13 are
validated by main's py-tests-shared.yml, which brings the stack up with
`-i false` — no openmetadata_ingestion container, so no Airflow on :8080 and
no sample-data DAGs. These three suites still depended on both and failed
deterministically: four alationsink cases on shard-2, three
test_airflow_lineage cases plus test_es_search_from_name on shard-3, across
every Python version.

 - airflow: a conftest that builds and runs Airflow in a testcontainer joined
   to ometa_network, so the suite owns its DAGs and connection. apache-airflow
   3.3.0 matches this branch's setup.py, the same pin 2.0 uses.
 - alationsink: build the service, database, schema and tables under test
   instead of reading sample_data.ecommerce_db.
 - ometa: a test_team_data fixture creating the "Data" team that
   test_es_search_from_name asserts on.

.dockerignore keeps the airflow image's build context to src/, and only
applies to builds whose context is ingestion/ — every other image builds from
the repository root with the top-level ignore file.

The upstream commit's ingestion/src changes are deliberately omitted: its
PLC0415 annotations and dbt/dbtcloud/vertica suppressions target 2.0's ruff
and 2.0's basedpyright baseline, neither of which applies here. Its
test_ometa_user_api reformatting is also dropped — only the fixture is taken,
so the file stays black-conformant on this branch.

Does not address shard-2's datalake failures (a 400 on recursive service
delete when Airflow is absent), shard-3's trino NO_NODES_AVAILABLE errors, or
test_s3_ingestion.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(integration): fix the trino readiness race and a stale s3 assertion

trino (shard-3, 38 errors): the container readiness probe queried
system.runtime.nodes, which the system connector answers on every active node
before any catalog can be scheduled. The fixture proceeded and the first
ANALYZE failed with NO_NODES_AVAILABLE, erroring every test in the package.
Probe a real catalog instead, and replace the flat sleep(1) between write and
ANALYZE with a read-back that retries while the hive split is still lagging.
Pin the hive-metastore image by digest so :latest cannot drift under a
maintenance branch.

Only the readiness half of main's trino rework is taken. Its move of drop_stats
into a reset_trino_table_statistics fixture, the folding of test_no_statistics
into test_profiler, and the removal of test_empty_table_with_dropped_stats_falls_back
are a coverage redesign rather than a CI fix, so this branch keeps its global
drop_stats call and all three tests unchanged. Nothing in the trino connector
source is touched.

s3 (shard-3, 1 failed): the container payload no longer inlines children, so
`assert 7 == len(bucket.children.root)` raised AttributeError. The next line
already asserts the same count through list_container_children. The
"Invalid STS API version" logged nearby is the non-mandatory GetMetrics step of
the S3 test connection and fails nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(tests): profile in setUpClass so test_list_entity_profiles has data (#31882)

pytest orders unittest TestCase methods alphabetically, so
test_list_entity_profiles runs first -- before test_profiler_workflow has
created any profile. The module sets TestLoader.sortTestMethodsUsing = None
to force definition order, but that only affects unittest's own loader:
pytest collects TestCase methods itself and ignores it. Verified against an
unmodified checkout -- collection still yields list_entity_profiles first
with that line in place, so it has never had any effect here.

The test still passed, because it asserts on a global 24h window across
every table rather than on data it owns, and hard-deleted tables used to
leak their profiler rows into that window. #31556 stopped that leak (issue
"0 not greater than 0" on every PR that actually runs the ingestion
integration matrix, blocking the merge queue. PRs that do not touch
ingestion skip the matrix and report green, which is why this looked
branch-specific rather than repo-wide.

Run the profiler in setUpClass, where fixture data belongs, so no test
depends on another's ordering. Drop the ineffective loader hack, and turn
the `if profiles_all.entities:` guard into an assertion -- that guard
swallowed an empty unfiltered listing and hid which of the two calls was
actually empty, which is the signal needed to diagnose this.

* fix(ci): stabilize remaining 1.13 Python checks

* fix(ci): align 1.13 Python tests with CI

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: IceS2 <[email protected]>
Co-authored-by: Himanshu Khairajani <[email protected]>
Co-authored-by: Pablo Takara <[email protected]>

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