From 3fea21f73198e3550f8f656eee79aff7112d6cea Mon Sep 17 00:00:00 2001 From: Gopal Lal Date: Thu, 14 May 2026 15:07:21 +0530 Subject: [PATCH] ci: full CI/CD pipeline matching peer SQL driver repos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuild the kernel's CI/CD from a half-broken adbc-drivers/databricks inheritance into a working pipeline that mirrors the conventions in databricks/databricks-jdbc, databricks-sql-go, databricks-sql-nodejs, and databricks-sql-python. What was wrong: - rust_test_pr.yaml called a reusable workflow (`rust_test.yaml`) that was never ported from adbc-drivers/databricks. Its own TODO comment said it would fail. - rust_coverage_report.yaml waited for a workflow named "Rust Test" that doesn't exist locally — it would never fire. - ci/test_package.py imported adbc_driver_manager; the legacy ADBC layer was removed in PR 7 (#11). The kernel is no longer an ADBC driver; the smoke test it implemented exercises a delivery vector the kernel no longer offers. PyO3 smoke testing comes via PR #13. - manifest.toml was the ADBC driver-manager discovery file; its own comment said "Remove this once the kernel surfaces its own non-ADBC FFI." - The "proxy" and "tls" jobs in rust-e2e.yml referenced tests/proxy_e2e.rs / tls_e2e.rs, both #![cfg(feature = "legacy-adbc")]-gated and deleted alongside ADBC in PR #11. What's added (.github/workflows/): pr-checks.yml cargo fmt --check + clippy -D warnings + cargo test --workspace on every PR. Replaces the broken rust_test_pr.yaml. dco-check.yml Verbatim port of databricks-sql-go's dco-check.yml. CLAUDE.md mandates `git commit -s`; this enforces it. coverage.yml cargo llvm-cov → Codecov via OIDC. Standalone — no longer waits on a missing "Rust Test" workflow. license-check.yml cargo-deny against deny.toml. Replaces the cargo-about reference in CLAUDE.md; cargo-deny is the standard Rust-ecosystem gate (handles licenses + advisories + bans). apache-rat.yml Java-based Apache RAT against the source tree. CLAUDE.md claimed this ran but no workflow existed. Files to skip live in .ratignore. close-stale.yml 30-day stale + 7-day close window. Direct port from databricks-jdbc. release.yml Triggers on `v*.*.*` tag push: tag-version vs Cargo.toml version check → fmt → clippy → test → dry-run publish → real publish. workflow_dispatch with dry_run input for manual rehearsals. pyo3-checks.yml Maturin build + cargo test for the pyo3/ sub-crate. Path-gated on pyo3/** so this workflow only fires after PR #13 lands the Python wrapper. rust-e2e.yml Reworked: kept the live-workspace v0 E2E job (Session::open, execute, submit, await_result, metadata). Proxy + TLS jobs are kept and ported to the v0 surface — see "Proxy / TLS port" below. Proxy / TLS port (replaces dropping the jobs): - tests/proxy_e2e.rs and tests/tls_e2e.rs are restored with v0 bodies: they call SessionBuilder::proxy(ProxyConfig { url, username, password, bypass_hosts }) and SessionBuilder::tls(TlsConfig { trusted_certificate_path, allow_self_signed, allow_hostname_mismatch }). These fields don't exist yet in src/config.rs (both structs are #[non_exhaustive] placeholders); the test files are #![cfg(feature = "proxy_tls_e2e")]-gated so they're excluded from the default build. - Cargo.toml gains a `proxy_tls_e2e = []` feature. - rust-e2e.yml's proxy and tls jobs run a `cargo check --features proxy_tls_e2e --tests` precondition; if it doesn't compile (the v0.1 ProxyConfig/TlsConfig work isn't done), the job emits a clear ::warning and short-circuits cleanly. When v0.1 lands the fields, the feature compiles and the jobs auto-fire. - ci/proxy/ configs are kept — consumed by the proxy job once the feature compiles. - docs/migration-plan.md §7 gains a "Proxy + TLS E2E coverage (v0.1)" entry naming the four-step kernel work that unblocks this: flesh ProxyConfig, flesh TlsConfig, plumb both through client/http.rs, flip the feature default. What's deleted (only files genuinely tied to vectors the kernel no longer offers): .github/workflows/rust_test_pr.yaml (broken — replaced) .github/workflows/rust_coverage_report.yaml (dead — replaced) ci/test_package.py (ADBC vector gone; PyO3 in PR #13) manifest.toml (ADBC discovery file; the kernel isn't an ADBC driver) Other: - deny.toml — license + advisory allowlist for cargo-deny. Mirrors the prior about.toml allowlist plus a few standard permissive licenses cargo-deny encounters in the dep tree. - .ratignore — globs Apache RAT should skip (Cargo.lock, markdown, target/, LICENSE, etc.). - .gitignore — tighten `coverage.*` to specific extensions so `.github/workflows/coverage.yml` isn't silently ignored. - CLAUDE.md — new "CI" section listing the workflows; "Adding Cargo dependencies" now points at deny.toml (not about.toml); "License headers" mentions .ratignore. All workflows run on the `databricks-protected-runner-group / linux-ubuntu-latest` pool, matching peer repos. Action versions SHA-pinned per the convention in the peer repos. Verified locally: - cargo build (clean) - cargo test --lib (366 passing) - cargo clippy --all-targets -- -D warnings (clean) - cargo check --features proxy_tls_e2e --tests fails with a precise error pointing at the missing ProxyConfig/TlsConfig fields — the rust-e2e.yml precondition handles this cleanly - All 9 workflow YAML files parse Co-authored-by: Isaac Signed-off-by: Gopal Lal Round-5 review fixes: - pyo3-checks.yml: add precondition step that checks for pyo3/Cargo.toml and gates every subsequent step. The workflow's paths: filter still fires on root Cargo.toml/Cargo.lock changes (kernel deps can affect pyo3) but the pyo3/ sub-crate itself lands in PR #13. Until then, the job skips cleanly with a ::notice:: instead of red-lighting kernel-only PRs. - pr-checks.yml: tighten the cargo-test comment to be explicit about which suites run (unit + doc + wiremock integration) and which don't (v0_*_e2e — #[ignore]'d, run by rust-e2e.yml). - apache-rat.yml: remove `|| echo "0"` silent-failure fallback in the UNAPPROVED parse. If RAT changes report format, CI now fails loud with a clear error rather than passing with 0. Added a follow-up note pointing at --output-style xml + xmlstarlet as the proper future-proof fix. - .ratignore: remove dangling comment block about CI files; add .ratignore itself to the ignore list. Signed-off-by: Gopal Lal Round-6 review fixes: - rust-e2e.yml proxy job: drop the job-level `services: squid` block and launch the unauthenticated proxy inline via `docker run`. The services block starts the container before any step runs — even when the precondition gate trips — and pays setup cost on every PR until v0.1. Inline matches the `tls` job's approach: zero boot on a skipped job, single cleanup step tears down both proxies. - pyo3-checks.yml: split the file-existence check into its own precondition job; the matrix `build-and-test` job declares `needs: precondition` + `if: needs.precondition.outputs.ready == 'true'` so the matrix doesn't expand (no runner boot, no checkout, no toolchain install for 3.9 / 3.12) when pyo3/ doesn't exist. - apache-rat.yml: validate the parsed UNAPPROVED is a bare integer with `[[ "${UNAPPROVED}" =~ ^[0-9]+$ ]]` before the `-gt` comparison. If a future RAT release adds a unit suffix (e.g. "5 files"), CI now fails with a precise error instead of bash arithmetic blowing up with "integer expression expected". - coverage.yml: tighten the Codecov OIDC comment to flag the silent-failure mode — `use_oidc: true` requires repo enrolment in Codecov's GitHub App + OIDC enabled; otherwise the action falls back to anonymous upload that Codecov rate-limits and may drop. `fail_ci_if_error: false` is the right call (don't red- light unrelated PRs on a Codecov outage) but it does mean the first few PRs must be visually inspected for the Codecov check to confirm uploads are flowing. Signed-off-by: Gopal Lal Round-7 review fix: - Drop `apache-rat.yml` and `.ratignore`; remove the "License headers" section from CLAUDE.md and the RAT row from the CI table. Reviewer asked "do we need this?" and the answer turned out to be no: none of the peer Databricks SQL driver repos (databricks-jdbc, databricks-sql-go, databricks-sql-nodejs, databricks-sql-python) run Apache RAT or any equivalent header check, and none of them carry per-file Apache-2.0 headers on source files — they rely on the repo-root LICENSE + NOTICE to cover the Apache-2.0 grant. The kernel was the only fleet outlier. Matching the fleet convention. The headers already in files stay (harmless) but the CI gate and the mandate are gone. Signed-off-by: Gopal Lal Round-8 review fixes: - Drop `release.yml` per maintainer direction (release will be cut from a central repo). Removes the F7 `cargo pkgid` parse problem along with it. - Drop `tests/proxy_e2e.rs`, `tests/tls_e2e.rs`, the `proxy_tls_e2e` cargo feature, and the `proxy` + `tls` jobs from `rust-e2e.yml`. The kernel-side `ProxyConfig` / `TlsConfig` fields don't exist yet, so the v0-shaped tests didn't compile and the CI jobs short-circuited on every PR. Carrying broken-by-design tests in tree was reviewer-flagged clutter; v0.1 will port them fresh against the new struct shape (the ADBC-era versions in git history are the reference). `ci/proxy/` preserved on disk for reuse. `docs/migration-plan.md` §7 updated to describe the new v0.1 plan (single PR off main, includes test port + CI job re-add). - Wire pyo3 live pytest suite. `pyo3-checks.yml` swaps `maturin build --release` (built but never installed) for `maturin develop` (builds + installs into the runner Python in one step). Adds `pytest -v` step. Job gains `environment: azure-prod` + the three DATABRICKS_* secrets so the `@live` test tier runs against the configured warehouse on repo PRs; the no-network tier (test_module.py + test_auth.py) runs unconditionally and the `@live` tests auto-skip on fork PRs without approval. - Remove the "CI" section from CLAUDE.md. Workflows are self-documenting via `.github/workflows/*.yml`; the table was duplicate context with a maintenance burden. - Trim historical context from coverage.yml's header comment (the "replaces the dead rust_coverage_report.yaml" block belongs in git log, not the running workflow file). - Fix codecov-action SHA. The original `b9fd7d16...` was fabricated; first-pass reviewer-suggested `4650159d...` was a v5.4.3 *tag object* SHA, not a commit SHA (GitHub returns 404 for `git/commits/{sha}` on tag objects even though the action runner accepts them). Correct commit SHA for v5.4.3 is `18283e04ce6e62d37312384ff67231eb8fd56d24`. Verified via `gh api repos/codecov/codecov-action/git/refs/tags/v5.4.3` → tag object → resolve to commit. - Fix taiki-e/install-action comment. SHA `a416ddee...` is real and works, but the `# v2.49.32` comment was wrong — that SHA is actually tagged `v2.57.1`. Two callsites corrected (coverage.yml, license-check.yml). Verifier note: every action pin in `.github/workflows/` was audited end-to-end against the GitHub API — each SHA exists as a real commit and each commit is the actual target of the documented tag. Script lives in commit context only (not committed); rerunnable by walking `grep -rhnE "uses: [^/]+/[^@]+@[a-f0-9]{40}" .github/workflows/`. Signed-off-by: Gopal Lal --- .github/workflows/close-stale.yml | 45 ++++++ .github/workflows/coverage.yml | 83 +++++++++++ .github/workflows/dco-check.yml | 92 ++++++++++++ .github/workflows/license-check.yml | 71 +++++++++ .github/workflows/pr-checks.yml | 90 ++++++++++++ .github/workflows/pyo3-checks.yml | 133 +++++++++++++++++ .github/workflows/rust-e2e.yml | 155 ++++++-------------- .github/workflows/rust_coverage_report.yaml | 65 -------- .github/workflows/rust_test_pr.yaml | 111 -------------- .gitignore | 7 +- CLAUDE.md | 31 +--- ci/test_package.py | 22 --- deny.toml | 54 +++++++ docs/migration-plan.md | 32 ++++ manifest.toml | 26 ---- 15 files changed, 655 insertions(+), 362 deletions(-) create mode 100644 .github/workflows/close-stale.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/dco-check.yml create mode 100644 .github/workflows/license-check.yml create mode 100644 .github/workflows/pr-checks.yml create mode 100644 .github/workflows/pyo3-checks.yml delete mode 100644 .github/workflows/rust_coverage_report.yaml delete mode 100644 .github/workflows/rust_test_pr.yaml delete mode 100644 ci/test_package.py create mode 100644 deny.toml delete mode 100644 manifest.toml diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml new file mode 100644 index 00000000..63dff6ac --- /dev/null +++ b/.github/workflows/close-stale.yml @@ -0,0 +1,45 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Port of databricks/databricks-jdbc's closeStale.yml. Closes issues +# and PRs after 30 days of inactivity (with a 7-day stale window). + +name: Close stale issues and PRs + +on: + schedule: + # 06:30 UTC daily + - cron: "30 6 * * *" + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8 + with: + stale-issue-message: "This issue has been marked as Stale because it has been open for 30 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue." + stale-pr-message: "This PR has been marked as Stale because it has been open for 30 days with no activity. If you would like the PR to remain open, please remove the stale label or comment on the PR." + close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale." + close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." + days-before-stale: 30 + days-before-close: 7 + exempt-issue-labels: "epic, discussion, kernel-v0, tracked" + exempt-pr-labels: "kernel-v0, tracked" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..f48a9d7f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,83 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Code coverage report. Runs `cargo llvm-cov` against the unit / +# integration test suite (E2E tests stay #[ignore]'d) and uploads +# the lcov result to Codecov via OIDC. + +name: Coverage + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + id-token: write + pull-requests: write + +defaults: + run: + shell: bash + +jobs: + coverage: + name: Coverage + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 0 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + with: + toolchain: stable + components: llvm-tools-preview + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@a416ddeedbd372e614cc1386e8b642692f66865e # v2.57.1 + with: + tool: cargo-llvm-cov + + - name: Run coverage + # E2E tests stay #[ignore]'d; coverage runs the same suite + # as `pr-checks.yml`'s `test` job. + run: cargo llvm-cov --workspace --lcov --output-path lcov.info + + # Codecov upload. + # + # `use_oidc: true` is tokenless, but it requires the repo to be + # enrolled in Codecov's GitHub App with OIDC enabled in the + # Codecov dashboard. Until that is set up, the action falls + # back to anonymous upload which Codecov silently rate-limits + # and may drop. `fail_ci_if_error: false` keeps the job green + # in that case (we don't want a one-off Codecov outage to red- + # light unrelated PRs) — but it does mean coverage data may not + # actually land. Watch for the Codecov check on the first few + # PRs to confirm uploads are flowing. + - name: Upload to Codecov + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 + with: + files: lcov.info + fail_ci_if_error: false + use_oidc: true diff --git a/.github/workflows/dco-check.yml b/.github/workflows/dco-check.yml new file mode 100644 index 00000000..106925e1 --- /dev/null +++ b/.github/workflows/dco-check.yml @@ -0,0 +1,92 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Verbatim port of the dco-check workflow used across the other +# databricks/databricks-sql-* repos. Enforces `git commit -s` sign-off +# on every commit in a PR — CLAUDE.md mandates this convention. + +name: DCO Check + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + +permissions: + contents: read + +jobs: + dco-check: + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + name: Check DCO Sign-off + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Check DCO Sign-off + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + #!/bin/bash + set -e + + echo "Checking commits from $BASE_SHA to $HEAD_SHA" + + COMMITS=$(git rev-list --no-merges "$BASE_SHA..$HEAD_SHA") + + if [ -z "$COMMITS" ]; then + echo "No commits found in this PR" + exit 0 + fi + + FAILED_COMMITS=() + + for commit in $COMMITS; do + echo "Checking commit: $commit" + COMMIT_MSG=$(git log --format=%B -n 1 "$commit") + if echo "$COMMIT_MSG" | grep -q "^Signed-off-by: "; then + echo " Commit $commit has DCO sign-off" + else + echo " Commit $commit is missing DCO sign-off" + FAILED_COMMITS+=("$commit") + fi + done + + if [ ${#FAILED_COMMITS[@]} -ne 0 ]; then + echo "" + echo "DCO Check Failed!" + echo "The following commits are missing the required 'Signed-off-by' line:" + for commit in "${FAILED_COMMITS[@]}"; do + echo " - $commit: $(git log --format=%s -n 1 "$commit")" + done + echo "" + echo "To fix this, you need to sign off your commits. You can:" + echo "1. Add sign-off to new commits: git commit -s -m 'Your commit message'" + echo "2. Amend existing commits: git commit --amend --signoff" + echo "3. For multiple commits, use: git rebase --signoff HEAD~N (where N is the number of commits)" + echo "" + echo "The sign-off should be in the format:" + echo "Signed-off-by: Your Name " + echo "" + echo "For more details, see CONTRIBUTING.md" + exit 1 + else + echo "" + echo "All commits have proper DCO sign-off!" + fi diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 00000000..fe3a9bf0 --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,71 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Enforces the dependency-licence allowlist in `deny.toml`. New +# transitive dependencies with licenses outside `[licenses].allow` +# fail the build; the contributor either adds the licence (with +# justification in the PR description) or swaps the dep. +# +# Uses `cargo-deny` (the standard Rust ecosystem tool for this) — +# `cargo-about` is for generating attribution pages, not for gating +# on an allowlist. `about.toml` is preserved for when an attribution +# page is needed; CI gates on `deny.toml`. + +name: License Check + +on: + push: + branches: [main] + paths: + - "Cargo.toml" + - "Cargo.lock" + - "deny.toml" + - ".github/workflows/license-check.yml" + pull_request: + branches: [main] + paths: + - "Cargo.toml" + - "Cargo.lock" + - "deny.toml" + - ".github/workflows/license-check.yml" + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + cargo-deny: + name: cargo-deny + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + + - name: Install cargo-deny + uses: taiki-e/install-action@a416ddeedbd372e614cc1386e8b642692f66865e # v2.57.1 + with: + tool: cargo-deny + + - name: Check licenses, advisories, bans, sources + # `licenses` is the load-bearing check; `advisories` flags + # RustSec security advisories; `bans` and `sources` are + # empty-permissive in our deny.toml today but the slots are + # there for future hardening. + run: cargo deny check diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 00000000..87e2b3f8 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,90 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Per-PR build / format / lint / unit-test gate. Runs on every PR +# against `main` and on every push to `main`. Mirrors the +# `code-quality-checks` workflow in databricks/databricks-sql-python +# and the `prCheck` workflow in databricks/databricks-jdbc. + +name: PR Checks + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + fmt: + name: Formatting + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + with: + toolchain: stable + components: rustfmt + + - name: cargo fmt --check + run: cargo +stable fmt --all -- --check + + clippy: + name: Clippy + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + with: + toolchain: stable + components: clippy + + - name: cargo clippy + run: cargo clippy --all-targets -- -D warnings + + test: + name: Unit + doc tests + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + with: + toolchain: stable + + - name: cargo test + # Runs every test the default suite executes: unit tests, + # doc tests, and wiremock-backed integration tests. Does NOT + # run the v0_*_e2e suites — those are #[ignore]'d and require + # a live workspace; `rust-e2e.yml` runs them separately. + run: cargo test --workspace diff --git a/.github/workflows/pyo3-checks.yml b/.github/workflows/pyo3-checks.yml new file mode 100644 index 00000000..a6698540 --- /dev/null +++ b/.github/workflows/pyo3-checks.yml @@ -0,0 +1,133 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# PyO3 sub-crate CI. Path-gated on `pyo3/**` so this workflow +# only fires when the directory exists (it lands in PR #13). The +# job is skipped automatically on every PR that doesn't touch +# the pyo3/ tree. + +name: PyO3 Checks + +on: + push: + branches: [main] + paths: + - "pyo3/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/pyo3-checks.yml" + pull_request: + branches: [main] + paths: + - "pyo3/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/pyo3-checks.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + # Cheap gate job — runs once, no matrix, no toolchain installs. + # The matrix `build-and-test` job depends on this and is skipped + # entirely (no runner boot, no checkout) when the pyo3/ sub-crate + # doesn't exist. This avoids the per-Python-version setup cost on + # kernel-only PRs that trigger this workflow via root Cargo.toml + # / Cargo.lock changes. + precondition: + name: "Check pyo3/ sub-crate exists" + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + outputs: + ready: ${{ steps.check.outputs.ready }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: "Check for pyo3/Cargo.toml" + id: check + run: | + if [[ -f "pyo3/Cargo.toml" ]]; then + echo "ready=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::pyo3/ sub-crate does not exist yet — skipping pyo3 build/test matrix. (Workflow fires on root Cargo.toml changes; the pyo3 sub-crate lands in PR #13.)" + echo "ready=false" >> "$GITHUB_OUTPUT" + fi + + build-and-test: + name: "PyO3 build + test (Python ${{ matrix.python-version }})" + needs: precondition + if: needs.precondition.outputs.ready == 'true' + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + # `azure-prod` holds the Databricks secrets used by the live + # pytest suite below. Fork PRs are paused at "Waiting / approval + # required" until a maintainer clicks through, preventing secret + # exfil. PRs from forks that don't get approval still run the + # cargo-test step (no secrets needed) but the pytest step skips + # the `@live`-marked tests automatically when env vars are unset. + environment: azure-prod + env: + DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} + DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }} + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} + RUST_LOG: databricks_sql_kernel=info + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.12"] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: ${{ matrix.python-version }} + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + + - name: Install maturin + pytest + run: pip install 'maturin>=1.5,<2.0' pytest + + - name: Cargo unit tests (pyo3 crate) + # The pyo3 crate's Rust-side unit tests cover the GIL handoff + # in isolation. Runs before any maturin build so a pure-Rust + # break is caught fast. + run: cargo test -p databricks-sql-kernel-pyo3 + + - name: "Build + install pyo3 wheel (maturin develop)" + working-directory: pyo3 + # `develop` builds the extension and installs it into the + # runner's active Python in one step — what `pytest` needs. + # Debug build is fine for tests and ~2x faster than --release. + run: maturin develop --interpreter python${{ matrix.python-version }} + + - name: pytest (no-network + live tiers) + working-directory: pyo3 + # `conftest.py` decorates the warehouse-bound tests with + # `@live`; they auto-skip when DATABRICKS_HOST/HTTP_PATH/ + # TOKEN are unset. With the env: block above the live tier + # runs against the configured warehouse on PRs from this + # repo; on fork PRs without approval, the no-network tier + # (test_module.py + test_auth.py) runs and the live tier + # skips cleanly. + run: pytest -v diff --git a/.github/workflows/rust-e2e.yml b/.github/workflows/rust-e2e.yml index 2b1214c7..44c0cb2b 100644 --- a/.github/workflows/rust-e2e.yml +++ b/.github/workflows/rust-e2e.yml @@ -12,149 +12,78 @@ # See the License for the specific language governing permissions and # limitations under the License. +# End-to-end tests against a live Databricks workspace. +# +# Single `e2e` job covers the v0 surface (Session::open, execute, +# submit, await_result, metadata) via PAT + OAuth M2M. OAuth U2M is +# intentionally absent: it requires a browser flow that can't run in +# CI; `tests/oauth_u2m_integration.rs` covers it on developer +# machines. +# +# Proxy + TLS coverage will land alongside the v0.1 work that fleshes +# out `ProxyConfig` / `TlsConfig` in `src/config.rs` and plumbs them +# through `src/client/http.rs`. Tracked in `docs/migration-plan.md` +# §7. + name: Rust E2E Tests on: push: - branches: - - main + branches: [main] paths: - "src/**" - - .github/workflows/rust-e2e.yml + - "tests/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-e2e.yml" pull_request: - branches: - - main + branches: [main] paths: - "src/**" - - .github/workflows/rust-e2e.yml + - "tests/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-e2e.yml" concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-rust-e2e cancel-in-progress: true +permissions: + contents: read + id-token: write + defaults: run: shell: bash jobs: - proxy: - name: "Proxy" - runs-on: ubuntu-latest + e2e: + name: "v0 E2E surface" + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + environment: azure-prod env: DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }} + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} DATABRICKS_TEST_CLIENT_ID: ${{ secrets.DATABRICKS_TEST_CLIENT_ID }} DATABRICKS_TEST_CLIENT_SECRET: ${{ secrets.DATABRICKS_TEST_CLIENT_SECRET }} - - services: - # Unauthenticated forward proxy (no volume mounts needed) - squid: - image: ubuntu/squid:latest@sha256:6a097f68bae708cedbabd6188d68c7e2e7a38cedd05a176e1cc0ba29e3bbe029 - ports: - - 3128:3128 - + RUST_LOG: databricks_sql_kernel=debug + RUST_BACKTRACE: 1 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: fetch-depth: 0 persist-credentials: false - # Start authenticated proxy after checkout so config files are available - - name: Start authenticated proxy - run: | - docker run -d --name squid-auth \ - -p 3129:3128 \ - -v ${{ github.workspace }}/ci/proxy/squid-auth.conf:/etc/squid/squid.conf \ - -v ${{ github.workspace }}/ci/proxy/htpasswd:/etc/squid/htpasswd \ - ubuntu/squid:latest@sha256:6a097f68bae708cedbabd6188d68c7e2e7a38cedd05a176e1cc0ba29e3bbe029 - # Wait for squid to be ready - for i in $(seq 1 10); do - if docker exec squid-auth squid -k check 2>/dev/null; then - echo "Authenticated proxy is ready" - break - fi - echo "Waiting for authenticated proxy to start... ($i/10)" - sleep 1 - done - - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 - - name: Run proxy E2E tests - run: cargo test --test proxy_e2e -- --ignored --nocapture - - - name: Verify proxy was used (unauthenticated) - if: always() - run: | - docker logs $(docker ps -q --filter "publish=3128") 2>&1 \ - | grep -i "CONNECT" \ - || (echo "FAIL: No CONNECT entries found in squid logs — proxy was not used" && exit 1) - - - name: Verify proxy was used (authenticated) - if: always() - run: | - docker logs squid-auth 2>&1 \ - | grep -i "CONNECT" \ - || (echo "FAIL: No CONNECT entries found in squid-auth logs — proxy was not used" && exit 1) - - - name: Cleanup authenticated proxy - if: always() - run: docker rm -f squid-auth 2>/dev/null || true - - tls: - name: "TLS" - runs-on: ubuntu-latest - env: - DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} - DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }} - DATABRICKS_TEST_CLIENT_ID: ${{ secrets.DATABRICKS_TEST_CLIENT_ID }} - DATABRICKS_TEST_CLIENT_SECRET: ${{ secrets.DATABRICKS_TEST_CLIENT_SECRET }} - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - persist-credentials: false - - # Start mitmproxy in intercepting mode (mitmdump logs all flows to stdout) - - name: Start mitmproxy + - name: Run v0 E2E tests run: | - docker run -d --name mitmproxy \ - -p 8080:8080 \ - mitmproxy/mitmproxy:12.2.1@sha256:743b6cdc817211d64bc269f5defacca8d14e76e647fc474e5c7244dbcb645141 \ - mitmdump --set stream_large_bodies=0 - # Wait for mitmproxy to generate its CA cert - for i in $(seq 1 15); do - if docker exec mitmproxy test -f /home/mitmproxy/.mitmproxy/mitmproxy-ca-cert.pem 2>/dev/null; then - echo "mitmproxy CA cert is ready" - break - fi - echo "Waiting for mitmproxy CA cert... ($i/15)" - sleep 1 + for suite in v0_session_e2e v0_execute_e2e v0_async_execute_e2e v0_metadata_e2e; do + echo "::group::cargo test --test ${suite}" + cargo test --test "${suite}" -- --ignored --nocapture + echo "::endgroup::" done - - # Extract mitmproxy CA certificate for the trusted_certificate_path test - - name: Extract mitmproxy CA certificate - run: | - docker cp mitmproxy:/home/mitmproxy/.mitmproxy/mitmproxy-ca-cert.pem /tmp/mitmproxy-ca-cert.pem - echo "MITMPROXY_CA_CERT=/tmp/mitmproxy-ca-cert.pem" >> "$GITHUB_ENV" - echo "Extracted mitmproxy CA cert:" - openssl x509 -in /tmp/mitmproxy-ca-cert.pem -noout -subject -issuer - - - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 - - - name: Run TLS E2E tests - run: cargo test --test tls_e2e -- --ignored --nocapture - - - name: Verify traffic flowed through mitmproxy - if: always() - run: | - echo "=== mitmproxy logs ===" - docker logs mitmproxy 2>&1 | tail -50 - echo "=== checking for CONNECT entries ===" - docker logs mitmproxy 2>&1 \ - | grep -i "CONNECT\|clientconnect\|<<" \ - || (echo "FAIL: No traffic entries found in mitmproxy logs — proxy was not used" && exit 1) - - - name: Cleanup mitmproxy - if: always() - run: docker rm -f mitmproxy 2>/dev/null || true diff --git a/.github/workflows/rust_coverage_report.yaml b/.github/workflows/rust_coverage_report.yaml deleted file mode 100644 index 2bf8fb93..00000000 --- a/.github/workflows/rust_coverage_report.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2026 Databricks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This workflow runs in the context of the base repository after the -# "Rust Test" workflow completes. It downloads the coverage artifact -# and posts the coverage report as a PR comment. This two-workflow -# approach is necessary because fork PRs do not receive write -# permissions on the GITHUB_TOKEN. - -name: Rust Coverage Report - -on: - workflow_run: - workflows: ["Rust Test"] - types: - - completed - -defaults: - run: - shell: bash - -jobs: - report: - name: "Post Coverage Report" - runs-on: ubuntu-latest - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' - permissions: - contents: read - pull-requests: write - statuses: write - actions: read - steps: - - name: Download coverage artifact - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: rust-coverage - path: coverage - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Coverage report - uses: getsentry/codecov-action@bee8d919178e87c35ada22280d7da8b77dda2cbb # main (2025-02-10) - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: coverage/lcov.info - coverage-format: lcov - post-pr-comment: true - commit-sha: ${{ github.event.workflow_run.head_sha }} - target-project: auto - threshold-project: 1 - target-patch: 80 - fail-on-error: false diff --git a/.github/workflows/rust_test_pr.yaml b/.github/workflows/rust_test_pr.yaml deleted file mode 100644 index 6a87118a..00000000 --- a/.github/workflows/rust_test_pr.yaml +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright (c) 2026 Databricks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This is a common workflow for testing a PR when permissions are needed. - -name: Rust Test PR - -on: - workflow_dispatch: - inputs: - pr: - description: "The ID of the PR to test (e.g. 42)" - required: true - type: string - ref: - description: "The commit/ref to checkout" - required: true - type: string - -concurrency: - group: ${{ github.repository }}-${{ github.workflow }}-${{ inputs.pr }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -permissions: - contents: read - packages: read - pull-requests: read - -jobs: - setup: - name: configure job - runs-on: ubuntu-slim - outputs: - repository: ${{ steps.get_repo.outputs.repository }} - steps: - - name: get repository - id: get_repo - env: - GH_TOKEN: ${{ github.token }} - run: | - echo repository=$(gh pr --repo ${{ github.repository }} view ${{ inputs.pr }} --json headRepository,headRepositoryOwner --jq '"\(.headRepositoryOwner.login)/\(.headRepository.name)"') | tee -a $GITHUB_OUTPUT - - - name: set job summary - run: | - echo "**PR:** https://github.com/${{ github.repository }}/pull/${{ inputs.pr }}" >> $GITHUB_STEP_SUMMARY - echo "**Remote:** ${{ steps.get_repo.outputs.repository }}@${{ inputs.ref }}" >> $GITHUB_STEP_SUMMARY - - test: - # TODO(kernel): port the reusable `rust_test.yaml` workflow from - # adbc-drivers/databricks into this repo's .github/workflows/. Until then - # this job will fail because the referenced workflow does not exist here. - uses: adbc-drivers/databricks/.github/workflows/rust_test.yaml@main - needs: - - setup - with: - repository: ${{ needs.setup.outputs.repository }} - ref: ${{ inputs.ref }} - secrets: - # https://github.com/orgs/community/discussions/25238#discussioncomment-3247035 - DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} - TEST_PECO_WAREHOUSE_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }} - DATABRICKS_TEST_CLIENT_ID: ${{ secrets.DATABRICKS_TEST_CLIENT_ID }} - DATABRICKS_TEST_CLIENT_SECRET: ${{ secrets.DATABRICKS_TEST_CLIENT_SECRET }} - - report: - name: comment on PR - runs-on: ubuntu-slim - if: ${{ always() }} - needs: - - setup - - test - permissions: - actions: read - pull-requests: write - steps: - - id: get_run - env: - GH_TOKEN: ${{ github.token }} - run: | - echo workflow_run_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json url --jq '.url') | tee -a $GITHUB_OUTPUT - if [[ '${{ needs.test.result }}' == 'success' ]]; then - echo message=":heavy_check_mark: **Test passed:** " | tee -a $GITHUB_OUTPUT - else - echo message=":x: **Test failed:** " | tee -a $GITHUB_OUTPUT - fi - - - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - github-token: ${{ github.token }} - script: | - github.rest.issues.createComment({ - issue_number: ${{ inputs.pr }}, - owner: context.repo.owner, - repo: context.repo.repo, - body: '${{ steps.get_run.outputs.message }} ${{ needs.setup.outputs.repository }}@${{ inputs.ref }}\nWorkflow run: ${{ steps.get_run.outputs.workflow_run_url }}' - }) diff --git a/.gitignore b/.gitignore index 8100817b..d13f947a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,9 +27,14 @@ # Code coverage profiles and other test artifacts *.out -coverage.* +coverage.json +coverage.lcov +coverage.txt +coverage.html +coverage.info *.coverprofile profile.cov +lcov.info # Dependency directories (remove the comment below to include it) # vendor/ diff --git a/CLAUDE.md b/CLAUDE.md index 5fb17961..486a44a1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,7 +49,7 @@ cargo test ## PR conventions - Title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/): `type(scope): description`. No JIRA prefixes — CI rejects them. -- Commits must be DCO-signed (`git commit -s`). +- Commits must be DCO-signed (`git commit -s`). Enforced by `.github/workflows/dco-check.yml`. ## Architecture @@ -84,31 +84,14 @@ constructors on `Error` (`Error::invalid_argument()`, `Error::io()`, `Error::not_implemented()`, `Error::invalid_state()`, …) chained with `.message(...)` / `.with_source(...)` / `.sqlstate(...)`. -## License headers - -Apache 2.0 headers are required on all source files; CI runs Apache RAT. - -Rust: -```rust -// Copyright (c) 2026 Databricks, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// ... -``` - -Markdown (HTML comment): -```html - -``` - ## Adding Cargo dependencies -CI runs `cargo-about` and fails on unapproved licenses. New permissive licenses must be added to the `accepted` list in `about.toml`. +CI runs `cargo-deny check` (`.github/workflows/license-check.yml`) +and fails on unapproved licenses or RustSec advisories. New +permissive licenses must be added to `[licenses].allow` in +`deny.toml` with PR-description justification. `about.toml` is +preserved separately for generating attribution pages on demand; +the CI gate lives on `deny.toml`. ## Local development environment diff --git a/ci/test_package.py b/ci/test_package.py deleted file mode 100644 index 50db64bd..00000000 --- a/ci/test_package.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2026 Databricks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import adbc_driver_manager.dbapi -import pytest - - -def test_package() -> None: - with pytest.raises(adbc_driver_manager.dbapi.Error): - with adbc_driver_manager.dbapi.connect(driver="databricks"): - pass diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..19b1171e --- /dev/null +++ b/deny.toml @@ -0,0 +1,54 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Configuration for cargo-deny. See https://embarkstudios.github.io/cargo-deny/. +# Enforced by .github/workflows/license-check.yml. + +[graph] +all-features = true + +[advisories] +yanked = "warn" +ignore = [] + +[licenses] +# Permissive licenses we allow in transitive deps. Adding a new +# entry requires PR-description justification. +allow = [ + "Apache-2.0", + "BSD-2-Clause", + "BSD-3-Clause", + "CDLA-Permissive-2.0", + "ISC", + "MIT", + "MIT-0", + "MPL-2.0", + "Unicode-3.0", + "Unicode-DFS-2016", + "Unlicense", + "Zlib", +] +# Confidence threshold for license-text matching. 0.8 is the +# cargo-deny default; 0.93 reduces false positives for crates with +# slightly non-standard licence text. +confidence-threshold = 0.93 + +[bans] +# Tighten over time. Today we just want license enforcement live. +multiple-versions = "allow" +wildcards = "allow" + +[sources] +unknown-registry = "warn" +unknown-git = "warn" diff --git a/docs/migration-plan.md b/docs/migration-plan.md index 1aee40b4..4bbf56c8 100644 --- a/docs/migration-plan.md +++ b/docs/migration-plan.md @@ -932,6 +932,38 @@ clear it. session are visibly grouped (matches the legacy ADBC layer's `_log_span` pattern). +### Proxy + TLS E2E coverage (v0.1) + +The legacy ADBC layer carried live-network proxy and TLS E2E tests +(`tests/proxy_e2e.rs`, `tests/tls_e2e.rs`); both were deleted in +PR #11 alongside the ADBC code. The v0 ports of those files were +briefly staged behind a `proxy_tls_e2e` cargo feature in an earlier +revision of PR #17 but were removed: the kernel-side `ProxyConfig` +/ `TlsConfig` fields they referenced don't exist yet (both structs +are `#[non_exhaustive]` placeholders in `src/config.rs`), so the +test files didn't compile and the gating churn was strictly +clutter. + +`ci/proxy/{squid-auth.conf,htpasswd}` is preserved on the branch +for reuse when the v0.1 work lands. + +v0.1 work is a single PR off `main`: + +1. **Flesh `ProxyConfig`** in `src/config.rs` with fields + `url: String`, `username: Option`, + `password: Option`, `bypass_hosts: Vec`. +2. **Flesh `TlsConfig`** with `trusted_certificate_path: Option`, + `allow_self_signed: bool`, `allow_hostname_mismatch: bool`. +3. **Plumb both through** `src/client/http.rs` so the HTTP client + actually honours them (the legacy `crate::client::http::{ProxyConfig, + TlsConfig}` already had working production-shaped impls in the + ADBC layer — this is a lift, not a re-invent). +4. **Port `tests/proxy_e2e.rs` + `tests/tls_e2e.rs`** fresh against + the new struct shape (the ADBC-era versions in git history are + the reference) and add `proxy` + `tls` jobs to + `.github/workflows/rust-e2e.yml` with the inline `docker run` + pattern the `e2e` job already uses. + ## 8. Estimated scope | PR | LoC est | Risk | Notes | diff --git a/manifest.toml b/manifest.toml deleted file mode 100644 index c5afd579..00000000 --- a/manifest.toml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2026 Databricks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO(kernel): Remove this ADBC driver manifest once the kernel surfaces its -# own non-ADBC FFI and ADBC becomes one of several optional adapters rather -# than the primary identity. Kept for now so `adbc-driver-manager` can still -# discover the kernel as an ADBC driver during the transition. - -name = "Databricks Driver" -description = "Databricks SQL Kernel — exposed via the ADBC trait layer" -publisher = "Databricks, Inc." -license = "Apache-2.0" - -[ADBC] -version = "v1.1.0"