Repository navigation
Fixes 5970: migrate Oracle CLI E2E to v2 and fix the foreign-key bug it found - #34302
Conversation
Adds ingestion/tests/cli_e2e_v2/oracle/ following the mysql reference, and enables oracle in the v2 CI matrix and the Validate connector allowlist. Coverage: catalog equality under STRICT inventory matching (tables, views, columns, types, descriptions, procedures), stored-procedure bodies, foreign keys, mark-deleted on re-ingest, repeat-ingest UUID stability, and three filter scenarios. 8 contracts, all passing against a real Oracle in ~3min. The source is owned by the fixture via testcontainers (gvenzl/oracle-free, digest-pinned), so the E2E_ORACLE_* CI secrets the v1 path needed are no longer required. A schema is an Oracle user, so each test creates one and drops it CASCADE. Every invocation is schema-scoped by default: the connector reads the DBA_ dictionary views, and oracleConnectionType accepts a service name or a databaseSchema but never both, so there is no connection-level scope to lean on as there is for MySQL. Fixes a bug the migration surfaced: get_table_names was the only Oracle object path not applying normalize_name, while get_view_names_dialect, get_mview_names_dialect, get_columns and get_foreign_keys all do. Tables were therefore ingested with the dictionary's uppercase name while the FK reflection reported referred_table in lowercase. The two never matched, so tableConstraints came back empty for every Oracle table and foreign keys were lost with no error, no warning and a reported 100% workflow success. This changes Oracle table FQNs from schema.TABLE to schema.table. Existing Oracle deployments will need to reindex, and the release notes should call it out. Stored procedure names are still uppercase, because that path reads the dictionary directly; it is not implicated in the foreign-key bug and is left for a follow-up rather than widening this change. error.containment is declared unsupported in the connector inventory with its reason: Oracle retains dictionary metadata for invalid views, so the reference induction produces no ingestion error. Verified live that neither dropping a selected column nor dropping the base table makes a view fail reflection. The v1 path in ingestion/tests/cli_e2e/test_cli_oracle.py is retained; it should be removed only after the v2 suite has been green for the agreed stability window.
Mirrors mysql/test_fixture_safety.py for the parts that apply to Oracle. DROP USER ... CASCADE is the most destructive statement in this suite and is built by interpolating a generated identifier, so it is worth pinning that it removes exactly what it owns. Covers: a source mutates and drops only its own schema while a live sibling is untouched by its teardown; cross-schema names are not addressable through the owned-source API; the ingestion account can read the seeded data and the DBA_ dictionary but cannot update or drop; a workflow cannot be built against an environment that is not the fixture's own instance, an empty source tuple or a closed source; a failure partway through setup leaves no Oracle user behind; and neither the instance nor the source repr carries a password or a connection URL. The seed-failure case compares the dba_users set before and after rather than a captured schema name: the failure is raised inside __enter__, so the context body never runs and no name is handed out. The set comparison is also the stronger assertion, catching a leaked user under any name. Also documents that an OSS checkout cannot be put first on PYTHONPATH when the virtualenv holds a Collate build, whose metadata entry point (collate_cmd) does not exist in the OSS tree. Shadowing it makes every CLI invocation die at import before writing a status file, which surfaces as "CLI status is missing or malformed" rather than an import error. Verified by two full live runs from cold containers, 13 passed each, with no leftover containers.
OracleConnection defaults supportsProfiler and supportsLineageExtraction to true, but this slice declares no profile.* or lineage.* contract. Listing those capabilities is inert, since capabilities only gate `unsupported` entries, and reads as a coverage claim the suite does not make. They belong here alongside their contracts.
❌ PR checklist incompleteThis 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 615 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 49m 0s ⏱️ Max setup 4m 42s · max shard execution 16m 22s · max shard-job elapsed before upload 20m 38s · reporting 4s 🌐 248.98 requests/attempt · 2.22 app boots/UI scenario · 34.11% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
… fix Closes the gap between the v2 Oracle suite and what the v1 path actually exercises, so the migration replaces v1 rather than reducing it. Adds profiler metrics, view lineage (table and column level), PII auto-classification with negative assertions, persisted sample values and their replacement on re-ingest, and the include+exclude filter mix. Together with the existing cases, every v1 Oracle behaviour that exercises something is now covered. The v1 tests that remain uncovered exercise nothing: test_usage has an empty body, test_schema_filter_excludes is a bare pass, and test_profiler_with_time_partition and test_data_quality both guard themselves off because Oracle defines no hook for them. Profiling samples the full table rather than v1's profileSample=1 workaround, which existed because v1 ran against a shared instance where sampling did not reliably reach the seeded rows. An owned source with a declared baseline is small enough to profile whole. Two fixes for the retained v1 path and for CI coverage of the connector change: - test_cli_oracle.py expected e2e_oracle.default.admin.ADMIN_EMP. Now that get_table_names normalises, the table is stored as admin_emp, and the base class uses that FQN for lineage, sample data, profile and the mark-deleted assertion, so the v1 suite this PR keeps would have started failing. The ADMIN_EMP include filter still matches because filter patterns compile with re.IGNORECASE. - test_oracle_table_name_normalization.py covers get_table_names in PR CI, which the v2 E2E suite cannot do while py-cli-e2e-tests-v2.yml is workflow_dispatch only. It pins both identifier-case modes and the pairing with get_foreign_keys' referred_table, and fails against the unnormalised implementation. 19 E2E tests pass against a real Oracle; 56 Oracle unit tests pass.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Replaces the previous approach of normalising table names, which fixed the same bug but renamed every existing Oracle table's FQN. get_table_names returns the data dictionary name verbatim, so a table is stored as schema.CUSTOMERS, while get_foreign_keys reported referred_table through normalize_name as customers. common_db_source looks the referred table up by exact FQN, so it never matched: the constraint was discarded with no error, no warning and a reported 100% workflow success, leaving tableConstraints empty for every Oracle table. Reporting referred_table in the same case get_table_names uses fixes the mismatch without moving any FQN, so nothing is renamed, no curated metadata is orphaned and no migration or reindex is needed. denormalize_name is the inverse of normalize_name and is rebound to identity under preserveIdentifierCase, so both identifier modes stay consistent. test_cli_oracle.py is left untouched as a result, and the v2 expectations encode OM's real naming: tables and procedures uppercase, views and columns lowercase. That split is pre-existing and costs users nothing. Sample tests scope their filter with an uppercase pattern: the metadata pipeline matches tableFilterPattern case-insensitively but the auto-classification path does not, so a lowercase pattern selects nothing and no sample data is written.
# Conflicts: # ingestion/tests/cli_e2e_v2/README.md
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
# Conflicts: # .github/workflows/py-cli-e2e-tests-v2.yml # ingestion/tests/cli_e2e_v2/README.md
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Oracle ingestion now preserves previously dropped foreign-key relationships in metadata. Migrates Oracle CLI E2E to v2 framework and fixes a connector bug where foreign keys were silently dropped due to identifier case mismatch between ✅ 4 closed✅ Bug: Retained v1 Oracle E2E still expects uppercase ADMIN_EMP FQN
✅ Quality: Connector fix has no unit test that runs in PR CI
✅ Edge Case: FQN case change orphans curated metadata; a reindex won't fix it
✅ Edge Case: Round-trip uppercases quoted lowercase tables, breaking their FKs
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Backport of #34302 to 2.0, connector fix and unit tests only. get_table_names returns the data dictionary name verbatim, so a table is stored as schema.CUSTOMERS, while get_foreign_keys reported referred_table through normalize_name as customers. common_db_source looks the referred table up by exact FQN, so it never matched: the constraint was discarded with no error, no warning and a reported 100% workflow success, leaving tableConstraints empty for every Oracle table. Taking row[3] as stored matches get_table_names by construction, in both identifier modes and for tables created with quoted lowercase or mixed-case names. No FQN changes, so nothing is renamed and no migration is needed. test_oracle_constraint_reflection.py asserted the normalised referred_table and so pinned the behaviour this fixes; its expectation is updated. The v2 E2E suite from #34302 is not backported: ingestion/tests/cli_e2e_v2 does not exist on 2.0, since the framework from #27949 was never backported. Two pre-existing failures in test_oracle.py on 2.0, both about stored-procedure schema casing, are unaffected: they fail identically with and without this change.



Describe your changes:
Fixes open-metadata/openmetadata-collate#5970
Migrates the Oracle CLI E2E coverage to the v2 framework from #27949, and fixes a connector bug that the migration exposed.
The v1 test (
cli_e2e/test_cli_oracle.py) and itspy-cli-e2e-tests.ymlmatrix entry are unchanged and keep running, per the stability-window rule the MySQL and BigQuery migrations followed.Type of change:
High-level design:
1. Bug: every Oracle foreign key was silently dropped
Two Oracle code paths disagreed about identifier case:
get_table_namesCUSTOMERS(dictionary name, verbatim)…schema.CUSTOMERSget_foreign_keyscustomers(vianormalize_name)…schema.customerscommon_db_source._get_foreign_constraintslooks the referred table up by exact FQN, so it never matched. The constraint was discarded with no error, no warning, and a reported 100% workflow success —tableConstraintscame back empty for every Oracle table.The fix is one line: report
referred_tablein the same caseget_table_namesuses.get_table_namesreturnsrow[0]as stored, so takingrow[3]as stored matches it by construction — in both identifier modes, and for tables created with quoted lowercase or mixed-case names.test_oracle_constraint_reflection.pyasserted the normalisedreferred_tableand so pinned the behaviour this fixes; its expectation is updated. That is the only pre-existing assertion this PR changes.No FQN changes. Table names are untouched, so no entity is renamed, no curated metadata is orphaned, and no migration or reindex is needed. Fixing the mismatch from the other side — normalising table names — would have renamed every existing Oracle table and is deliberately not done here.
test_oracle_foreign_key_case.pycovers this in PR CI, parametrised over both identifier modes. It fails against the unfixed implementation.2. Oracle v2 E2E suite
ingestion/tests/cli_e2e_v2/oracle/follows themysql/andpostgres/references and covers everything the v1 Oracle path actually exercises: catalog equality under strict inventory matching, stored-procedure bodies, foreign keys, mark-deleted, repeat-ingest UUID stability, profiler metrics, view lineage, PII classification, sample values (original, updated, replacement), six filter scenarios including exclude precedence at table and schema level, and fixture safety.The v1 tests not carried over exercise nothing:
test_usagehas an empty body,test_schema_filter_excludesis a barepass, andtest_profiler_with_time_partitionandtest_data_qualityboth guard themselves off because Oracle defines no hook for them.Three things differ from the MySQL reference, all forced by Oracle:
gvenzl/oracle-free, digest-pinned), so theE2E_ORACLE_*CI secrets v1 needed are no longer required.CASCADE.DBA_dictionary views, andoracleConnectionTypetakes a service name or adatabaseSchemabut never both — so unlike MySQL there is no connection-level scope to lean on.expected.pyencodes OM's real naming rather than an idealised one: databasedefault, schema lowercase, tables and procedures UPPERCASE, views and columns lowercase. The table/view split is pre-existing and costs users nothing, so this PR does not "fix" it.error.containmentis declaredunsupportedin the connector inventory with its reason: Oracle keeps dictionary metadata for invalid views, so the reference induction produces no ingestion error. Verified that neither dropping a selected column nor dropping the base table makes a view fail reflection.Tests:
23 E2E tests against a real Oracle, green on two cold-container runs. 58 Oracle unit tests in PR CI, including
test_oracle_foreign_key_case.py, which fails against the unfixed implementation. Rebased onmainafter #33946; the README follows the per-connector layout that PR introduced.🤖 Generated with Claude Code