Skip to content

feat(napi): bundle SEA kernel parity surface - #101

Merged
msrathore-db merged 14 commits into
mainfrom
msrathore/krn-tls-napi
Jun 2, 2026
Merged

msrathore-db merged 14 commits into
mainfrom
msrathore/krn-tls-napi

Conversation

@msrathore-db

@msrathore-db msrathore-db commented May 31, 2026 •

Copy link
Copy Markdown
Collaborator

What

Single main-based kernel mega PR for the SEA NodeJS parity surface. This intentionally replaces the smaller stacked PRs so agent review can inspect one integrated kernel/napi change.

Current real diff after folding #99, #100, #101, and #93 into one signed commit: about 2953 additions / 121 deletions across 22 files.

Included Changes

Superseded PRs

This PR now supersedes all remaining kernel stack PRs:

Earlier smaller feature PRs already closed as superseded are also represented here: #75, #76, #84, #94, #95, #96, #97, and #98.

Review Notes

This is intentionally broad and is the only kernel review PR for the SEA parity work. The branch history was squashed to one DCO-signed commit on top of latest main to remove stale stack history and avoid duplicate review surfaces.

Known live E2E failures in v0_execute_e2e for VARIANT/geospatial parameter round trips are pre-existing server/test-surface issues and are not fixed in this PR.

Testing

Local focused validation after folding the branches:

  • cargo fmt --all -- --check
  • cargo check --tests
  • cargo test -p databricks-sql-kernel --doc
  • cargo check --no-default-features --features tls-rustls
  • cargo clippy --no-default-features --features tls-rustls --all-targets -- -D warnings
  • cargo test -p databricks-sql-kernel typed_value_geo
  • In napi/: cargo fmt --all -- --check
  • In napi/: cargo clippy --all-targets --locked -- -D warnings
  • In napi/: cargo test --locked (79 tests)

CI is rerunning on the single squashed branch.

This pull request and its description were written by Isaac.

@msrathore-db msrathore-db changed the title feat(napi): expose TLS verification toggle + custom CA on openSession feat(napi): bundle SEA kernel parity surface + TLS Jun 1, 2026
@msrathore-db
msrathore-db changed the base branch from msrathore/krn-all-integration to main June 1, 2026 05:37
@msrathore-db
msrathore-db force-pushed the msrathore/krn-tls-napi branch from b6a7b90 to 7751e9b Compare June 1, 2026 06:11
@msrathore-db
msrathore-db requested a review from a team as a code owner June 1, 2026 06:11
@msrathore-db msrathore-db changed the title feat(napi): bundle SEA kernel parity surface + TLS feat(napi): bundle SEA kernel parity surface Jun 1, 2026
@msrathore-db
msrathore-db force-pushed the msrathore/krn-tls-napi branch from 7751e9b to 5faa309 Compare June 1, 2026 06:17
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
# Conflicts:
#	.github/workflows/napi-checks.yml
Three pyo3 tests asserted behavior that the kernel/bundle intentionally
changed; main's CI audit (which fixed the maturin --interpreter bug so
pytest now actually runs) surfaced them.

- test_pat_with_empty_token: PAT empty-token validation is centralised in
  the kernel's AuthConfig::pat ctor (every binding rejects identically),
  which surfaces "PAT auth requires a non-empty access token". Match that
  message instead of the `access_token` kwarg spelling.
- test_list_tables_in_information_schema: the kernel returns JDBC-shaped
  metadata columns (TABLE_NAME/TABLE_TYPE …) matching Thrift's getTables,
  not the raw SHOW TABLES shape — assert the JDBC names.
- test_list_columns_requires_catalog_kwarg → _catalog_is_optional: catalog
  is now an optional kwarg (defaults to None = across catalogs); assert
  omitting it is accepted, bounded by schema+table patterns.

Verified live against a warehouse: all three pass; no-network tier
(test_auth + test_module) green.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
open_with_oauth_m2m / open_with_oauth_u2m are #[tokio::test] (current-
thread). OAuth token acquisition does a blocking refresh via
block_on_in_runtime -> block_in_place, which panics on a current-thread
runtime ("can call blocking only when running on the multi-threaded
runtime"). The tests previously passed only because they skip when their
creds are unset; once DATABRICKS_TEST_CLIENT_ID is present in CI the M2M
test runs the real flow and panics.

Pin both to #[tokio::test(flavor = "multi_thread")], matching every other
OAuth test (src/auth/oauth/m2m.rs, tests/oauth_u2m_integration.rs) and the
runtime requirement documented in src/util/runtime.rs. Verified live: the
M2M session test now opens + closes cleanly. Pre-existing latent issue
(the test file is identical to main), not caused by this PR's changes.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
main now includes #107 (feat(pyo3): wire OAuth M2M/U2M + TLS/mTLS through
Session), which overlaps this branch's auth/TLS work. Conflict resolution:

Auth:
- pyo3/src/auth.rs: kept #107's version — it's the richer, canonical OAuth
  surface (PAT + oauth-m2m + oauth-u2m, with Python-API guards for
  degenerate client_id/redirect_port/callback_timeout). #101's 14-line PAT
  tweak is superseded.
- src/config.rs: kept BOTH (clean union) — #107's mTLS TlsConfig fields
  (client_cert_pem/client_key_pem) AND #101's AuthConfig::{pat,oauth_m2m,
  oauth_u2m} validating constructors, which napi depends on
  (napi/src/database.rs forwards to them).
- pyo3/tests/test_auth.py: reverted the empty-PAT assertion to
  match='access_token' — pyo3 now validates inline (#107) producing
  'access_token must not be empty', not the kernel ctor message.

TLS:
- Kept #107's kernel-side TLS (src/client/http.rs application + config.rs
  mTLS + tests/v0_tls_e2e.rs) and #101's napi TLS exposure
  (napi/src/database.rs checkServerCertificate/customCaCert). Complementary.

tests/v0_session_e2e.rs: both branches added the same multi_thread fix to
the M2M/U2M tests; took #107's wording.

Verified after merge: kernel 605 lib tests, napi 41, pyo3 40 live tests,
config auth+TLS unit tests; clippy + fmt clean on kernel and napi.

Co-authored-by: Isaac

This branch was previously deployed

1 inactive deployment
azure-prod — 7fb0151e Deployed Jun 2, 2026 by msrathore-db via PyO3 build + test (Python 3.14) #46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants