Skip to content

Fixes 31478: re-scope the Data Insights data asset charts in 1.13.6 SQL - #33049

Merged
ulixius9 merged 1 commit into
mainfrom
fix-data-assets-count-mismatch
Sep 10, 2026
Merged

ulixius9 merged 1 commit into
mainfrom
fix-data-assets-count-mismatch

Conversation

@ulixius9

@ulixius9 ulixius9 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #31478

#31759 fixed the scope of the Data Insights data-asset charts but shipped the rewrite as a Java data migration hung off 1.13.5, and no deployment ever ran it. 1.13.5-release had already shipped and been recorded by the time the fix landed, and MigrationWorkflow never reaches runDataMigration() for a version a deployment has already recorded once that version is no longer the release train's highest — processNativeMigrations drops it outright, and even while it is the highest, filterAndGetMigrationsToRun skips a reprocessing version whose SQL has all run. So https://release-1-13.getcollate.io/data-insights/data-assets still serves the pre-fix definitions: the breakdown shows a Data Products bucket that the migrated excludeGroups excludes, and the summary card sits 28 above the sum of the buckets.

This PR expresses the same repair as guarded SQL in 1.13.6 and deletes the Java migration. runSchemaChanges/runPostDDLChanges are not behind shouldRunDataMigration, and parseSQLFiles keeps any statement whose checksum is absent from SERVER_MIGRATION_SQL_LOGS — so new SQL in the train's highest version runs even where that version is already recorded, which is exactly the case the Java migration could not reach.

Type of change:

  • Bug fix

High-level design:

Why SQL and not a Java migration in a newer slot. Moving the Java migration to 1.13.6 would repeat the bug: 1.13.6 landed on the 1.13 branch on 2026-09-07 (c9819050c3) with real SQL, so nightly deployments have already recorded it, and runDataMigration() for a recorded version is gated by shouldRunDataMigration. SQL scripts are not, and they are keyed by per-statement checksum rather than by version. Traced through processNativeMigrations, the SQL reaches all three deployment states:

deployment recorded 1.13.6
release-1-13 (nightly) …1.13.5, 1.13.6 reprocessed → new statements kept → runs
customer whose max is 1.13.5 …1.13.5 fresh → runs
2.x on main …2.0.2 fresh → runs

What the SQL does. Two guarded UPDATEs on di_chart_entity for the 14 system charts that report on data assets:

  1. chartDetails.metrics[0].filter ← a filter requiring exists(entityType). A list of must_not term clauses cannot separate data assets from the data-quality documents that share the di-data-assets-* pattern, because those documents have no entityType at all and therefore satisfy every must_not clause. A positive exists is the only predicate that does.
  2. chartDetails.excludeGroups ← ["tag","glossaryTerm","dataProduct"], but only where groupBy = entityType.keyword, so the breakdown excludes exactly what the card's filter excludes.

Each statement compares against the stored value, so replaying it on a deployment that already holds the corrected definitions writes nothing.

Rollout / compatibility. No schema change, no API change. 1.13.5's (now empty) Java migration classes are removed; the 1.13.5 SQL folder is left alone since its other statements are unrelated. A definition with more than one metric is skipped by a JSON_LENGTH/jsonb_array_length guard rather than partially rewritten — all 14 charts are single-metric today (1.5.0 builds each with List.of(one)), so this is defensive.

Alternatives rejected.

  • Java migration in 1.13.6 — same gate, does not reach release-1-13 (above).
  • Dummy SQL statement in 1.13.5 — verified ineffective: 1.13.5 and 1.13.6 share a ReleaseTrain(major, minor), so once 1.13.6 is recorded 1.13.5 is dropped before its SQL is ever parsed. Covered by testNewSqlInAnOlderRecordedVersionDoesNotBringItBack.
  • Re-scoping on every server start — version-independent and self-healing, but this is a one-time repair and does not belong on the startup path.
  • Detaching the dataInsightAliases — would fix the count but regress fix(data-insights): read DQ incident data from live indices, drop 30-day cap #29963, where custom Data Insights charts deliberately read those live indices.

Incidental fix. DataInsightSystemChartRepository resolved its SearchClient in a static initializer, so the class NPEs on class-load in any context where the application is not yet up. That is also why #31759's own migration unit test only passed when co-run with the OpenSearch test that installs a SearchRepository. It is now resolved per call.

Tests:

Use cases covered

  • Data Insights dashboard: "Total Data Assets" equals the sum of its per-entity-type breakdown when test case results exist in the window
  • The per-type breakdown reports only genuine data assets (no tag, glossaryTerm or dataProduct bucket)
  • Description/owner coverage percentages are no longer depressed by test-case documents inflating the denominator
  • An existing deployment's stored definitions are re-scoped on upgrade — including one that already recorded 1.13.6 — without losing their formulas
  • A deployment that already holds the corrected definitions, and any user-created chart, are left untouched

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated:
    • openmetadata-service/src/test/java/org/openmetadata/service/migration/utils/v1136/DataAssetChartScopeSqlMigrationTest.java (new) — the SQL embeds DataInsightSystemChartRepository.DATA_ASSET_FILTER and the excludeGroups literal verbatim; both dialects scope the same 14 charts; every UPDATE is guarded; each file parses into exactly 2 statements through MigrationFile.parseSQLFile, the same Flyway dialect parser the workflow uses; and the post-migration JSON captured from a real database deserializes into LineChart/SummaryCard with the scope applied.
    • openmetadata-service/src/test/java/org/openmetadata/service/migration/MigrationWorkflowReprocessingTest.java — four cases added for the rollout the previous fix was lost to: an older recorded version is dropped, the highest recorded version is dropped without new SQL, new SQL in an older recorded version does not bring it back, and new SQL on the highest recorded version does.
    • openmetadata-service/src/test/resources/migration/v1136/*.json (new) — post-migration chartDetails captured verbatim from MySQL 8.0.46; the PostgreSQL 15.19 row parses to the same object.
  • Files removed: .../migration/utils/v1135/DataInsightChartMigrationTest.java (the Java migration it covered is gone).
  • Result: mvn test -pl openmetadata-service -Dtest=DataAssetChartScopeSqlMigrationTest,MigrationWorkflowReprocessingTest,DataAssetChartScopeTest → Tests run: 37, Failures: 0, Errors: 0. spotless:check clean.
  • DataAssetChartScopeTest (Fixes 31478: stop Data Insights summary cards counting test case results #31759's real-OpenSearch regression test) passes — worth noting it silently reports Tests run: 0 without a Docker daemon, via assumeTrue.
  • No measured coverage figure is claimed — I did not run mvn jacoco:report. The changed Java surface is one extracted accessor in DataInsightSystemChartRepository; its callers (getPreviewData, listChartData) are exercised by the existing DataInsightSystemChartResourceIT. The behaviour of this PR lives in SQL, which jacoco does not measure and which the tests above cover directly.

Backend integration tests

  • Not applicable — no API endpoint added or changed.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Executed against the engine versions this repo ships (docker/mysql/Dockerfile_mysql → mysql:8.0, docker/postgresql/Dockerfile_postgres → postgres:15), on the 1.5.0 di_chart_entity DDL seeded with definitions in the shape 1.5.0/1.6.0 actually leave them:

  1. Started mysql:8.0.46 and postgres:15.19 containers, created di_chart_entity from the 1.5.0 migration DDL (it is not in bootstrap/sql/schema/*.sql).
  2. Inserted 8 rows: 5 pre-fix definitions, 1 already-migrated definition, 1 user-created chart grouped on entityType.keyword, and 1 definition with two metrics.
  3. Ran postDataMigrationSQLScript.sql for each dialect. Both engines reported identical row counts — UPDATE 5 (filters) and UPDATE 2 (breakdown groups).
  4. Verified per row: the breakdown gained the filter and dropped dataProduct; the cards' stale must_not filter was replaced; a chart grouped on tier.keyword got the filter but not entity-type excludeGroups; the already-migrated definition and the user's own chart were byte-identical; the two-metric definition was skipped, not half-rewritten.
  5. Re-ran both scripts → UPDATE 0 / UPDATE 0, and the table state was byte-identical. MySQL and PostgreSQL converged on the same JSON, with filter stored as a JSON string and excludeGroups as an array (JSON_TYPE/jsonb_typeof), which is what SummaryChartMetric.filter and LineChart.excludeGroups require.
  6. Drove the real MigrationWorkflow.loadMigrations() against a real MySQL and the real bootstrap/sql/migrations/native tree, with every 1.x version through 1.13.6 recorded in SERVER_CHANGE_LOG:
    • pending → [1.12.12, 1.13.6, 2.0.0, 2.0.1, 2.0.2, 2.1.0] — 1.13.6 is still offered despite being recorded
    • after inserting its two statement checksums into SERVER_MIGRATION_SQL_LOGS → [1.12.12, 2.0.0, 2.0.1, 2.0.2, 2.1.0] — 1.13.6 drops out
      so the repair reaches an already-upgraded deployment exactly once.

Not covered: runMigrationWorkflows() itself — selection was driven against a real DB and execution against real DBs, but not both in one process, since computeMigrationContext needs the initialized entity registry. CI's containerized migration run covers that.

UI screen recording / screenshots:

Not applicable — no UI changes. The numbers the existing Data Insights dashboard renders change; the components do not.

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.
  • For JSON Schema changes: not applicable — no schema change; this PR is the data migration.
  • For UI changes: not applicable.
  • I have added tests (unit / integration as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing, with the issue number commented in the test for future reference.

🤖 Generated with Claude Code

PR #31759 rewrote the stored chart definitions from a Java data migration hung
off 1.13.5. 1.13.5-release had already shipped and been recorded by then, and
MigrationWorkflow never reaches runDataMigration() for a recorded version once
it is no longer the release train's highest: processNativeMigrations drops it
outright, and even while it is the highest, filterAndGetMigrationsToRun skips a
reprocessing version whose SQL has all run. So no deployment ran it, and
release-1-13 still serves the pre-fix definitions — its breakdown shows a Data
Products bucket the migrated excludeGroups excludes, and the summary card sits
28 above the sum of the buckets.

Express the repair as SQL in 1.13.6 instead. runSchemaChanges and
runPostDDLChanges are not behind shouldRunDataMigration, and parseSQLFiles keeps
any statement whose checksum is absent from SERVER_MIGRATION_SQL_LOGS, so new
SQL in the train's highest version runs even where that version is already
recorded. That covers all three states: release-1-13 (1.13.6 recorded,
reprocessed), a customer whose max is 1.13.5 (1.13.6 fresh), and 2.x on main
(1.13.6 fresh). Both statements are guarded on the stored value, so a deployment
that already holds the corrected definitions is untouched.

The 1.13.5 Java migration and DataInsightChartMigration are removed;
DataInsightSystemChartRepository keeps DATA_ASSET_FILTER and
NON_DATA_ASSET_ENTITY_TYPES as the scope the aggregators and the OpenSearch
regression test read, and the SQL is pinned to them by test. Its SearchClient
moved out of a static initializer, which made the class NPE before the
application is up — that is also why the old migration's unit test only passed
when co-run with the OpenSearch test that installs a SearchRepository.

Verified end to end against the engine versions OpenMetadata ships (mysql:8.0.46
and postgres:15.19), on the 1.5.0 table DDL seeded with pre-fix definitions as
1.5.0/1.6.0 leave them. Both engines report identical row counts — 5 filter
rewrites and 2 breakdown rewrites, then 0 and 0 on a second run — and converge
on identical JSON, with filter stored as a JSON string and excludeGroups as an
array:
- the breakdown gains the filter and drops dataProduct; the cards' stale
  must_not filter is replaced; a chart grouped on tier.keyword gets the filter
  but is not given entity-type excludeGroups
- an already-migrated definition, and a user's own chart grouped on
  entityType.keyword, are both left byte-identical
- a definition with two metrics is skipped by the JSON_LENGTH/jsonb_array_length
  guard rather than half-rewritten

The rollout claim was also driven through the real MigrationWorkflow against a
real MySQL and the real bootstrap/sql/migrations tree: with 1.13.6 recorded in
SERVER_CHANGE_LOG it is still offered, and once its two statement checksums are
in SERVER_MIGRATION_SQL_LOGS it drops out — so the repair reaches an
already-upgraded deployment exactly once.

Tests:
- DataAssetChartScopeSqlMigrationTest: the SQL embeds DATA_ASSET_FILTER and the
  excludeGroups verbatim, both dialects scope the same 14 charts, every UPDATE is
  guarded, each file parses into exactly 2 statements through the same Flyway
  dialect parser the workflow uses, and the post-migration JSON captured from the
  real database deserializes into LineChart/SummaryCard with the scope applied.
- MigrationWorkflowReprocessingTest: the 1.13.4/1.13.5/1.13.6 rollout the Java
  migration was lost to, and that new SQL on the highest recorded version is what
  brings a version back.
- DataAssetChartScopeTest (real OpenSearch node): summary card equals the
  breakdown sum.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 9, 2026 11:59
@ulixius9
ulixius9 requested a review from a team as a code owner September 9, 2026 11:59

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

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 Sep 9, 2026
@gitar-bot

gitar-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

Fixes the Data Insights data asset chart scope by expressing the repair as guarded SQL in 1.13.6 rather than a Java migration, ensuring it reaches all deployment states including those that already recorded 1.13.6. The SQL updates chart filters to require entityType existence and restricts excludeGroups to exclude tag, glossaryTerm, and dataProduct, making the total match the sum of per-type breakdowns. Includes comprehensive test coverage for rollout scenarios and resolves an incidental NPE in DataInsightSystemChartRepository by moving SearchClient resolution from a static initializer to per-call. No issues found.

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

@ulixius9
ulixius9 enabled auto-merge September 9, 2026 12:41
@ulixius9
ulixius9 added this pull request to the merge queue Sep 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-10T01:02:15Z)

Blocked the queue: playwright-summary

@ulixius9
ulixius9 added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit c489498 Sep 10, 2026
151 of 152 checks passed
@ulixius9
ulixius9 deleted the fix-data-assets-count-mismatch branch September 10, 2026 10:03
ulixius9 added a commit that referenced this pull request Sep 16, 2026
…SQL (#33049)

PR #31759 rewrote the stored chart definitions from a Java data migration hung
off 1.13.5. 1.13.5-release had already shipped and been recorded by then, and
MigrationWorkflow never reaches runDataMigration() for a recorded version once
it is no longer the release train's highest: processNativeMigrations drops it
outright, and even while it is the highest, filterAndGetMigrationsToRun skips a
reprocessing version whose SQL has all run. So no deployment ran it, and
release-1-13 still serves the pre-fix definitions — its breakdown shows a Data
Products bucket the migrated excludeGroups excludes, and the summary card sits
28 above the sum of the buckets.

Express the repair as SQL in 1.13.6 instead. runSchemaChanges and
runPostDDLChanges are not behind shouldRunDataMigration, and parseSQLFiles keeps
any statement whose checksum is absent from SERVER_MIGRATION_SQL_LOGS, so new
SQL in the train's highest version runs even where that version is already
recorded. That covers all three states: release-1-13 (1.13.6 recorded,
reprocessed), a customer whose max is 1.13.5 (1.13.6 fresh), and 2.x on main
(1.13.6 fresh). Both statements are guarded on the stored value, so a deployment
that already holds the corrected definitions is untouched.

The 1.13.5 Java migration and DataInsightChartMigration are removed;
DataInsightSystemChartRepository keeps DATA_ASSET_FILTER and
NON_DATA_ASSET_ENTITY_TYPES as the scope the aggregators and the OpenSearch
regression test read, and the SQL is pinned to them by test. Its SearchClient
moved out of a static initializer, which made the class NPE before the
application is up — that is also why the old migration's unit test only passed
when co-run with the OpenSearch test that installs a SearchRepository.

Verified end to end against the engine versions OpenMetadata ships (mysql:8.0.46
and postgres:15.19), on the 1.5.0 table DDL seeded with pre-fix definitions as
1.5.0/1.6.0 leave them. Both engines report identical row counts — 5 filter
rewrites and 2 breakdown rewrites, then 0 and 0 on a second run — and converge
on identical JSON, with filter stored as a JSON string and excludeGroups as an
array:
- the breakdown gains the filter and drops dataProduct; the cards' stale
  must_not filter is replaced; a chart grouped on tier.keyword gets the filter
  but is not given entity-type excludeGroups
- an already-migrated definition, and a user's own chart grouped on
  entityType.keyword, are both left byte-identical
- a definition with two metrics is skipped by the JSON_LENGTH/jsonb_array_length
  guard rather than half-rewritten

The rollout claim was also driven through the real MigrationWorkflow against a
real MySQL and the real bootstrap/sql/migrations tree: with 1.13.6 recorded in
SERVER_CHANGE_LOG it is still offered, and once its two statement checksums are
in SERVER_MIGRATION_SQL_LOGS it drops out — so the repair reaches an
already-upgraded deployment exactly once.

Tests:
- DataAssetChartScopeSqlMigrationTest: the SQL embeds DATA_ASSET_FILTER and the
  excludeGroups verbatim, both dialects scope the same 14 charts, every UPDATE is
  guarded, each file parses into exactly 2 statements through the same Flyway
  dialect parser the workflow uses, and the post-migration JSON captured from the
  real database deserializes into LineChart/SummaryCard with the scope applied.
- MigrationWorkflowReprocessingTest: the 1.13.4/1.13.5/1.13.6 rollout the Java
  migration was lost to, and that new SQL on the highest recorded version is what
  brings a version back.
- DataAssetChartScopeTest (real OpenSearch node): summary card equals the
  breakdown sum.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit c489498)
ulixius9 added a commit that referenced this pull request Sep 16, 2026
…the 2.0.3 slot

On main the re-scope ships as SQL under bootstrap/sql/migrations/native/1.13.6,
which is the right slot for the 1.13 train but unreachable on this one.
MigrationWorkflow selects versions by exact set membership against
SERVER_CHANGE_LOG and drops an already-recorded version unless it is the
recorded maximum. On a 2.0.x deployment a 1.13.6 directory is therefore either
already recorded (upgraded from the 1.13 train, where it was the max) or is no
longer the max because 2.0.x sits above it -- in both cases the statements are
never offered, and the summary cards keep out-counting the breakdown beneath
them.

2.0.3 is unrecorded everywhere on this train, so the statements are applied
exactly once on the next upgrade. Both UPDATEs are guarded on the stored value,
so a deployment that already picked the fix up on 1.13.6 before upgrading is
left untouched.

- bootstrap/sql/migrations/native/{1.13.5,1.13.6}/ dropped -- 2.0's native
  directories stop at 1.13.4, and nothing references them now that #33049's
  revert removed the v1135 Java classes.
- The SQL moves verbatim into the 2.0.3 postDataMigrationSQLScript.sql that the
  table-aliases commit already created (its header note is rewritten for this
  train); the v203 Java data migration and this SQL share the slot without
  interacting.
- DataAssetChartScopeSqlMigrationTest moves to the v203 package and reads the
  2.0.3 path, with its fixtures under test/resources/migration/v203.
  migrationParsesWithTheDialectParser now drives the real MigrationFile
  instance API, because 2.0 has no static MigrationFile.parseSQLFile -- which
  exercises the same parse path the workflow takes rather than a helper.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
ulixius9 added a commit that referenced this pull request Sep 30, 2026
…the Data Insights chart rescope, both on 2.0.3 (#33415)

* Fixes 31512: Ingest SQL Server synonyms as Table.aliases (#31829)

* feat(spec): add source-managed aliases field to Table entity

Adds an aliases[] array of alternate fully-qualified SQL names (e.g.
SQL Server synonyms) to Table and CreateTableRequest, so a synonym can
be recorded on the canonical table it resolves to instead of creating
a second entity.

* fix(ingestion): sort aliases in source hash normalization for stable digests

Source hash should be stable regardless of alias list ordering, since
sys.synonyms in MSSQL provides no row ordering guarantee. This change sorts
the aliases list before hashing to ensure consistent digest generation
across ingestion runs.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* feat(mssql): add sys.synonyms query and synonym result models

* feat(mssql): parse and normalize sys.synonyms base_object_name identifiers

Implement split_sql_server_identifier() for bracket-aware T-SQL identifier
splitting and parse_base_object_name() to normalize synonym base_object_name
into a three-part target (database.schema.table), with handling for missing
parts (defaulting schema to 'dbo' and database to the synonym's database),
remote references, and edge cases.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* feat(mssql): add bounded synonym map with consumption tracking

Add SynonymMap class to track SQL Server synonyms with bounded memory
usage and consumption tracking. Implements the following:

- MAX_SYNONYM_ENTRIES: bounded cache with 5000-entry default cap
- add(): stores aliases by target, rejects new targets beyond cap
- aliases_for(): returns sorted aliases and marks target consumed
- record_unresolved(): explicitly records unresolved synonyms
- unresolved(): reports both explicit and unconsumed targets
- is_empty(): checks if the map contains any entries

Includes 9 unit tests covering all core behaviors and edge cases:
alias sorting, deduplication, cap enforcement, consumption tracking,
and unresolved reporting. All 29 tests (20 existing + 9 new) pass.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* style(ingestion): apply ruff formatting to alias test files

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(mssql): bound unresolved synonym list and document aliases_for side effect

Finding 1 (Critical): _explicit_unresolved is now capped at max_entries to
prevent unbounded memory growth on catalogs with many malformed synonyms.
Uses a separate warn-once flag _unresolved_cap_warned to avoid silencing
target-cap warnings.

Finding 2 (Minor): aliases_for method now has a docstring documenting that
calling it marks the target consumed and signals successful ingestion. This
establishes the contract for the "call exactly once per table" expectation.

Includes new test test_unresolved_cap_bounds_explicit_entries verifying the cap
applies correctly to record_unresolved calls.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* feat(ingestion): add get_table_aliases hook to the shared table producer

* fix(ingestion): remove connector-specific vocabulary from get_table_aliases docstring and add wiring test

* feat(mssql): discover synonyms up front and attach them as table aliases

Sweeps sys.synonyms across every in-scope database in MssqlSource.prepare()
(before the topology produces anything), builds a target FQN -> alias FQNs
map, and resolves each table's aliases by construction via a get_table_aliases
override. close() reports synonyms that never resolved to an ingested table.

* test(mssql): cover synonym-sweep routing in _in_scope_database_names/prepare

Adds coverage for the keystone routing logic that decides which databases
prepare() sweeps for synonyms: the ingestAllDatabases=False short-circuit,
databaseFilterPattern exclusion, prepare() wiring build_synonym_map's result
into self.synonym_map, and prepare()'s resilience path leaving a usable
empty SynonymMap (not None) when the sweep raises.

* feat(search): index table aliases for exact and partial matching

* fix(service): wire CreateTable.aliases through to the persisted Table entity

TableMapper.createToEntity never copied create.getAliases() onto the
Table it builds, so the aliases field added in the Table/CreateTable
schema (feat(spec): add source-managed aliases field to Table entity)
was silently dropped on both POST and PUT: it could never reach the
entity to be created, updated, replaced, or merged in the first place.
Discovered while writing the Task 9 integration test for the mssql
synonym-aliases design (out of that task's stated file scope, but a
blocking prerequisite for it to test anything at all).

* fix(service): replace table aliases wholesale on update, don't silently drop changes

TableUpdater.entitySpecificUpdate never registered "aliases" with
recordChange, so a PUT that changed only aliases produced no field
diff: entityChanged/versionChanged stayed false and storeUpdate()
skipped persisting the new version entirely. The PUT response still
echoed the caller's in-memory Table (with the new aliases), masking
that the database row kept the stale value — confirmed by re-fetching
the entity after the PUT in the Task 9 integration test.

Registering aliases here, alongside the other plain-field
recordChange calls, makes updateVersion() see the change and persist
it, so a PUT with a new aliases list replaces the array wholesale
(matching default List<String> semantics) instead of being ignored.
This is required for the mssql synonym design's "the connector
resends the full list every run, no diffing needed" property to hold.

* test(service): assert table aliases are replaced wholesale across runs

Gate on the mssql synonym-aliases design assumption that a PUT
CreateTable with a full aliases list replaces the array wholesale, so
created/dropped/retargeted synonyms reconcile through plain upsert
semantics with no diffing stage. Covers initial set, retarget (old
alias gone), and clear (empty list clears aliases), re-fetching the
entity after each PUT rather than trusting the mutation response's
in-memory echo.

Running it against unpatched code (git stash the two preceding fix
commits) confirmed the assumption did NOT hold by default: aliases
never reached the entity at all (TableMapper gap), and once that was
fixed, a retarget silently failed to persist (TableUpdater gap) while
the PUT response still reported the new value. Both gaps are fixed in
the two preceding commits; default array replace semantics were not
sufficient on their own.

* fix(service): use recordListChange for table aliases, not recordChange

recordChange compares aliases with List::equals, which is order-sensitive
and does not normalize null against empty. GlossaryTerm.synonyms (also a
List<String> of alternate names) already uses recordListChange with
listOrEmpty normalization for exactly this reason; Topic.cleanupPolicies
follows the same pattern. Two concrete problems with recordChange here:

- Order churn: ["b","a"] vs ["a","b"] would record as a change, bumping
  the table's version and firing a change event on every re-ingestion
  even when the alias set is unchanged. This was only masked by
  SynonymMap.aliases_for returning a sorted list, making the server
  contract silently depend on every producer sorting.
- Null/empty asymmetry: original=null, updated=[] took the "orig == null"
  branch and recorded a fieldAdded, bumping the version for a table whose
  alias set went from nothing to nothing.

Switch to recordListChange with listOrEmpty-normalized inputs and
stringMatch, following GlossaryTermRepository.updateSynonyms exactly.
Verified via TableResourceIT#put_tableAliases_replaceNotMerge that all
three transitions (set, retarget, clear) still replace wholesale:
retarget now records added+deleted, clear records deleted, and each
correctly marks entityChanged so the new version persists.

* test(service): assert aliases persistence on create, and pin the clear value

Two fixes to put_tableAliases_replaceNotMerge from review:

- The initial-set leg only asserted on the create response (the in-memory
  echo of the request), not on a re-fetched entity, so it proved echo
  rather than persistence. A mapper that wired aliases into the create
  path but dropped them at store time would have passed this leg while
  legs 2/3 (which do re-fetch) still passed via the original=null ->
  fieldAdded path on the first PUT. Added an explicit re-fetch assertion
  so the create path is actually covered.
- The clear leg sent aliases=[] and accepted either null or empty back.
  Now that aliases uses recordListChange (previous commit), the
  persisted value is deterministic, so assert on it directly. Changed
  the leg to send aliases=null instead of aliases=[], matching what
  SynonymMap.aliases_for (ingestion/src/metadata/ingestion/source/database/mssql/synonyms.py)
  actually returns on a miss (None, not an empty list) -- this is the
  production clear path the mssql connector takes, not a hypothetical one.

* feat(lineage): resolve alias FQNs to their canonical table

Add es_search_from_alias to the ES mixin and a fallback in
search_table_entities so lineage resolves a source-managed alias
(e.g. a SQL Server synonym) to the canonical table it points at.
Generic, service-agnostic: works for any connector that populates
Table.aliases, without depending on connector-specific in-memory state.

* feat(ui): show read-only table aliases on the table detail page

Adds a TableAliases widget that lists a table's source-managed alternate
FQNs (e.g. SQL Server synonyms) on the table detail page. Display-only by
design: the MSSQL connector recomputes and overwrites aliases on every
run, so an edit control would silently discard user input.

Also regenerates the UI's TS types for Table/CreateTable/BulkCreateTable
from the JSON Schema to pick up the aliases field added in a prior schema
change; the previous change updated only the schema, never the generated
UI types (make update_typescript_types), leaving Table.aliases absent
from the frontend contract. Verified the regeneration touched only the
aliases addition with no unrelated churn.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* test(ui): add Playwright coverage for the table aliases widget

Creates a table with source-managed aliases via the API, visits its
page, and asserts the display-only widget renders each alias and
offers no edit control (the connector overwrites aliases on every
ingestion run, so an editable field would silently discard input).
Also covers the negative case: a table with no aliases renders no
widget at all.

* fix(mssql): resolve 3 basedpyright errors from the alias feature

- common_db_source.py: wrap get_table_aliases() strings in
  FullyQualifiedEntityName before assigning to CreateTableRequest.aliases,
  which is invariantly typed list[FullyQualifiedEntityName] | None.
- source_hash.py: cast the result of _remove_volatile_fields to
  dict[str, Any] before the new "aliases" sort block indexes it by string
  key; narrows the same union for the pre-existing columns/tags/
  tableConstraints/owners blocks too, so their baselined errors also
  clear (baseline.json untouched -- discard mode tolerates unused entries).
- sql_lineage.py: inline-suppress the new search_cache.put(search_tuple, ...)
  call with a narrow pyright:ignore, matching the pre-existing baselined
  call a few lines above -- LRUCache.put's `key: str` annotation is too
  narrow for the tuple keys this cache actually uses everywhere.

make static-checks now reports zero errors attributable to this branch.

* fix(lineage): stub es_search_from_alias in TestDbUtils to prevent bogus MagicMock matches

search_table_entities' Task-10 alias fallback treats any truthy return from
metadata.es_search_from_alias as a resolved alias. TestDbUtils.setUp builds a
bare MagicMock() metadata client; any test that reaches the fallback without
stubbing this call gets an unconfigured, auto-truthy MagicMock back instead of
None, which the fallback short-circuits on and returns as if it were real
Table entities -- breaking test_get_view_lineage_success_with_fallback, whose
schema-fallback scenario reaches this exact branch.

es_search_from_alias's real contract is Optional[List[Table]]; production
code has no bug here since a real client only ever returns that shape. The
gap is purely a missing test stub, so the fix is stubbing it (return None)
once in setUp, covering every test in the class the same way es_search_from_fqn
and get_by_name are already stubbed, rather than papering over it per-test.

Audited every other MagicMock-metadata test in tests/unit/lineage,
tests/unit/test_db_utils.py, and tests/unit/topology that exercises
search_table_entities/get_table_entities_from_query/get_view_lineage without
mocking the function away entirely (test_cross_database_lineage_sql.py,
test_stored_procedure_lineage.py, test_grafana.py, test_hex_lineage.py,
test_snowflake_access_history_lineage.py, test_dbtcloud.py): none reach the
alias-fallback branch today (confirmed by temporary instrumentation), so no
other test file needed a stub.

* fix(mssql): case-fold SynonymMap's lookup key, not the stored alias FQN

Verified against a real SQL Server 2022 instance: sys.synonyms.base_object_name
preserves the exact casing typed in CREATE SYNONYM ... FOR ..., never the
target object's actual stored casing. Under SQL Server's default
case-insensitive collation this is routine (CREATE SYNONYM dbo.o FOR
analytics_master.dbo.Orders against a table stored as "orders" is completely
normal T-SQL), but SynonymMap's dict/set lookups were case-sensitive Python
string comparisons, so the alias silently missed its target and got reported
as an unresolved synonym even though the target exists and was ingested --
defeating the feature's primary use case of cross-database synonyms.

Fix: _targets is now keyed on target_fqn.casefold() in add()/aliases_for();
_consumed stores the same folded key so a target consumed via a differently
cased lookup is correctly excluded from unresolved(). Alias FQN values are
never folded -- OpenMetadata FQNs are case-preserving, so aliases[] must keep
the source's original casing. Bounded caps and warn-once flags on both
_targets and _explicit_unresolved are untouched.

Added 3 tests to TestSynonymMap covering case-insensitive lookup in both
casing directions, original-case preservation of the returned alias, and
consumption-tracking correctness across a case mismatch; all pre-existing
exact-case tests continue to pass unmodified.

* fix(search): wire aliases into the table query and drop the dead boost

I1: the aliases field was added to the search document and to
searchSettings.allowedFields, but neither is consulted when building
the actual Explore query -- ElasticSearchSourceBuilderFactory builds
data-asset queries solely from assetTypeConfigurations[table].searchFields,
which never listed aliases. Searching an alias FQN therefore returned
zero results, contradicting the design spec's search guarantee.

Add aliases (boost 5.0, standard match, mirroring TableIndex's intended
columns.name weight) and aliases.keyword (boost 10.0, exact match, for
FQN-precise ranking) to the table searchFields, and aliases to
highlightFields so a match actually produces highlight fragments.

Also remove TableIndex.getFields()'s dead "aliases" boost entry --
getFields() has zero production callers for TableIndex, so the entry
did nothing -- and replace the vacuous test that asserted on it with
one that asserts against the settings-driven path search actually
uses.

* fix(migration): backfill the aliases search settings on upgrade

I2: searchSettings.json is seed data merged additively on startup --
only whole missing asset types get added to an already-installed
instance's stored settings, so upgraded clusters would keep their old
table entry forever and never pick up the aliases searchField/
highlightField from the previous commit. Alias search would work on
fresh installs but stay broken on every upgrade.

Add v210.MigrationUtil.addAliasesSearchSettings(), following the
get/load/merge/save/log skeleton from v200's
backfillSearchRankingSettings() and the hand-rolled boolean-returning
merge-helper pattern from v1132/v11210's search-settings fixes.
Idempotent.

Neither mysql/v210/Migration.java nor postgres/v210/Migration.java
existed yet (2.1.0's data migration was SQL-only so far), so both are
added here to carry the call -- migration class resolution is purely
reflective on the version-derived package name.

* fix(search): drop ignore_above 256 on aliases.keyword in index mappings

M1: fullyQualifiedName's keyword has no ignore_above, and the schema
permits FQNs up to 3072 chars, but aliases.keyword was capped at 256 --
an alias FQN longer than that is silently dropped from the index with
no diagnostic, and es_search_from_alias can never resolve it.

SearchIndexSettings.harden() already backfills ignore_above on any
keyword field lacking one, using the dynamically computed safe char
threshold (well above 3072) -- the same mechanism fullyQualifiedName
relies on -- so removing the static cap does not leave the field
unbounded. Applied identically to all four locale mapping files.

* refactor(lineage): remove tautological guard in search_table_entities

M4: "if table_entities: return table_entities" two lines above the
alias-fallback block already guarantees table_entities is empty by the
time "if not table_entities:" is reached, so the guard was always
true. Drop it and de-indent; no behavior change.

* docs(ingestion): fix stale source_hash docstrings after aliases sort

M5: _normalize_for_hash and generate_source_hash's docstrings still
listed only columns/tags/tableConstraints/owners as sorted, but
aliases was added to the sort list when the mssql synonym feature
landed. Update both to mention it.

* feat(ui): show the alias name instead of the full FQN in the Aliases widget

The service, database and schema are already established by the table page
the widget sits on, so only the trailing name carries new information. The
full FQN stays available as the cell's title attribute.

Also drops the direct antd/lib/table import that tw-guard rejects for new
files, deriving the column type from the shared Table wrapper's own props.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* feat(mssql): gate synonym ingestion and alias lineage resolution behind includeSynonyms

The alias fallback in search_table_entities fired for every connector's
lineage resolution, costing an extra exact-match search per unresolved
table name even for sources that can never produce aliases.

Adds includeSynonyms to the MSSQL connection. It gates both halves:
prepare() skips the sys.synonyms sweep entirely when disabled, and the
lineage resolver consults aliases only for services that opt in.

The resolver reads the opt-in by field name rather than by service type,
so a connector adding the same field (Oracle synonyms) participates
without this service-agnostic module learning connector names. The
per-service result is cached in a bounded LRU, so an opted-out service
costs one lookup per run rather than one per unresolved name.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* refactor(migration): move the table aliases search-settings backfill from v210 to v1135

The backfill ships with 1.13.5, not 2.1.0, so it belongs on that release
train. Extracted out of v210.MigrationUtil into its own
v1135.TableAliasesSearchSettingsMigration, matching the one-class-per-concern
shape the rest of v1135 uses, and v210 is back to exactly what main has.

* feat(mssql): make includeSynonyms opt-in

Synonym discovery costs an extra sys.synonyms query per in-scope database and
turns on an extra exact-match search per unresolved name during lineage, so
every MSSQL service paid for it on upgrade whether or not it has synonyms.
Default to false and let the operator turn it on.

The gate already treated an absent field as off (service_resolves_aliases
reads it with getattr(..., False)), so this only changes what a service that
never set the toggle gets.

* Update generated TypeScript types and dereferenced schemas

* refactor(migration): move the table aliases search-settings backfill to a new v202

v1135 was the wrong home: MigrationWorkflow drops an already-recorded version
from the apply list unless it is the max recorded one, and reprocessing only
runs runDataMigration when the version equals that max. Any instance carrying
1.13.5 alongside something newer would therefore never backfill the aliases
searchFields, and alias search would keep returning nothing.

2.0.2 is a fresh version no deployment has recorded, so it is picked up exactly
once on the next upgrade whatever train the instance is on -- an unrecorded
version is applied regardless of its ordering against the recorded max.

Adds the native 2.0.2 SQL directories for both engines (empty, like 2.0.1 --
this is a data migration only) and MigrationWiringTest, because a mismatch
between the directory name and the Java package silently resolves to the
default no-op migration class with no error.

* Fix UI checkstyle

Prettier collapses the ALIAS_NAMES array onto one line. The playwright lint
step is new to this branch -- it arrived with #31994 in the merge from main, so
this spec had never been format-gated.

* Fix Python checkstyle

py_format_check gained a suppressions ratchet in the merge (#31643, the same
commit as the typing modernization). It rejects two things this branch had:
five f-string logging calls not in the G004 baseline, and two '# noqa: UP045'
suppressions -- the ratchet forbids suppressing the codes it enforces rather
than fixing them.

Converted the logging to lazy %-style and the annotations to 'X | None', which
made the typing import in synonyms.py unused. The G004 baseline is untouched:
its fingerprints are content-based, so the pre-existing debt in sql_lineage.py
and mssql/metadata.py still matches.

* test(ui): add table aliases to the default search settings fixture

The Playwright fixture mockEntitySearchConfig deep-equals the table config
returned by PUT /system/settings/reset/searchSettings. Adding the aliases
search fields and highlight field to searchSettings.json made that assertion
fail in all three SearchSettings specs that call restoreDefaultSearchSettings.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Fix UI checkstyle: reduce getWidgetHeight complexity in TableClassBase

Adding the TABLE_ALIASES case pushed the getWidgetHeight switch to a
cyclomatic complexity of 11, over the sonarjs limit of 10. Replace the
switch with a lookup against an explicit list of the keys it handled, so
widgets absent from that list still fall back to height 1 (notably
CUSTOM_PROPERTIES and KNOWLEDGE_ARTICLE, which have entries in
defaultWidgetHeight but were never cased). Add TableClassBase.test.ts to
pin that behaviour; it passes against both the old switch and the lookup.

This also clears the Licence Header check, which only failed because
`yarn lint:base --fix` aborted on the ESLint error before the lint step
could revert organize-imports' writes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shailesh Parmar <[email protected]>
(cherry picked from commit ab788cf)

* Fixes 33374: allow Table.aliases through the entity patch (#33375)

Aliases are recomputed from the source on every run, but every table that
already exists in OpenMetadata is updated through a PatchRequest, and
build_patch diffs both models through `include=allowed_fields`. With
`aliases` missing from the allow-list the field could never produce an
operation, so SQL Server synonyms only ever landed on tables created for
the first time - silently, with no error and a 100% success run.

(cherry picked from commit c4fce13)

* refactor(migration): move the table aliases search-settings backfill to 2.0.3

2.0.2 is already released, and MigrationWorkflow selects versions by exact
set membership against SERVER_CHANGE_LOG: a cluster that has already recorded
2.0.2 never re-applies it, so a data migration retro-fitted into that slot
never runs and alias search keeps returning nothing on exactly the upgraded
instances it was written for.

2.0.3 is unrecorded everywhere, so it is picked up exactly once on the next
upgrade. v202 keeps its own two search-settings repairs, which shipped with
2.0.2 and are out of scope here.

Adds the native 2.0.3 SQL directories for both engines (empty, like 2.0.1 --
this is a data migration only) and a MigrationWiringTest for 2.0.3, because a
mismatch between the directory name and the Java package silently resolves to
the default no-op migration class with no error.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* chore(playwright): auto-refresh impact-map.generated.json [skip ci]

* Fixes 31478: stop Data Insights summary cards counting test case results (#31759)

* fix(data-insights): exclude data-quality docs from data-asset totals

The di-data-assets-* pattern the charts read also resolves the data-quality
aliases (di-data-assets-testcaseresult, -testcaseresolutionstatus) that #29963
attached to the live test case indices. TestCaseResult and
TestCaseResolutionStatus are EntityTimeSeriesInterface, not EntityInterface, so
SearchIndex.populateCommonFields never runs for them and their documents carry
no entityType.

That split the two "total data assets" charts. total_data_assets groups with a
terms aggregation on entityType.keyword, which puts a document missing the field
in no bucket, so those documents vanished. total_data_assets_summary_card
filtered with a list of bool.must_not.term clauses on the same field, every one
of which a document lacking it satisfies, so they were counted. The card ran
ahead of the breakdown beneath it by exactly the number of test case results in
the window, and the same inflated denominator depressed the description, owner
and tier percentages.

Give the charts one definition of a data asset in
DataInsightSystemChartRepository: DATA_ASSET_FILTER now requires
exists(entityType) alongside the exclusions, and NON_DATA_ASSET_ENTITY_TYPES
feeds both the filter and the breakdown's excludeGroups so the two cannot drift
again. That also closes a second gap in the opposite direction, where the filter
excluded dataProduct but excludeGroups did not.

The 1.13.4 migration re-applies the scope to the fourteen stored charts,
rewriting only the filter and excludeGroups so anything else in a stored
definition survives.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(data-insights): move the chart scope migration to 1.13.5

1.13.4 is frozen: #31386 deliberately made main's copy byte-identical to the
1.13 branch, and any deployment that already ran it under a 2.0.0-rc build would
skip a data migration added there, because shouldRunDataMigration only re-runs a
reprocessed version when it equals the current max.

A new 1.13.5 directory has been executed by nobody, so processNativeMigrations
applies it to every deployment regardless of it sorting below the current max
version. The SQL files are empty because the change is pure data migration,
matching the existing 0-byte 1.13.3 schemaChanges.sql.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: IceS2 <[email protected]>
(cherry picked from commit 1b5914c)

* Fixes #31478: re-scope the Data Insights data asset charts in 1.13.6 SQL (#33049)

PR #31759 rewrote the stored chart definitions from a Java data migration hung
off 1.13.5. 1.13.5-release had already shipped and been recorded by then, and
MigrationWorkflow never reaches runDataMigration() for a recorded version once
it is no longer the release train's highest: processNativeMigrations drops it
outright, and even while it is the highest, filterAndGetMigrationsToRun skips a
reprocessing version whose SQL has all run. So no deployment ran it, and
release-1-13 still serves the pre-fix definitions — its breakdown shows a Data
Products bucket the migrated excludeGroups excludes, and the summary card sits
28 above the sum of the buckets.

Express the repair as SQL in 1.13.6 instead. runSchemaChanges and
runPostDDLChanges are not behind shouldRunDataMigration, and parseSQLFiles keeps
any statement whose checksum is absent from SERVER_MIGRATION_SQL_LOGS, so new
SQL in the train's highest version runs even where that version is already
recorded. That covers all three states: release-1-13 (1.13.6 recorded,
reprocessed), a customer whose max is 1.13.5 (1.13.6 fresh), and 2.x on main
(1.13.6 fresh). Both statements are guarded on the stored value, so a deployment
that already holds the corrected definitions is untouched.

The 1.13.5 Java migration and DataInsightChartMigration are removed;
DataInsightSystemChartRepository keeps DATA_ASSET_FILTER and
NON_DATA_ASSET_ENTITY_TYPES as the scope the aggregators and the OpenSearch
regression test read, and the SQL is pinned to them by test. Its SearchClient
moved out of a static initializer, which made the class NPE before the
application is up — that is also why the old migration's unit test only passed
when co-run with the OpenSearch test that installs a SearchRepository.

Verified end to end against the engine versions OpenMetadata ships (mysql:8.0.46
and postgres:15.19), on the 1.5.0 table DDL seeded with pre-fix definitions as
1.5.0/1.6.0 leave them. Both engines report identical row counts — 5 filter
rewrites and 2 breakdown rewrites, then 0 and 0 on a second run — and converge
on identical JSON, with filter stored as a JSON string and excludeGroups as an
array:
- the breakdown gains the filter and drops dataProduct; the cards' stale
  must_not filter is replaced; a chart grouped on tier.keyword gets the filter
  but is not given entity-type excludeGroups
- an already-migrated definition, and a user's own chart grouped on
  entityType.keyword, are both left byte-identical
- a definition with two metrics is skipped by the JSON_LENGTH/jsonb_array_length
  guard rather than half-rewritten

The rollout claim was also driven through the real MigrationWorkflow against a
real MySQL and the real bootstrap/sql/migrations tree: with 1.13.6 recorded in
SERVER_CHANGE_LOG it is still offered, and once its two statement checksums are
in SERVER_MIGRATION_SQL_LOGS it drops out — so the repair reaches an
already-upgraded deployment exactly once.

Tests:
- DataAssetChartScopeSqlMigrationTest: the SQL embeds DATA_ASSET_FILTER and the
  excludeGroups verbatim, both dialects scope the same 14 charts, every UPDATE is
  guarded, each file parses into exactly 2 statements through the same Flyway
  dialect parser the workflow uses, and the post-migration JSON captured from the
  real database deserializes into LineChart/SummaryCard with the scope applied.
- MigrationWorkflowReprocessingTest: the 1.13.4/1.13.5/1.13.6 rollout the Java
  migration was lost to, and that new SQL on the highest recorded version is what
  brings a version back.
- DataAssetChartScopeTest (real OpenSearch node): summary card equals the
  breakdown sum.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit c489498)

* refactor(migration): carry the #31478 Data Insights chart rescope in the 2.0.3 slot

On main the re-scope ships as SQL under bootstrap/sql/migrations/native/1.13.6,
which is the right slot for the 1.13 train but unreachable on this one.
MigrationWorkflow selects versions by exact set membership against
SERVER_CHANGE_LOG and drops an already-recorded version unless it is the
recorded maximum. On a 2.0.x deployment a 1.13.6 directory is therefore either
already recorded (upgraded from the 1.13 train, where it was the max) or is no
longer the max because 2.0.x sits above it -- in both cases the statements are
never offered, and the summary cards keep out-counting the breakdown beneath
them.

2.0.3 is unrecorded everywhere on this train, so the statements are applied
exactly once on the next upgrade. Both UPDATEs are guarded on the stored value,
so a deployment that already picked the fix up on 1.13.6 before upgrading is
left untouched.

- bootstrap/sql/migrations/native/{1.13.5,1.13.6}/ dropped -- 2.0's native
  directories stop at 1.13.4, and nothing references them now that #33049's
  revert removed the v1135 Java classes.
- The SQL moves verbatim into the 2.0.3 postDataMigrationSQLScript.sql that the
  table-aliases commit already created (its header note is rewritten for this
  train); the v203 Java data migration and this SQL share the slot without
  interacting.
- DataAssetChartScopeSqlMigrationTest moves to the v203 package and reads the
  2.0.3 path, with its fixtures under test/resources/migration/v203.
  migrationParsesWithTheDialectParser now drives the real MigrationFile
  instance API, because 2.0 has no static MigrationFile.parseSQLFile -- which
  exercises the same parse path the workflow takes rather than a helper.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* test: fix 2.0.3 unit tests after merging 2.0

Declare om:aliases in the RDF ontology for the new Table.aliases field, and
scope DataAssetChartScopeSqlMigrationTest to di_chart_entity statements now
that 2.0.3 postDataMigrationSQLScript.sql also carries the RdfIndexApp updates.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shailesh Parmar <[email protected]>
Co-authored-by: IceS2 <[email protected]>
Co-authored-by: Anujkumar Yadav <[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.

Data Insights: summary card count includes test cases, breakdown chart doesn't

3 participants