Skip to content

Fixes #34815: Run Java integration tests only in the merge queue, with an impact-mapped local run before review - #34818

Merged
mohityadav766 merged 9 commits into
mainfrom
feature/restructure-java-test-ci-gating
Oct 7, 2026
Merged

mohityadav766 merged 9 commits into
mainfrom
feature/restructure-java-test-ci-gating

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #34815

PR CI is moving the Java integration tests (ITs) to the merge queue and JavaUIIT/search-it to openmetadata-nightly, the same way #34746 and #34740 moved Playwright and the Python ITs. That makes the merge queue the first CI run of an IT, and an ejection there costs every PR queued behind it. This PR adds what has to replace the PR run: a local, impact-mapped run of the Java tests a branch can break, wired into the PR checklist as a gate.

  • make java_affected maps the branch diff to the unit tests and ITs it impacts, through .github/java-tests/impact-map.json, and prints the exact Maven command for each failsafe lane and engine.
  • make java_affected_run ARGS="--update-pr" runs those commands and upserts a local-java-test-results block into the PR body (new markers under "Backend integration tests").
  • New java-affected-tests skill. pr-checklist refuses a PR touching Java, schemas, migrations or a pom without a PASSED (or NOT NEEDED) block for the current commit.
  • New java-impact-map harness check: warns on an IT or production file no area owns, or an area that names a single test.

The workflow change follows in a separate PR (prepared and linted). Until it lands, PRs still run the ITs as today:

  • integration-tests-mysql-elasticsearch and -postgres-opensearch (required checks) skip every job on PRs; GitHub counts a skipped required check as passing. They run in the merge queue, on main pushes and on dispatch. The pull_request_target / safe to test path goes, as in ci(playwright): run Postgres E2E suite only in the merge queue #34746.
  • integration-tests-postgres-elasticsearch-redis (not required) drops its PR trigger.
  • java-playwright-nightly.yml stops running on PRs and in the merge queue. Its embedded jobs move to openmetadata-nightly's k8s-java-it.yml (open-metadata/openmetadata-nightly#340), which already runs the cluster suites.
  • maven-collate-ci also runs in the merge queue and passes the event along: an OpenMetadata PR gets the Collate build and unit tests, the queue gets the Collate ITs.
  • harness-integrity.yml also triggers on IT and impact-map changes.

Type of change:

  • Improvement

High-level design:

Where each Java suite runs once the workflow PR lands:

Suite PR checks Merge queue Nightly Before review
Unit tests full full — impacted classes
Integration tests (MySQL+ES, PG+OS, PG+ES+Redis; every lane) reported skipped full — impacted classes
search-it (tests/search/*IT) — — openmetadata-nightly impacted classes
JavaUIIT, scale-it — — openmetadata-nightly reported, not run
Collate via maven-collate-ci build + unit tests integration tests — —

Selection (.github/scripts/plan_local_java_tests.py, stdlib only). The map holds ownership rules only; the rest is read from the code. Every signal only adds tests:

  1. Changed test classes run as they are.
  2. Areas. impact-map.json has 40 areas that own code by directory and tests by name or path pattern (service/search/** → *Search*IT, tests/search/**). No area names a single test; the audit rejects one.
  3. Entity names. XRepository/XResource/XMapper/XIndex, x.json, createX.json and x_index_mapping.json select ITs named X… at a CamelCase boundary.
  4. ITs that name the change. ITs that mention the changed class, or a changed method together with its class, directly or through IT helpers and the SDK. A helper most ITs use (SdkClients, the IT bootstrap) is followed only through its methods that use the change. A file importing another class of the same simple name doesn't count.
  5. Callers' entities. Production code that calls the change adds its entity's ITs (TestCaseRepository calls TableRepository → the TestCase… ITs), narrowed to callers of the changed methods when the diff names them.
  6. Unit tests by reference, and the module's full suite past 40 users.
  7. Smoke for any change to code other than a test class.

It fails toward running more. The full suite (every merge-queue lane IT, default engine) runs for a file no area owns, poms and the IT bootstrap, the core area (entity framework and server wiring), a helper most ITs use when the diff names no changed method, and any selection above 60% of the merge-queue ITs. A full-suite plan can run in CI on the branch and be recorded with --ci-run, which accepts only a passed integration-test run on HEAD whose lane jobs ran (a run whose change detection skipped them still says "success").

What never runs is read from the code and the pom (abstract classes, class-level @Disabled, suite-profile <excludes>, classes enabled by a property no lane sets), and the engine a class needs from its assume… calls.

The author's part. The plan is a floor. The skill gives ground rules for adding tests (cascades on delete/rename, fields search documents or alerts read, shared permission checks, methods an IT drives under another name); additions go through --add-it/--add-unit/--add-area with a required --reason, listed in the PR block. Nothing removes a test.

Maintenance. New code in an owned directory and new ITs that match an area's pattern need no edit. The audit (--check-map, harness check, pytest) reports an IT or production file no area owns; until someone assigns it, a change there runs the full suite, so a gap costs time, not a missed test.

Running them the way CI does. Lane membership is read from the IT pom (integrationTests.globalStateTests, multiNodeTests, retryQueueTests, rdfTests), so selected classes run in the isolated, rdf or parallel execution, or under -Psearch-it. Engines come from the areas and engineRules: Postgres SQL runs on PostgreSQL+OpenSearch, DAOs run on both databases, cache code also runs under -Pcache-tests. testEngines routes classes whose tests assume one backend, matched by their assume… calls: PatchTableEmbeddingIT (OpenSearch), the Redis cache ITs. Elsewhere they skip, and a skipped run looks green.

Traps the commands avoid. Each was hit in this repo before:

  • A lane without -P<engine> runs zero tests and prints BUILD SUCCESS. A step only passes if tests executed and every selected class produced a report; an all-skipped class is flagged.
  • -Dit.test without a lane runs the class in both failsafe executions.
  • mvn test -pl openmetadata-integration-tests tests the openmetadata-service jar in ~/.m2, which another checkout can overwrite. Every command builds with -am instead.
  • mvn test -am cannot compile the service: the relocated es.*/os.* clients only exist once openmetadata-shaded-deps is packaged. Unit steps run package.
  • -am runs every upstream unit suite. IT steps pass a -Dtest filter that matches nothing.

Alternatives considered.

  • This PR's first version, a map that listed 178 tests by name: review found it missed TestCaseDeleteResilienceIT for a TableRepository change (the link crosses areas), and every new IT needed a JSON edit.
  • An import graph: measured on this repo, following imports reaches 384 of 408 ITs from any class (143 ITs import service.Entity), and direct imports miss most links because ITs reach repositories over HTTP.
  • Adding callers' whole areas instead of their entities: median 190 ITs per commit instead of 78.
  • Selection from per-IT runtime coverage: the most precise, but it needs a nightly coverage run with IT classes one at a time (they run concurrently in one JVM with the in-process server). A possible follow-up; the replay below is the baseline it would have to beat.
  • Let the agent choose tests from a markdown table: not reproducible, and nothing checks the choice.
  • Run the full IT suite locally: the parallel lane alone took 46 min on CI (merge-queue run 37573001725).
  • Keep ITs on PRs behind a path filter: it still runs on nearly every backend PR.

Rollout.

  • Required-check names don't change, so no ruleset change is needed to land this.
  • open-metadata/openmetadata-nightly#340, which carries the embedded JavaUIIT coverage, should merge with or before the workflow PR, so that coverage isn't dropped for a night.
  • Collate counterpart: open-metadata/openmetadata-collate#7162 (the same script, byte for byte, with Collate's map).
  • Follow-ups after merge: require openmetadata-service-unit-tests-status in merge-rules; run the MCP unit tests in CI (710 tests, all pass on main, never run by any workflow); fix the SDK unit tests (surefire fails JUnit discovery with a platform version mismatch, so they have never run).

Tests:

Tests run locally

Everything that ran before review, in each repo. CI on this PR does not run the ITs or Playwright.

Run Repo Result
python3 -m pytest .github/scripts/test_plan_local_java_tests.py OpenMetadata (this PR) 41 passed
python3 -m pytest .github/scripts/test_plan_local_java_tests.py openmetadata-collate (#7162) 8 passed
Old vs new planner on every non-ignored file (6,846 here, 2,348 in Collate) both the new plan selects every IT the old one did, except tests no CI lane runs (class-level @Disabled, property-gated), SDK unit-test files that used to pull in the smoke set, and simple-name collisions the old one took for references (sdk.entities.Chart vs the schema Chart ITs import)
Replay of the 88 commits that touched Java among the last 300 on main OpenMetadata merge-queue ITs per commit: median 78 (old map 30); 43% get the full suite, 30 of them through core
make java_affected_run on a sample KpiRepository.java change (block below) OpenMetadata unit: 2 passed; ITs (MySQL+ES, parallel): 16 classes, 1,309 tests, 0 failed, 123 skipped; 3.8 min
make java_affected ARGS=--check-map and python3 scripts/harness/check_harness.py (java-impact-map) OpenMetadata, Collate every IT and production file has an owner, no warnings
mvn -o help:effective-pom -pl collate-integration-tests with and without -DintegrationTests.skipSequential=true openmetadata-collate switches resolve as intended; defaults unchanged
actionlint on the 8 prepared workflow files OpenMetadata, Collate, nightly no new findings

Not run: the 21 Playwright smoke and canary specs make playwright_affected selects for any unmapped file (this PR changes no product code), and Collate's 4 smoke ITs (see #7162).

Use cases covered

  • A TableRepository change runs the databases area, the ITs that name it (TestCaseDeleteResilienceIT, the review's case), the ITs of the entities whose code calls it (TestCase…, Query…, GlossaryTerm…, …) and the smoke set: 74 ITs, or 47 when the diff only changes entitySpecificCleanup.
  • An EntityRepository change, a pom, or a file no area owns runs the full suite.
  • A Postgres migration runs the migration ITs on PostgreSQL+OpenSearch only.
  • An OpenSearch client change runs the search area on PostgreSQL+OpenSearch; an Elasticsearch client change on MySQL+ES.
  • A cache change runs the Redis-only cache ITs under -Pcache-tests.
  • A change to K8sPipelineClient, which the IT bootstrap names, no longer selects all 201 ITs that use the bootstrap.
  • A UI-only or docs-only change selects nothing.
  • A changed UIIT or scale class is reported as nightly-only and not run.

Unit tests

  • .github/scripts/test_plan_local_java_tests.py: 41 tests, all passing (python3 -m pytest .github/scripts/test_plan_local_java_tests.py). They run against this repo and the real map: the ownership audit (single tests, unowned ITs and files, dead patterns), never-run and property-gated classes read from code and pom, references and callers (the review's TableRepository case), method anchoring, helpers most ITs use, every full-suite trigger, author additions with a required reason, changed methods from hunk headers, --ci-run (including a run whose lanes were skipped), lanes and engines, report parsing, the PR block, and untracked files.
  • Coverage of plan_local_java_tests.py: 68%. The uncovered lines are the Maven and gh execution path, which the end-to-end run below exercises.

Backend integration tests

  • Not applicable (no backend API changes).

This PR changes no Java, so its own block reads NOT NEEDED:

Local Java test run: NOT NEEDED — no Java unit or integration test is impacted.

  • Commit: b5c574b09a2c (base origin/main)

The planner itself was run end to end against real Maven and Testcontainers, on this PR's head (be3caadf4e57), for a sample one-file change: make java_affected_run with --changed-files listing KpiRepository.java, since this PR's own diff selects nothing. It shows the area (data insights), the entity and caller signals (KpiResourceIT), the unit test that references the class, and the smoke set. Its block, without the markers so it doesn't replace this PR's own:

Planner validation run: PASSED (sample change: jdbi3/KpiRepository.java)

  • Commit: be3caadf4e57 (base origin/main)
  • Finished: 2026-10-07 15:36 UTC · 3.8 min
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (1 class) 1 2 0 0 0.9 passed
integration mysql-elasticsearch · parallel 16 1309 0 123 2.9 passed

Tests run locally

  • unit · openmetadata-service (1 class): KpiRepositoryTest (2 passed)
  • integration · mysql-elasticsearch · parallel: BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (310 passed, 27 skipped), ConfigResourceIT (16 passed, 3 skipped), DataInsightAggregationIT (35 passed), DataInsightAliasReconciliationIT (1 passed, 1 skipped), DataInsightChartResourceIT (215 passed, 35 skipped), DataInsightSystemChartResourceIT (55 passed, 7 skipped), DataInsightsEnricherBehaviorIT (5 passed, 1 skipped), DatabaseSmokeIT (29 passed, 9 skipped), EnricherBulkVsHistoryPathEquivalenceIT (78 passed, 6 skipped), GlossaryTermResourceIT (266 passed, 9 skipped), KpiResourceIT (97 passed, 19 skipped), ReportDataResourceIT (14 passed, 5 skipped), SeedDataPresenceIT (5 passed), TableResourceIT (44 passed), UserResourceIT (11 passed, 1 skipped), WebAnalyticEventResourceIT (5 passed)

Per-class counts come from failsafe's reports, which can credit a test to the wrong class when classes run concurrently; the step totals above are exact.

Why these tests
  • area data-insights ← openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/KpiRepository.java
  • called from entity Kpi ← openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/KpiRepository.java
  • entity Kpi ← openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/KpiRepository.java
  • smoke ← code other than a test class changed
Commands
mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=KpiRepositoryTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=ConfigResourceIT,DataInsightAggregationIT,DataInsightAliasReconciliationIT,DataInsightChartResourceIT,DataInsightSystemChartResourceIT,DataInsightsEnricherBehaviorIT,DatabaseSmokeIT,EnricherBulkVsHistoryPathEquivalenceIT,GlossaryTermResourceIT,KpiResourceIT,ReportDataResourceIT,SeedDataPresenceIT,TableResourceIT,UserResourceIT,WebAnalyticEventResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Not run. make playwright_affected selects its fixed 5-spec smoke set plus the 16 canaries it adds for any unmapped file, docs included. This PR changes CI tooling, skills and docs only, so none of those specs can exercise it.

Manual testing performed

  1. make java_affected ARGS=--check-map: every integration test and production file has an owner. python3 scripts/harness/check_harness.py: no java-impact-map warnings.
  2. Planned the use cases above with --changed-files and checked each command's lane, engine profile and test filter.
  3. Ran make java_affected_run end to end (table above), then checked the results block upserts into this template under "Backend integration tests".
  4. Ran the Collate copy against Collate's map (8 tests pass, every IT and production file owned).

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

mohityadav766 and others added 2 commits October 7, 2026 13:26
`make java_affected` maps the branch diff to the unit tests and integration
tests it can break, through .github/java-tests/impact-map.json. 45 buckets by
architecture area, plus an entity-name convention and references from the
test side; every one of the 408 IT classes sits in at least one bucket.
Each selected IT runs in the failsafe lane and engine profile CI uses for it,
read from the IT pom, and classes whose tests only execute on one backend
(OpenSearch-only, Redis-only) run on that backend.

`make java_affected_run ARGS="--update-pr"` runs the steps and upserts a
results block into the PR body. A step passes only if tests executed, none
failed, and every selected class produced a report: a lane run without an
engine profile prints BUILD SUCCESS after running nothing.

Every command builds with -am instead of resolving openmetadata-service from
~/.m2, which another checkout can overwrite mid-run. Unit steps run `package`
because the relocated es.*/os.* search clients only exist once
openmetadata-shaded-deps is packaged.

A harness check warns when an IT is added that no bucket reaches.

Part of #34815.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New java-affected-tests skill: when to run `make java_affected`, how to read
the plan (gaps, untested classes, tests not run locally), how to add tests the
map cannot know about, and the Maven traps the commands avoid.

pr-checklist refuses to open a PR that touches Java, schemas, migrations or a
pom without a PASSED (or NOT NEEDED) local-java-test-results block for the
current commit, and the PR template carries the block under "Backend
integration tests". The IT commands in java.md, test-enforcement and
verification ran the class twice or tested a stale jar; they now point at
the planner.

Part of #34815.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 7, 2026
Comment thread scripts/harness/check_harness.py Resolved
The results block reported per-step totals; the classes only appeared inside
the Maven commands. It now has a "Tests run locally" list naming every class
each step ran with its passed/failed/skipped counts. A full unit suite is
listed in a collapsed block so the PR body stays under GitHub's limit.

pr-checklist asks for the same record for everything else run before review
(pytest, Jest, Playwright, manual checks) and for the counterpart Collate PR
to be linked from both descriptions, since CI on the PR no longer runs the
integration tests or Playwright.

Part of #34815.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

…ava-test-ci-gating

Conflict in skills/pr-checklist/SKILL.md with #34740: kept this branch's Java
section, which replaces the old `mvn test -pl openmetadata-integration-tests
-Dtest=<NewIT>` block, and took #34740's Ingestion (Python) section as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mohityadav766 and others added 3 commits October 7, 2026 15:02
- A changed IT harness class selects the ITs that reach it through other
  harness classes and neverRun base classes (AuthBackend -> TokenRefresher ->
  SdkClients -> every IT). One that no IT reaches is an impact-map gap and
  runs the smoke set; before, it produced a NOT NEEDED block. That block now
  names impacted tests that only run nightly.
- A module run in full is listed as counts, and class lists past 20,000
  characters are cut to counts. openmetadata-service's class list alone is
  ~55,000 characters, so a full-suite run pushed the PR body past GitHub's
  65,536 limit and --update-pr failed. --update-pr now refuses a body over
  the limit with a message instead of a gh error.
- Untracked files the plan reads (outside `ignore`) mark the block "uncommitted
  changes were present".
- The java-impact-map harness check reports the planner's SystemExit on a
  pom/map mismatch as a warning instead of aborting harness-integrity.

Part of #34815.
Review feedback: a TableRepository change selected 11 ITs and missed
TestCaseDeleteResilienceIT, and the map listed 178 tests by name.

The impact map now holds ownership rules only. 40 areas own code by directory
and tests by name or path pattern; the audit rejects an area that names a single
test and warns on any IT or production file no area owns. The rest is read from
the code:

- ITs that name the changed class, or a changed method together with its class,
  directly or through IT helpers and the SDK. A helper most ITs use (SdkClients,
  the IT bootstrap) is followed only through its methods that use the change; a
  file that imports another class of the same simple name is not a reference.
- The entity ITs of the production code that calls the change, narrowed to the
  callers of the changed methods when the diff names them.
- The engine a test needs, from its assume calls, and the classes no lane runs:
  abstract, class-level @disabled, suite-profile excludes, gated on a property no
  lane sets.

It fails toward running more. The smoke set runs for any code change. An unowned
file, a pom, the IT bootstrap, the core area, or a selection over 60% of the
merge-queue ITs runs the full suite, which can run in CI and be recorded with
--ci-run; that accepts only a passed IT workflow run on HEAD whose lane jobs ran.
The author or agent adds tests with --add-it/--add-unit/--add-area and a
required --reason; nothing removes them.

Against the old map, for every file in the repo, the new plan selects every IT
the old one did, except tests no CI lane runs, SDK unit-test files, and
simple-name collisions. On the 88 commits that touched Java among the last 300
on main: median 78 merge-queue ITs per commit (old map: 30); 43% run the full
suite, 30 of them through core.

Part of #34815.
mohityadav766 and others added 2 commits October 7, 2026 20:44
Review: --ci-run let any passed run stand in for every lane step on its
engine, but the PostgreSQL + Elasticsearch + Redis workflow has no rdf lane, so
an rdf step on cache-tests would show as covered by a run that never ran it.

Each ciWorkflows entry now names the CI jobs behind each planner lane
(laneJobs: isolated is the global-state, multi-node and retry-queue jobs). A
run covers a lane only if every one of those jobs ran and passed in it, so a
lane the workflow lacks, or one its change detection skipped, still runs
locally. A run that covers no lane is rejected.

Part of #34815.
@gitar-bot

gitar-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 5 closed / 5 findings

🟡 Medium risk · The new Java impact planner and PR checklist gate could omit a needed integration test, letting a regression reach the merge queue.

Restructures Java CI to run integration tests in the merge queue with impact-mapped local runs before PR review. Adds make java_affected for selecting impacted tests, make java_affected_run to execute them and upsert results to the PR body, a java-affected-tests skill gating PRs touching Java/schemas/migrations, and a java-impact-map harness audit. Five issues found during development have been resolved: IT-harness helpers now produce a NOT NEEDED block, planner SystemExit warnings integrate with the harness, results blocks include dirty-file notes, full-suite details collapse properly, and --ci-run correctly handles lanes per engine. Comprehensive test coverage (41 pytest cases, end-to-end validation with real Maven) and 68% code coverage confirm the implementation. No issues remain.

✅ 5 closed
✅ Bug: Unreferenced IT-harness helpers produce a NOT NEEDED block

📄 .github/scripts/plan_local_java_tests.py:382-391 📄 .github/scripts/plan_local_java_tests.py:454-460 📄 .github/scripts/plan_local_java_tests.py:515-525
_plan_file sends a non-test .java file under the IT source root to _add_referencing_its. That function only counts files that are IT classes themselves, so it misses helpers that are reached only through other helpers. If such a file falls outside the it-harness bucket directories, nothing selects any IT. Because _is_test_source(path) is true, the file is also skipped by the unmapped-files/smoke fallback. Example: org/openmetadata/it/auth/AuthBackend.java is referenced only by other it/auth/* helpers and UiTestServer. Changing it gives an empty plan, and --run writes a NOT NEEDED block that pr-checklist accepts as a passing gate. Fix: when a changed IT-source file maps to nothing, add the smoke set and list the file in unmapped_files (or follow references transitively), the same way unmapped production files are handled.

✅ Bug: SystemExit from planner aborts the harness instead of warning

📄 scripts/harness/check_harness.py:536-547 📄 .github/scripts/plan_local_java_tests.py:226-229 📄 .github/scripts/plan_local_java_tests.py:240-244
Repo._lane_membership raises SystemExit when the IT pom no longer defines a lane property or execution, and Planner code does the same in other places. check_harness.main only catches Exception, and SystemExit is a BaseException, so it gets past the 'a broken check must not crash the whole run' guard. check_java_impact_map is the last entry in CHECKS, and warnings are printed only after the loop ends. So renaming a pom property (exactly the drift this check is meant to catch) makes harness-integrity exit 1, and the warnings already collected by every other check are never printed. Fix: catch SystemExit inside check_java_impact_map and return it as a Warn.

✅ Edge Case: Results block omits the dirty note when untracked files were tested

📄 .github/scripts/plan_local_java_tests.py:1265 📄 .github/scripts/plan_local_java_tests.py:166-169
collect_changed_files puts untracked files in the plan (git ls-files --others), and Repo and git grep --untracked also pick them up. But dirty is computed with git status --porcelain --untracked-files=no. A run that depends on a new, uncommitted IT or source file therefore records PASSED for HEAD with no 'uncommitted changes were present' note. The pr-checklist gate then reads that block as proof for a commit that doesn't contain the tested code. Fix: count untracked files when computing dirty.

✅ Bug: Collapsing a full suite in <details> doesn't shrink the PR body

📄 .github/scripts/plan_local_java_tests.py:1015-1029 📄 .github/scripts/plan_local_java_tests.py:1116
The docstring says the <details> block keeps the PR body under GitHub's 65,536-character limit. It doesn't: the collapsed section still writes every class name and its counts into the body, and only hides them when the page renders. openmetadata-service has about 1,060 test classes, and listing each one as `XTest` (N passed, M skipped), comes to roughly 52k characters. A root pom or shared-infra change runs every unit suite, so that list plus the mcp/sdk lists, the rest of the block and a filled-in template (around 6k empty, often more than 10k filled) can go over the limit. When it does, gh pr edit fails under check=True and the results block is never recorded. Above INLINE_CLASS_LIMIT, write only the counts plus the failed or all-skipped classes, and leave the full per-class list in target/java-tests/local-pr-results.md or an artifact.

✅ Edge Case: --ci-run assumes every workflow runs every lane; Redis has no rdf lane

📄 .github/scripts/plan_local_java_tests.py:2080 📄 .github/scripts/plan_local_java_tests.py:1613 📄 .github/java-tests/impact-map.json:90-93
main sets ci_lanes = set(planner.maven["lanes"]), and run_commands then lets any --ci-run stand in for every lane step on that run's engine. The Integration Tests - PostgreSQL + Elasticsearch + Redis workflow (cache-tests in ciWorkflows) only has the parallel, global-state, multi-node and retry-queue lanes in its matrix. It has no rdf lane. Suppose a cache change selects an RDF-lane IT on cache-tests (cache code adds that engine through the area and engineRules). That step is then recorded as passed from a CI run that never ran it, and the PR block shows a test as covered when it wasn't. A fix is to let each ciWorkflows entry list the lanes it runs (for example "lanes": [...]) and accept CI evidence only for those lanes, so any other lane still runs locally.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@mohityadav766
mohityadav766 added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit b607560 Oct 7, 2026
106 checks passed
@mohityadav766
mohityadav766 deleted the feature/restructure-java-test-ci-gating branch October 7, 2026 22:20
timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Oct 8, 2026
…n-metadata#34892)

- Integration Tests - MySQL + Elasticsearch / PostgreSQL + OpenSearch: a PR
  now triggers them only so their required checks report. Every job is
  skipped on a PR, and a skipped required check passes. The merge queue,
  main pushes and manual dispatch run them as before. The `safe to test`
  label gate and the PR-head checkout under pull_request_target are gone.
- PostgreSQL + Elasticsearch + Redis: no PR trigger; it is not required.
- JavaUIIT (java-playwright-nightly.yml): dispatch only. No PR or merge-queue
  trigger and no java-ui-it gate, which no ruleset requires any more;
  openmetadata-nightly runs these suites on a schedule.
- Maven Collate Tests: also runs in the merge queue when backend paths
  change, and builds the Collate branch matching the PR or queue base. The
  event it passes decides what Collate runs.
- Harness integrity: also runs when ITs, the IT pom, the impact map or the
  planner change, so check 8 (java-impact-map) sees a new IT.

Before review, `make java_affected_run` runs the ITs a PR impacts (open-metadata#34818).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Run Java integration tests only in the merge queue, with an impact-mapped local run before review

2 participants