Skip to content

Commit 2608acf

Browse files
committed
[SEA-NodeJS] Rename SEA → kernel across the driver (useSEA → useKernel)
The kernel backend can sit on top of any wire protocol (today SEA/Statement Execution API, later others), so the driver should not brand its path "SEA". Renames the driver-layer surface to "kernel" while preserving genuine references to the SEA wire protocol the kernel speaks. - Public option `useSEA` → `useKernel` (matches python's `use_kernel=True`). - `lib/sea/` → `lib/kernel/`, `Sea*` → `Kernel*` (Backend/SessionBackend/ OperationBackend/Auth/NativeLoader/ServerInfo/PositionalParams/…). - `tests/unit/sea/` → `tests/unit/kernel/`, `tests/e2e/sea/` → `tests/e2e/kernel/`. - `native/sea/` → `native/kernel/` (+ build:native / prepack / loader path / .gitignore / .prettierignore / .npmignore / .gitattributes / kernel-e2e.yml). Committed napi artifacts restored byte-for-byte so the drift-guard still matches a fresh kernel build. - Driver-prose comments → "kernel"; preserved ~8 genuine SEA-protocol refs ("SEA REST protocol", "Statement Execution API (SEA)", "SEA wire", SEA `CreateSession` wire fields). Re-derived on top of the latest stack (#413 review fixes + #414 KERNEL_REV). tsc + lint + prettier clean; full unit suite green; no `useSEA` left in the tree. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent 779a77d commit 2608acf

59 files changed

Lines changed: 594 additions & 580 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ Dockerfile* text
3636
# crate; regenerated by `npm run build:native`. Tell git/GitHub they're
3737
# machine-generated so they collapse in diffs and are excluded from
3838
# blame and language stats.
39-
native/sea/index.d.ts linguist-generated=true
40-
native/sea/index.js linguist-generated=true
39+
native/kernel/index.d.ts linguist-generated=true
40+
native/kernel/index.js linguist-generated=true

.github/workflows/kernel-e2e.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: Kernel E2E Tests
22

3-
# Runs the SEA backend e2e suite (tests/e2e/sea/**) against a real
3+
# Runs the kernel backend e2e suite (tests/e2e/kernel/**) against a real
44
# Databricks warehouse with a freshly-built napi-rs kernel binding.
55
#
66
# The kernel is a private repo with no published binary artifact. We pin
77
# a kernel SHA in the `KERNEL_REV` file at the repo root, check the kernel
88
# out via a GitHub App token, and run `npm run build:native` to compile
9-
# the napi binding into native/sea/ in the same checkout the tests run
9+
# the napi binding into native/kernel/ in the same checkout the tests run
1010
# against. Bumping `KERNEL_REV` is the ONLY way to pick up a new kernel
1111
# version — this keeps the driver <-> kernel pair bisectable, so a driver
1212
# change and the kernel revision it depends on always land together.
1313
#
14-
# Why this exists: the committed native/sea/index.d.ts + index.js are the
14+
# Why this exists: the committed native/kernel/index.d.ts + index.js are the
1515
# TypeScript declarations and the napi-rs platform router; the actual
1616
# `.node` binary is gitignored (large, per-platform) and is NOT in the
17-
# repo. The standard `main.yml` e2e job has no binary, so its SEA suite
17+
# repo. The standard `main.yml` e2e job has no binary, so its kernel suite
1818
# skips (it gates on DATABRICKS_PECOTESTING_* secrets it doesn't set).
19-
# This workflow is what actually exercises the SEA path end-to-end against
19+
# This workflow is what actually exercises the kernel path end-to-end against
2020
# a known kernel revision.
2121
#
2222
# Gate semantics:
2323
# - Plain PR events post a synthetic-success check so the required
24-
# "Kernel E2E" check doesn't block PRs that don't touch the SEA path.
24+
# "Kernel E2E" check doesn't block PRs that don't touch the kernel path.
2525
# Real tests run in the merge queue.
2626
# - `kernel-e2e` label triggers a preview run on the PR; the label is
2727
# auto-removed on `synchronize` for the same security reason.
28-
# - merge_group fires the real gate — runs when SEA-relevant files
28+
# - merge_group fires the real gate — runs when kernel-relevant files
2929
# changed, auto-passes otherwise.
3030
#
3131
# Required external setup (one-time, by a repo admin):
@@ -81,7 +81,7 @@ jobs:
8181
8282
# ───────────────────────────────────────────────────────────────
8383
# Synthetic success on every non-label PR event so the required
84-
# "Kernel E2E" check doesn't permablock PRs that don't touch SEA
84+
# "Kernel E2E" check doesn't permablock PRs that don't touch kernel
8585
# code. Real run happens in the merge queue (or via explicit label).
8686
# ───────────────────────────────────────────────────────────────
8787
skip-kernel-e2e-pr:
@@ -112,7 +112,7 @@ jobs:
112112
});
113113
114114
# ───────────────────────────────────────────────────────────────
115-
# Detect whether SEA-relevant files changed. Used by both the
115+
# Detect whether kernel-relevant files changed. Used by both the
116116
# labelled-PR path and the merge-queue path to decide between
117117
# "really run the suite" and "auto-pass the check".
118118
# ───────────────────────────────────────────────────────────────
@@ -148,7 +148,7 @@ jobs:
148148
ref: ${{ steps.refs.outputs.head_sha }}
149149
fetch-depth: 0
150150

151-
- name: Detect SEA-relevant changes
151+
- name: Detect kernel-relevant changes
152152
id: changed
153153
env:
154154
HEAD_SHA: ${{ steps.refs.outputs.head_sha }}
@@ -157,18 +157,18 @@ jobs:
157157
CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
158158
echo "Changed files:"
159159
echo "$CHANGED"
160-
# Run when the SEA driver layer, the napi binding contract, SEA
160+
# Run when the kernel driver layer, the napi binding contract, kernel
161161
# e2e tests, this workflow, the kernel revision pin, or core deps
162162
# move.
163-
if echo "$CHANGED" | grep -qE "^(lib/sea/|native/sea/|tests/e2e/sea/|tests/unit/sea/|\.github/workflows/kernel-e2e\.yml|KERNEL_REV|package\.json|package-lock\.json)"; then
163+
if echo "$CHANGED" | grep -qE "^(lib/kernel/|native/kernel/|tests/e2e/kernel/|tests/unit/kernel/|\.github/workflows/kernel-e2e\.yml|KERNEL_REV|package\.json|package-lock\.json)"; then
164164
echo "run_tests=true" >> "$GITHUB_OUTPUT"
165165
else
166166
echo "run_tests=false" >> "$GITHUB_OUTPUT"
167167
fi
168168
169169
# ───────────────────────────────────────────────────────────────
170170
# Real test job. Builds the napi binding from the pinned kernel SHA
171-
# and runs the SEA e2e suite against the dogfood warehouse.
171+
# and runs the kernel e2e suite against the dogfood warehouse.
172172
# ───────────────────────────────────────────────────────────────
173173
run-kernel-e2e:
174174
needs: detect-changes
@@ -182,7 +182,7 @@ jobs:
182182
checks: write
183183
id-token: write
184184
env:
185-
# SEA e2e tests gate on the DATABRICKS_PECOTESTING_* vars; map the
185+
# kernel e2e tests gate on the DATABRICKS_PECOTESTING_* vars; map the
186186
# warehouse secrets onto them so the suite actually runs (it skips
187187
# when they are absent).
188188
DATABRICKS_PECOTESTING_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_HOST }}
@@ -273,36 +273,36 @@ jobs:
273273

274274
- name: Build napi binding from pinned kernel
275275
# build:native cd's into ${DATABRICKS_SQL_KERNEL_REPO}/napi, runs the
276-
# napi-rs build, and copies index.* into native/sea/. Pointing it at
276+
# napi-rs build, and copies index.* into native/kernel/. Pointing it at
277277
# the SHA-pinned kernel checkout is what makes the binary match
278278
# KERNEL_REV exactly.
279279
env:
280280
DATABRICKS_SQL_KERNEL_REPO: ${{ github.workspace }}/databricks-sql-kernel
281281
run: npm run build:native
282282

283283
- name: Assert committed binding matches KERNEL_REV
284-
# The committed native/sea/index.d.ts + index.js are the consumer-facing
284+
# The committed native/kernel/index.d.ts + index.js are the consumer-facing
285285
# type contract + platform router; they MUST correspond to the pinned
286286
# kernel. build:native just regenerated them from the KERNEL_REV
287287
# checkout, so any diff means the committed contract drifted from the
288288
# pin — fail loudly and tell the author to commit the regenerated files.
289289
# (The .node binaries are gitignored, so git diff only sees the contract.)
290290
run: |
291-
if ! git diff --exit-code -- native/sea/index.d.ts native/sea/index.js; then
292-
echo "::error::native/sea/index.d.ts / index.js are out of sync with KERNEL_REV ($(tr -d '[:space:]' < KERNEL_REV)). Run 'npm run build:native' against that kernel SHA and commit native/sea/index.*."
291+
if ! git diff --exit-code -- native/kernel/index.d.ts native/kernel/index.js; then
292+
echo "::error::native/kernel/index.d.ts / index.js are out of sync with KERNEL_REV ($(tr -d '[:space:]' < KERNEL_REV)). Run 'npm run build:native' against that kernel SHA and commit native/kernel/index.*."
293293
exit 1
294294
fi
295295
echo "Committed binding matches KERNEL_REV."
296296
297297
- name: Smoke-check binding loads
298-
run: node -e "const b=require('./native/sea'); if(typeof b.version!=='function'){throw new Error('napi binding failed to load')} console.log('kernel binding ok:', b.version())"
298+
run: node -e "const b=require('./native/kernel'); if(typeof b.version!=='function'){throw new Error('napi binding failed to load')} console.log('kernel binding ok:', b.version())"
299299

300-
- name: Run SEA e2e tests
300+
- name: Run kernel e2e tests
301301
# Invoke mocha directly rather than via `npm run e2e -- <glob>`: routing a
302302
# glob through the npm-script's inner shell mangles `**` and silently
303303
# resolves to ZERO files (a false pass). mocha expands the quoted glob
304-
# itself, reliably matching every tests/e2e/sea file.
305-
run: NODE_OPTIONS="--max-old-space-size=4096" npx mocha --config tests/e2e/.mocharc.js "tests/e2e/sea/**/*.test.ts"
304+
# itself, reliably matching every tests/e2e/kernel file.
305+
run: NODE_OPTIONS="--max-old-space-size=4096" npx mocha --config tests/e2e/.mocharc.js "tests/e2e/kernel/**/*.test.ts"
306306

307307
- name: Post Kernel E2E check (success)
308308
if: success()
@@ -320,7 +320,7 @@ jobs:
320320
completed_at: new Date().toISOString(),
321321
output: {
322322
title: 'Kernel E2E passed',
323-
summary: 'tests/e2e/sea ran green against the pinned kernel SHA.'
323+
summary: 'tests/e2e/kernel ran green against the pinned kernel SHA.'
324324
}
325325
});
326326
@@ -345,7 +345,7 @@ jobs:
345345
});
346346
347347
# ───────────────────────────────────────────────────────────────
348-
# Auto-pass the Kernel E2E check in the merge queue when no SEA-
348+
# Auto-pass the Kernel E2E check in the merge queue when no kernel-
349349
# relevant files changed.
350350
# ───────────────────────────────────────────────────────────────
351351
auto-pass-merge-queue:
@@ -371,7 +371,7 @@ jobs:
371371
conclusion: 'success',
372372
completed_at: new Date().toISOString(),
373373
output: {
374-
title: 'Skipped — no SEA-relevant changes',
375-
summary: 'No files under lib/sea/, native/sea/, tests/e2e/sea/, tests/unit/sea/, KERNEL_REV, package.json, or package-lock.json changed.'
374+
title: 'Skipped — no kernel-relevant changes',
375+
summary: 'No files under lib/kernel/, native/kernel/, tests/e2e/kernel/, tests/unit/kernel/, KERNEL_REV, package.json, or package-lock.json changed.'
376376
}
377377
});

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ dist
1111
*.DS_Store
1212
lib/version.ts
1313

14-
# SEA native binding — copied/generated from kernel workspace by `npm run build:native`.
15-
# The committed contract is `native/sea/index.d.ts` (TypeScript declarations) and
16-
# `native/sea/index.js` (the napi-rs platform router — small, stable, and required in
14+
# kernel native binding — copied/generated from kernel workspace by `npm run build:native`.
15+
# The committed contract is `native/kernel/index.d.ts` (TypeScript declarations) and
16+
# `native/kernel/index.js` (the napi-rs platform router — small, stable, and required in
1717
# the publish tarball so a missing build step can't ship a tarball that can't load).
1818
# The `.node` binaries are large per-platform artifacts and must NOT be committed;
1919
# in production they arrive via the `@databricks/sql-kernel-<triple>` optional deps.
20-
native/sea/index.node
21-
native/sea/index.*.node
20+
native/kernel/index.node
21+
native/kernel/index.*.node

.npmignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# selects the per-platform `.node` artifact from `@databricks/sql-kernel-*`
88
# optionalDependencies (populated when the kernel CI publishes them);
99
# the .d.ts is the consumer-facing type contract.
10-
!native/sea/index.js
11-
!native/sea/index.d.ts
10+
!native/kernel/index.js
11+
!native/kernel/index.d.ts
1212

1313
!LICENSE
1414
!NOTICE

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ package-lock.json
1515
# Generated by napi-rs from the kernel's `napi-binding/napi/` crate;
1616
# regenerated by `npm run build:native`. Format follows napi-rs's
1717
# defaults (no semicolons), not this repo's prettier config.
18-
native/sea/index.d.ts
19-
native/sea/index.js
18+
native/kernel/index.d.ts
19+
native/kernel/index.js

lib/DBSQLClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { buildUserAgentString } from './utils';
1818
import IBackend from './contracts/IBackend';
1919
import { InternalConnectionOptions } from './contracts/InternalConnectionOptions';
2020
import ThriftBackend from './thrift-backend/ThriftBackend';
21-
import SeaBackend from './sea/SeaBackend';
21+
import KernelBackend from './kernel/KernelBackend';
2222
import PlainHttpAuthentication from './connection/auth/PlainHttpAuthentication';
2323
import DatabricksOAuth, { OAuthFlow } from './connection/auth/DatabricksOAuth';
2424
import {
@@ -627,12 +627,12 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
627627

628628
this.connectionProvider = this.createConnectionProvider(options);
629629

630-
// M0: `useSEA` is consumed via a non-exported internal-options cast so it
630+
// M0: `useKernel` is consumed via a non-exported internal-options cast so it
631631
// doesn't ship in the public `.d.ts`. Mirrors Python's `kwargs.get("use_sea")`
632632
// pattern (see databricks-sql-python/src/databricks/sql/session.py).
633633
const internalOptions = options as ConnectionOptions & InternalConnectionOptions;
634-
const backend = internalOptions.useSEA
635-
? new SeaBackend({ context: this })
634+
const backend = internalOptions.useKernel
635+
? new KernelBackend({ context: this })
636636
: new ThriftBackend({
637637
context: this,
638638
onConnectionEvent: (event, payload) => this.forwardConnectionEvent(event, payload),

lib/DBSQLOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export default class DBSQLOperation implements IOperation {
171171
/**
172172
* Requests operation status. Returns the Thrift wire response for
173173
* back-compat with existing user code. On the Thrift backend the response
174-
* is returned verbatim; on any other backend (e.g. SEA) the response is
174+
* is returned verbatim; on any other backend (e.g. kernel) the response is
175175
* synthesized from the neutral {@link IOperationBackend.status} result,
176176
* with Thrift-only fields (`taskStatus`, `numModifiedRows`, etc.) left
177177
* undefined.

lib/contracts/IBackend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import ISessionBackend from './ISessionBackend';
33

44
/**
55
* Top-level backend dispatch handle. One instance per `DBSQLClient`,
6-
* chosen at `connect()` time based on the `useSEA` flag and never
6+
* chosen at `connect()` time based on the `useKernel` flag and never
77
* re-selected per-call.
88
*/
99
export default interface IBackend {
1010
/**
1111
* Establish backend-level state before any session is opened. Implementations
1212
* consume `options` to build backend-specific connection parameters (e.g. the
13-
* SEA backend derives napi-binding `SeaNativeConnectionOptions` from the auth
13+
* kernel backend derives napi-binding `KernelNativeConnectionOptions` from the auth
1414
* + host fields here). Transport-layer connection providers are owned by
1515
* `DBSQLClient` (via `IClientContext`) and exposed to backends through
1616
* constructor injection.

lib/contracts/IDBSQLSession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ export type ExecuteStatementOptions = {
2828
*/
2929
queryTags?: Record<string, string | null | undefined>;
3030
/**
31-
* SEA-only: server-side row cap for this statement (kernel `row_limit`). The
31+
* kernel-only: server-side row cap for this statement (kernel `row_limit`). The
3232
* Thrift backend has no execute-time server cap, so this is a no-op there;
3333
* use `maxRows` for the cross-backend client-side fetch limit.
3434
*/
3535
rowLimit?: number;
3636
/**
37-
* SEA-only: per-statement Spark conf overlay (kernel `statement_conf`).
37+
* kernel-only: per-statement Spark conf overlay (kernel `statement_conf`).
3838
* Merged with the serialized `queryTags` (which land under the reserved
3939
* `query_tags` key). Ignored by the Thrift backend.
4040
*/

lib/contracts/InternalConnectionOptions.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* signature (see `databricks-sql-python/src/databricks/sql/session.py`).
88
*
99
* Callers cast `ConnectionOptions` to this type *only* at the read site
10-
* inside the driver; user code that wants to set `useSEA` may still do so
10+
* inside the driver; user code that wants to set `useKernel` may still do so
1111
* via an untyped object literal — the option is not part of the public
1212
* contract and may be removed without notice.
1313
*/
@@ -17,28 +17,28 @@ export interface InternalConnectionOptions {
1717
* backend instead of the default Thrift backend. Defaults to `false`.
1818
* @internal Not stable; M0 stub only.
1919
*/
20-
useSEA?: boolean;
20+
useKernel?: boolean;
2121

2222
/**
23-
* SEA-only: kernel connection-pool size (`ConnectionOptions.max_connections`).
23+
* kernel-only: kernel connection-pool size (`ConnectionOptions.max_connections`).
2424
* Validated as a positive integer within the napi `u32` range.
25-
* @internal SEA path only.
25+
* @internal kernel path only.
2626
*/
2727
maxConnections?: number;
2828

2929
/**
30-
* SEA-only: verify the server's TLS certificate. Secure-by-default — omit
30+
* kernel-only: verify the server's TLS certificate. Secure-by-default — omit
3131
* to keep full chain + hostname verification; set `false` only to opt into
3232
* the insecure accept-anything mode.
33-
* @internal SEA path only.
33+
* @internal kernel path only.
3434
*/
3535
checkServerCertificate?: boolean;
3636

3737
/**
38-
* SEA-only: PEM-encoded CA certificate (string or `Buffer`) added to the
38+
* kernel-only: PEM-encoded CA certificate (string or `Buffer`) added to the
3939
* trust store on top of the system roots — for TLS-inspecting proxies or
4040
* on-prem internal CAs. Honoured regardless of `checkServerCertificate`.
41-
* @internal SEA path only.
41+
* @internal kernel path only.
4242
*/
4343
customCaCert?: Buffer | string;
4444
}

0 commit comments

Comments
 (0)