Skip to content

Fixes #28869: migrate greenplum and cockroach connectors to BaseConnection#28868

Merged
IceS2 merged 2 commits into
mainfrom
refactor/db-baseconnection-greenplum-cockroach
Jun 10, 2026
Merged

Fixes #28869: migrate greenplum and cockroach connectors to BaseConnection#28868
IceS2 merged 2 commits into
mainfrom
refactor/db-baseconnection-greenplum-cockroach

Conversation

@IceS2

@IceS2 IceS2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What

Migrates the greenplum and cockroach connectors from module-level get_connection/test_connection to a BaseConnection subclass — continuing the database-connector migration (follows #28854 and #28866).

Both are basic-auth-only, Postgres-dialect connectors with a single client-build path, so each:

  • defines XConnection(BaseConnection[XConfig, Engine]) whose _get_client() builds the engine via the shared BasicAuthStrategy,
  • moves test_connection into the class (calling the same test_connection_db_common helper, preserving each connector's custom GetDatabases query),
  • registers connection_class= in its service_spec.py,
  • drops the old module-level functions.

No match on authType: although these configs carry an authType field, the previous get_connection never branched on it (it always built a plain engine), so BasicAuthStrategy reproduces the exact prior behavior.

Tests

Colocated per-connector unit tests under tests/unit/source/database/{greenplum,cockroach}/test_connection.py asserting the engine URL built through the connector (postgresql+psycopg2://… / cockroachdb+psycopg2://…). ruff + basedpyright clean.

Validation

Ran real metadata ingestion using this branch's connector code into a running OpenMetadata — both 100% success, 0 errors, tables + views ingested with correct columns:

  • greenplum → Postgres backend (Greenplum uses the postgresql+psycopg2 dialect + standard introspection).
  • cockroach → real CockroachDB v23.1 container (start-single-node --insecure): test-connection passed (CheckAccess/GetDatabases/GetSchemas/GetTables/GetViews), tables + view ingested.

Note: CockroachDB v23.2+ moves start-single-node into a virtual cluster that restricts crdb_internal/system access, which the source's reflection queries rely on — a source/version concern independent of this connection refactor (the engine is byte-identical to the previous get_connection).

Scope

greenplum + cockroach only. Next batch: doris + starrocks.

Fixes #28869

…seConnection

Both are basic-auth-only postgres-dialect connectors. Replace their module-level
get_connection/test_connection with a BaseConnection subclass that builds the
engine via the shared BasicAuthStrategy and keeps each connector's custom
GetDatabases test query, and register the class via connection_class in their
service specs.

Adds colocated per-connector unit tests asserting URL parity.
@IceS2 IceS2 requested a review from a team as a code owner June 9, 2026 12:49
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

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

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Jun 9, 2026
@IceS2 IceS2 changed the title refactor(ingestion): migrate greenplum and cockroach connectors to BaseConnection Fixes #28869: migrate greenplum and cockroach connectors to BaseConnection Jun 9, 2026
…kroach specs

DefaultDatabaseSpec normalizes a class to its import path via a validator, so
passing the connection_class (and metadata_source_class) class triggers a
reportArgumentType the checker cannot see through. Suppress per argument, as
basedpyright ignores are line-scoped.
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (12 flaky)

✅ 4272 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 301 0 0 4
🟡 Shard 2 802 0 4 9
🟡 Shard 3 807 0 1 8
🟡 Shard 4 842 0 1 12
🟡 Shard 5 720 0 1 47
🟡 Shard 6 800 0 5 8
🟡 12 flaky test(s) (passed on retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 2 retries)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should start term as Draft when glossary has reviewers (shard 2, 2 retries)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Should display custom properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Container (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for dashboard -> dashboardDataModel (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)

📦 Download artifacts

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

@IceS2 IceS2 merged commit 2cf0aa4 into main Jun 10, 2026
55 of 60 checks passed
@IceS2 IceS2 deleted the refactor/db-baseconnection-greenplum-cockroach branch June 10, 2026 05:26
@gitar-bot

gitar-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Migrates Greenplum and Cockroach connectors to the BaseConnection framework using BasicAuthStrategy, preserving original connection behavior. Verified via successful metadata ingestion and unit testing with no issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

Migrate greenplum and cockroach connectors to BaseConnection

2 participants