Skip to content

Backport #31958 to 1.13: fix(glue): stop a custom databaseName dropping every schema - #32400

Merged
mohittilala merged 1 commit into
1.13from
backport/31958-to-1.13
Sep 1, 2026
Merged

mohittilala merged 1 commit into
1.13from
backport/31958-to-1.13

Conversation

@mohittilala

Copy link
Copy Markdown
Contributor

Backport of #31958 to 1.13.

Setting the Glue databaseName produced a successful ingestion with zero schemas and zero tables. get_database_schema_names compared that label against the Glue Catalog ID (the AWS account ID), so nothing ever matched, every schema was skipped, and the run still reported Success with no failures and no warnings.

Cherry-picked from 311b17d0f2f. Original issue: open-metadata/openmetadata-collate#5942.
Two adjustments were needed, neither changes behaviour:

Resulting code in the changed region is byte-identical to main.

* fix(glue): stop a custom databaseName dropping every schema

databaseName labels the OpenMetadata database, it does not name a Glue
catalog. Schema discovery compared it against the Glue Catalog ID, so a
custom name matched nothing and every schema was skipped while the run
still reported Success.

Skip that comparison when databaseName is set, since one name means one
database and every visible Glue database is one of its schemas. Warn when
that merges schemas from more than one catalog, so same-named schemas
colliding is visible rather than silent.

Also correct the connection schema description, which claimed the default
database name is "default" while the code uses the Glue Catalog ID.

* Update generated TypeScript types

* fix(glue): read a schema's tables from its own catalog

_get_glue_tables called get_tables with DatabaseName only, so it read from
the caller's default catalog. Now that a schema from another catalog can be
yielded, its tables would come back empty or belong to a same-named database
in the wrong catalog.

Stash each schema's Catalog ID as it is yielded and pass it to get_tables.
The default path is unaffected, since the database there already is the
caller's Catalog ID.

* fix(glue): ignore a missing Catalog ID when counting catalogs

GlueSchema.CatalogId is Optional, and adding it unguarded put None in the
set used for the merge warning. Sorting that set then raised TypeError
outside the per-schema try/except, so one database without a Catalog ID
aborted schema discovery for the whole service.

Track only non-empty Catalog IDs, reusing the guard the catalog map
already applies.

* test(glue): assert on the warning reason, not the dict repr

Status.warnings holds {key: reason} dicts, so asserting against str() of
the entry depended on dict formatting and never checked which database the
warning was about. Index by the database name instead, so a warning keyed
to the wrong entity fails.

* fix(glue): read Iceberg column detail from the schema's own catalog

get_columns fetched Iceberg table detail with DatabaseName only, so for a
schema discovered in another catalog the lookup resolved in the caller's
catalog and raised. The fallback below it then served the unfiltered
storage-descriptor columns, bringing dropped Iceberg columns back as live
ones with only a logged warning.

Pass CatalogId the same way _get_glue_tables does.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@mohittilala
mohittilala requested review from a team as code owners September 1, 2026 17:17
@github-actions

github-actions Bot commented Sep 1, 2026

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

gitar-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backport of fix to prevent custom databaseName in Glue ingestion from dropping all schemas. The cherry-pick to 1.13 required two adjustments: excluding serviceProgressEvent.ts (which doesn't exist on 1.13) and reformatting a multi-line Markdown call to match main. 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

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.52% (61260/96438) 44.9% (33673/74981) 46.79% (10259/21924)

@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@mohittilala
mohittilala enabled auto-merge (squash) September 1, 2026 17:40
@mohittilala
mohittilala merged commit 14cd964 into 1.13 Sep 1, 2026
115 of 142 checks passed
@mohittilala
mohittilala deleted the backport/31958-to-1.13 branch September 1, 2026 17:42
mohityadav766 added a commit that referenced this pull request Sep 2, 2026
Both are test-only defects that main fixed and 1.13 never received. They are
intermittent, so they did not appear in the #32400 baseline used to scope the
previous commit, and only surfaced on the multi-node lane.

- RdfGlossaryGraphIT.scopedResponseCarriesGlossaryNameAndIdPerNode awaited only
  node presence, then asserted `group` and `glossaryId` outside the Awaitility
  block. The node and its projection land in RDF separately, so on a slower run
  the node is already present while `group` is still null. Move the whole
  assertion inside untilAsserted.
- WorkflowDefinitionResourceIT.test_WorkflowWithTeamCandidates and
  test_WorkflowWithReviewersOwnersCandidates created the table before the
  workflow could consume its creation event, yielding a second approval task
  ("expected: <1> but was: <2>") or no task at all within the 2 minute wait.
  Create the table only after the workflow is deployed.

Taken from PR #32340 byte for byte, as with the previous commit.

Verified locally on the mysql-elasticsearch profile:
WorkflowDefinitionResourceIT 49 tests, 0 failures, 0 errors, 5 skipped.

Note for anyone reproducing RdfGlossaryGraphIT locally: do not pass
-DenableRdf=true. The class starts its own Fuseki container and calls
RdfUpdater.initialize in @BeforeAll, so enabling RDF in TestSuiteBootstrap as
well fails with "RdfRepository already initialized".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mohityadav766 added a commit that referenced this pull request Sep 2, 2026
The openmetadata-service unit lane is red on every 1.13 PR, not just this one:
8 failures on #32400, #32371 and #32373. This branch already showed 6 — a strict
subset, the other 2 (AuthenticationCodeFlowHandlerTest) having been fixed by
#32408 landing on the base. Nothing here was caused by this branch; these are
the remaining 6.

Three assert against entities and fields that only exist on main/2.0, having been
backported wholesale:

- IndexMappingNestedFieldConsistencyTest asserted mappings for auditReport,
  aiApplication, llmModel and aiGovernance. None of those entities exist on 1.13.
- SearchIndexFactoryTest asserted page reindex fields include "parent"; page
  hierarchy is main-only.
- SearchRepositoryBehaviorTest expected the column child index to be aliased
  cluster_column_search_index; on 1.13 it is cluster_tableColumn.

EntityCsvTest covers domain/data-product validation on bulk edit.

SearchRepositoryBehaviorTest also gains a test for an EXTERNAL_HANDLER-only
change emitting no child-update call, which needs the accompanying
SearchRepository fix: appendUpdate/appendDelete/appendCreate appended a
separator unconditionally, so a propagation whose switch branch deliberately
emits nothing (certification, driven by propagateCertificationTags) produced a
whitespace-only script that still fired updateChildren against every child
index. The three guards only append the separator when the branch actually
wrote something.

That makes two product changes on this branch: the TestCaseRepository
null/EntityNotFound guard and these three separator guards. Everything else is
test-only.

Verified locally: EntityCsvTest 63, SearchIndexFactoryTest 200,
SearchRepositoryBehaviorTest 115, IndexMappingNestedFieldConsistencyTest 4 —
382 tests, 0 failures, 0 errors. Spotless clean.

Taken from PR #32340 byte for byte.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
test — 6dbb75f5 Deployed Sep 1, 2026 by mohittilala via playwright-ci-postgresql (1, 6) #77308
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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants