From 7f2b92ef39ccf7e1c804deffac948bfd271a916d Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 05:20:14 +0000 Subject: [PATCH 1/6] ci: widen pyo3 matrix, scan napi deps, fix maturin develop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-ups from a GitHub workflow audit, plus the one merge-queue trigger the trimmed required-checks list still needs. Merge-queue gating is being trimmed (ruleset change, applied separately) so that only "Unit + doc tests" and "Kernel Integration Tests" formally gate merges; DCO / fmt / clippy / tls-build become advisory PR checks. Because "Unit + doc tests" stays required, its workflow must run on the merge-group ref too, so pr-checks gets a `merge_group` trigger (its sibling advisory jobs run there as well, which is harmless). Changes: - pr-checks: add `merge_group` trigger so the required "Unit + doc tests" job reports on the merge group (otherwise the queue hangs). - pyo3-checks: widen the Python matrix from {3.9, 3.12} to {3.10, 3.11, 3.12, 3.13, 3.14}; drop the unsupported `--interpreter` flag from `maturin develop` (maturin 1.13.x removed it — `develop` always targets the active venv, which `uv run` selects). Bump `requires-python` to `>=3.10` to match the tested matrix. - license-check: extend the path filter to `napi/Cargo.{toml,lock}` and run `cargo deny` over the standalone napi workspace, whose own lockfile is invisible to the root run. Allow CC0-1.0 in deny.toml — `tiny-keccak` pulls it in transitively via napi and it is a public-domain dedication. - napi-checks: align the checkout (v4 -> v6.0.2) and setup-rust-toolchain (v1.15.2 -> v1.16.1) pins with the other workflows. - coverage: path-filter the expensive instrumented rebuild so docs/workflow-only PRs skip it. - dependabot: add a cargo entry for the `/napi` standalone workspace. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .github/dependabot.yml | 17 +++++++++++++++++ .github/workflows/coverage.yml | 17 +++++++++++++++++ .github/workflows/license-check.yml | 24 ++++++++++++++++++++++-- .github/workflows/napi-checks.yml | 6 +++--- .github/workflows/pr-checks.yml | 14 +++++++++++++- .github/workflows/pyo3-checks.yml | 13 +++++++++++-- deny.toml | 5 +++++ pyo3/pyproject.toml | 5 ++++- 8 files changed, 92 insertions(+), 9 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7951c64f..0754b0f0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -28,6 +28,8 @@ version: 2 updates: + # Root workspace (kernel + the pyo3 member, which share the root + # Cargo.lock). - package-ecosystem: "cargo" directory: "/" schedule: @@ -41,6 +43,21 @@ updates: - "minor" - "patch" + # napi/ is a standalone Cargo workspace with its own committed + # Cargo.lock (napi CI builds with `--locked`). The root entry above + # does not see it, so without this entry napi's transitive deps + # never get security / version bumps. + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + groups: + napi-cargo-minor-and-patch: + update-types: + - "minor" + - "patch" + - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1b366b33..83a4f165 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,8 +21,25 @@ name: Coverage on: push: branches: [main] + # Path-filtered: a full instrumented rebuild (`cargo llvm-cov`) is + # expensive, so only run it when something that can move the + # coverage number changes. Docs / workflow-only PRs skip it. + paths: + - "src/**" + - "tests/**" + - "pyo3/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/coverage.yml" pull_request: branches: [main] + paths: + - "src/**" + - "tests/**" + - "pyo3/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/coverage.yml" workflow_dispatch: concurrency: diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index c718e917..8f1f0f21 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -31,6 +31,11 @@ on: - "Cargo.toml" - "Cargo.lock" - "deny.toml" + # napi/ is a standalone workspace with its own lockfile; its + # dependency graph is invisible to a root `cargo deny` run, so + # changes there must re-trigger this workflow to scan it. + - "napi/Cargo.toml" + - "napi/Cargo.lock" - ".github/workflows/license-check.yml" pull_request: branches: [main] @@ -38,6 +43,8 @@ on: - "Cargo.toml" - "Cargo.lock" - "deny.toml" + - "napi/Cargo.toml" + - "napi/Cargo.lock" - ".github/workflows/license-check.yml" permissions: @@ -70,9 +77,22 @@ jobs: with: tool: cargo-deny - - name: Check licenses, advisories, bans, sources + - name: Check licenses, advisories, bans, sources (root workspace) # `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. + # there for future hardening. The root workspace covers the + # kernel + pyo3 (pyo3 is a root workspace member). run: cargo deny check + + - name: Check licenses, advisories, bans, sources (napi workspace) + # napi/ is a separate Cargo workspace (its own Cargo.lock) so + # its transitive graph is NOT seen by the root run above. Scan + # it explicitly against the same deny.toml policy. `--config` + # points back at the root deny.toml so both workspaces share + # one allowlist rather than drifting. `--manifest-path` is a + # global cargo-deny flag (before the subcommand); `--config` + # is a `check` flag (after it). A relative `--config` resolves + # against the manifest's directory (it would look for + # napi/deny.toml), so point at the root copy by absolute path. + run: cargo deny --manifest-path napi/Cargo.toml check --config "$GITHUB_WORKSPACE/deny.toml" diff --git a/.github/workflows/napi-checks.yml b/.github/workflows/napi-checks.yml index 1c7d1e81..c5aff811 100644 --- a/.github/workflows/napi-checks.yml +++ b/.github/workflows/napi-checks.yml @@ -69,7 +69,7 @@ jobs: outputs: ready: ${{ steps.check.outputs.ready }} steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: "Check for napi/Cargo.toml" id: check @@ -93,9 +93,9 @@ jobs: # All cargo commands run from the napi/ standalone workspace. working-directory: napi steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1 with: components: rustfmt, clippy diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 8f3833e2..3ce0c425 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -25,9 +25,21 @@ on: pull_request: types: [opened, synchronize, reopened] branches: [main] + # The `protect-main` ruleset enables a merge queue and lists this + # workflow's "Unit + doc tests" job as a required status check. + # GitHub re-evaluates required checks against the merge-group ref, + # so without this trigger the queue entry hangs until + # `check_response_timeout_minutes` expires. The sibling jobs + # (Formatting / Clippy / Build (tls-rustls feature)) also run on the + # merge group — they are advisory, not required, so the extra runs + # are harmless and keep the workflow trigger simple. + merge_group: concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + # `github.head_ref` is set on pull_request but empty on merge_group; + # fall back to the ref so distinct merge-group entries don't collapse + # into one another. + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true permissions: diff --git a/.github/workflows/pyo3-checks.yml b/.github/workflows/pyo3-checks.yml index e43ae918..af87d4f2 100644 --- a/.github/workflows/pyo3-checks.yml +++ b/.github/workflows/pyo3-checks.yml @@ -99,7 +99,11 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.12"] + # Cover the supported floor through the newest release. 3.13 + # and 3.14 exercise the GIL / free-threading changes where + # PyO3 extensions most often break. Floor is 3.10 — matches + # `requires-python` in pyo3/pyproject.toml. + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -145,7 +149,12 @@ jobs: # `develop` builds the extension and installs it into the # uv-managed venv from the previous step. Debug build is # fine for tests and ~2x faster than --release. - run: uv run maturin develop --interpreter python${{ matrix.python-version }} + # + # maturin's `develop` always targets the active virtualenv's + # interpreter and (unlike `build`) has no --interpreter flag; + # `uv run` already activates the venv `uv sync` created for the + # matrix Python version, so the interpreter is selected for us. + run: uv run maturin develop - name: pytest (no-network + live tiers) working-directory: pyo3 diff --git a/deny.toml b/deny.toml index 19b1171e..fa014841 100644 --- a/deny.toml +++ b/deny.toml @@ -29,6 +29,11 @@ allow = [ "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", + # CC0-1.0 is a public-domain dedication (no attribution or + # copyleft obligation). Pulled in transitively by `tiny-keccak` + # via the napi dependency graph, which the license check now + # scans alongside the root workspace. + "CC0-1.0", "CDLA-Permissive-2.0", "ISC", "MIT", diff --git a/pyo3/pyproject.toml b/pyo3/pyproject.toml index 67c2e2ad..8260113c 100644 --- a/pyo3/pyproject.toml +++ b/pyo3/pyproject.toml @@ -6,7 +6,10 @@ build-backend = "maturin" name = "databricks-sql-kernel" version = "0.1.0" description = "Python bindings for the Databricks SQL Kernel (PyO3)" -requires-python = ">=3.9" +# Floor matches the tested CI matrix in +# .github/workflows/pyo3-checks.yml (3.10 .. 3.14). 3.9 is no longer +# exercised in CI, so it is not claimed as supported here. +requires-python = ">=3.10" license = { text = "Apache-2.0" } authors = [{ name = "Databricks" }] # Runtime dependency for downstream consumers. Major-version bound From a1ac74d4bc1e79a9b756fb181d3518dcb5426136 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 05:38:33 +0000 Subject: [PATCH 2/6] ci: route napi cargo through JFrog proxy; bump pyarrow for py3.14 Two CI failures surfaced on the widened matrix: 1. `napi fmt + clippy + test` failed updating the crates.io index ("SSL connect error ... unexpected eof") because napi-checks was the only Rust workflow not using the `setup-jfrog` composite. The protected runner group blocks direct crates.io, so cargo must route through the JFrog proxy. Add `setup-jfrog` (cargo) + the `id-token: write` permission it needs. The composite writes a ~/.cargo source replacement, which preserves resolved versions, so the `--locked` builds stay valid. 2. `PyO3 build + test (Python 3.14)` failed in `uv sync`: pyarrow 18.x (the ceiling under the old `>=14,<19` bound) ships no cp314 wheel, so uv built it from source and the Arrow C++ CMake build failed. Bump the floor to `pyarrow>=23.0.1` to match databricks-sql-connector 5.0.0 (databricks/databricks-sql-python#818); 23.x is the first series with cp314 wheels. The bindings export via the Arrow C Data Interface (`arrow-pyarrow = "57"`), which is version-stable, so no binding code changes. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .github/workflows/napi-checks.yml | 15 +++++++++++++++ pyo3/pyproject.toml | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/napi-checks.yml b/.github/workflows/napi-checks.yml index c5aff811..80bc270d 100644 --- a/.github/workflows/napi-checks.yml +++ b/.github/workflows/napi-checks.yml @@ -49,6 +49,12 @@ concurrency: permissions: contents: read + # Required for the OIDC token exchange that the + # `.github/actions/setup-jfrog` composite uses to authenticate + # against the JFrog cargo proxy. The protected runner group blocks + # direct crates.io access, so cargo must route through the proxy. + # See go/hardened-gha. + id-token: write defaults: run: @@ -95,6 +101,15 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # Route cargo through the JFrog crates proxy. The protected + # runner group blocks direct crates.io, so without this every + # cargo command below fails to update the registry index. The + # composite writes ~/.cargo/config.toml (a source replacement), + # which preserves resolved versions, so `--locked` stays valid. + - uses: ./.github/actions/setup-jfrog + with: + cargo: "true" + - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1 with: components: rustfmt, clippy diff --git a/pyo3/pyproject.toml b/pyo3/pyproject.toml index 8260113c..44b15502 100644 --- a/pyo3/pyproject.toml +++ b/pyo3/pyproject.toml @@ -19,7 +19,14 @@ authors = [{ name = "Databricks" }] # uses these bounds (no committed lockfile) — see the # `[dependency-groups].dev` block below + the workflow comment in # `.github/workflows/pyo3-checks.yml` for the policy rationale. -dependencies = ["pyarrow>=14,<19"] +# +# Floor is `>=23.0.1` to match databricks-sql-connector 5.0.0 +# (databricks/databricks-sql-python#818): pyarrow only ships cp314 +# (Python 3.14) wheels from 23.x onward, so the previous `<19` ceiling +# forced a from-source build that fails on 3.14. Keeping the floor +# aligned with the connector also keeps the two surfaces installable +# side by side. +dependencies = ["pyarrow>=23.0.1"] # Dev / CI dependencies. PEP 735 standard; uv reads this directly. # CI runs `uv sync --group dev` (no `--frozen`, no committed From 7291557199f74f764a3b689f9b0119a544307680 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 05:54:08 +0000 Subject: [PATCH 3/6] ci: fix merge-queue checkout perms; address review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unblocks the merge queue and addresses @gopalldb's review on #106. Blocking fix: - trigger-integration-tests.yml: the `merge-queue-kernel` job declared `permissions: { checks: write }` with no `contents: read`. Declaring any permissions block zeroes every unlisted scope, so actions/checkout got a token that can't read the repo and failed "Repository not found" (exit 128). This only surfaces in the merge queue — the one path that checks out code — which is why the first queued PR (this one) hit it. Add `contents: read`. Review feedback: - deny.toml: tiny-keccak (CC0-1.0) is in the ROOT graph too (ahash -> const-random -> const-random-macro -> tiny-keccak), not just napi. The root `cargo deny` was passing without the allow only because the license text classified as "unknown" under confidence-threshold 0.93 rather than matching the explicit CC0-1.0 string. Correct the comment and document why the explicit allow matters. - pyo3/pyproject.toml: re-add the major-version ceiling — `pyarrow>=23.0.1,<24` — to comply with the go/pinning-python-deps upper-bound policy. - pyo3/Cargo.toml: bump abi3-py39 -> abi3-py310 so the wheel's ABI floor matches `requires-python = ">=3.10"`; fix the stale "3.9+" comment. - pr-checks.yml: make the concurrency group push-aware (`push` -> github.sha) so adding the merge_group `ref` fallback doesn't cancel in-flight main-branch CI on each push. - license-check.yml: use $GITHUB_WORKSPACE for the napi --manifest-path too, so the step is robust to a future defaults.run.working-directory. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .github/workflows/license-check.yml | 10 ++++++---- .github/workflows/pr-checks.yml | 13 +++++++++---- .github/workflows/trigger-integration-tests.yml | 7 +++++++ deny.toml | 9 +++++++-- pyo3/Cargo.toml | 8 ++++++-- pyo3/pyproject.toml | 6 ++++-- 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index 8f1f0f21..89c12f7d 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -92,7 +92,9 @@ jobs: # points back at the root deny.toml so both workspaces share # one allowlist rather than drifting. `--manifest-path` is a # global cargo-deny flag (before the subcommand); `--config` - # is a `check` flag (after it). A relative `--config` resolves - # against the manifest's directory (it would look for - # napi/deny.toml), so point at the root copy by absolute path. - run: cargo deny --manifest-path napi/Cargo.toml check --config "$GITHUB_WORKSPACE/deny.toml" + # is a `check` flag (after it). Both paths are absolute via + # $GITHUB_WORKSPACE so the step is immune to any + # `defaults.run.working-directory` a future edit might add + # (a relative `--config` would otherwise resolve against the + # manifest dir and look for napi/deny.toml). + run: cargo deny --manifest-path "$GITHUB_WORKSPACE/napi/Cargo.toml" check --config "$GITHUB_WORKSPACE/deny.toml" diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 3ce0c425..e7a96734 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -36,10 +36,15 @@ on: merge_group: concurrency: - # `github.head_ref` is set on pull_request but empty on merge_group; - # fall back to the ref so distinct merge-group entries don't collapse - # into one another. - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + # pull_request: coalesce per head_ref (PR branch). + # merge_group: head_ref is empty, so fall back to github.ref (the + # unique gh-readonly-queue ref) — distinct queue entries stay + # separate. + # push to main: head_ref is also empty, but falling back to + # github.ref ("refs/heads/main") would make cancel-in-progress + # cancel the previous main push's in-flight CI. Pin to github.sha + # on push so each landed commit keeps its own isolated run. + group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.head_ref || github.ref }} cancel-in-progress: true permissions: diff --git a/.github/workflows/trigger-integration-tests.yml b/.github/workflows/trigger-integration-tests.yml index 5af937df..b6ed8a8e 100644 --- a/.github/workflows/trigger-integration-tests.yml +++ b/.github/workflows/trigger-integration-tests.yml @@ -433,6 +433,13 @@ jobs: group: databricks-protected-runner-group labels: linux-ubuntu-latest permissions: + # `contents: read` is REQUIRED: this job checks out the repo to + # diff the merge group. Declaring any `permissions:` block sets + # every unlisted scope to `none`, so without this line + # actions/checkout gets a token that can't read the repo and + # fails with "Repository not found" (exit 128) — which only + # surfaces in the merge queue, the one path that checks out code. + contents: read checks: write steps: - name: Checkout code diff --git a/deny.toml b/deny.toml index fa014841..c7d37efb 100644 --- a/deny.toml +++ b/deny.toml @@ -31,8 +31,13 @@ allow = [ "BSD-3-Clause", # CC0-1.0 is a public-domain dedication (no attribution or # copyleft obligation). Pulled in transitively by `tiny-keccak` - # via the napi dependency graph, which the license check now - # scans alongside the root workspace. + # (v2.0.2) — present in BOTH the root graph (ahash -> const-random + # -> const-random-macro -> tiny-keccak) and the napi graph. The + # root `cargo deny` run was previously passing without this entry + # only because the license text was classified as "unknown" under + # confidence-threshold = 0.93 rather than matched to the explicit + # CC0-1.0 string; allow-listing it makes the policy explicit so a + # future classifier change can't silently flip it to a hard reject. "CC0-1.0", "CDLA-Permissive-2.0", "ISC", diff --git a/pyo3/Cargo.toml b/pyo3/Cargo.toml index c083a5ce..bd61b58e 100644 --- a/pyo3/Cargo.toml +++ b/pyo3/Cargo.toml @@ -40,8 +40,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] databricks-sql-kernel = { path = ".." } -# pyo3 — abi3-py39 lets one wheel cover Python 3.9+. -pyo3 = { version = "0.26", features = ["extension-module", "abi3-py39"] } +# pyo3 — abi3-py310 builds a single stable-ABI wheel (tagged +# cp310-abi3) that loads on CPython 3.10+. The ABI floor is kept in +# step with `requires-python = ">=3.10"` in pyproject.toml; bumping +# both together avoids shipping a wheel whose ABI tag advertises an +# interpreter the package no longer claims to support. +pyo3 = { version = "0.26", features = ["extension-module", "abi3-py310"] } # Multi-thread runtime — one per Session, owned on the Rust side. tokio = { version = "1", features = ["rt-multi-thread"] } diff --git a/pyo3/pyproject.toml b/pyo3/pyproject.toml index 44b15502..d374bc7c 100644 --- a/pyo3/pyproject.toml +++ b/pyo3/pyproject.toml @@ -25,8 +25,10 @@ authors = [{ name = "Databricks" }] # (Python 3.14) wheels from 23.x onward, so the previous `<19` ceiling # forced a from-source build that fails on 3.14. Keeping the floor # aligned with the connector also keeps the two surfaces installable -# side by side. -dependencies = ["pyarrow>=23.0.1"] +# side by side. The `<24` ceiling preserves the major-version upper +# bound the go/pinning-python-deps policy requires (a future pyarrow +# major then surfaces as a deliberate bump, not a silent auto-resolve). +dependencies = ["pyarrow>=23.0.1,<24"] # Dev / CI dependencies. PEP 735 standard; uv reads this directly. # CI runs `uv sync --group dev` (no `--frozen`, no committed From 780ab546154f5a58db8523fd16977662704e8798 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 06:33:56 +0000 Subject: [PATCH 4/6] ci: drop kernel-side integration-test placeholder (orphans + hangs queue) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first PR to actually enter the merge queue stalled at AWAITING_CHECKS. Root cause: the merge-queue and label-trigger paths each posted an `in_progress` "Kernel Integration Tests" check via `github.token` (the github-actions App, id 15368) and assumed the receiver in databricks-driver-test would "overwrite" it. It can't — a check-run can only be updated by the App that created it, and the receiver posts under the integration-test App (id 2731531). So the receiver created its OWN completed check while the github-actions placeholder stayed `in_progress` forever. The ruleset's required check was pinned to integration_id 15368 (the placeholder's App), so branch protection waited on the orphan until the 60-minute queue timeout. Fix — match databricks/databricks-sql-python's trigger-integration-tests.yml, which posts no placeholder and lets the receiver be the sole creator of the integration-test check: - Remove the "Post in_progress check" step from both the merge-queue (`merge-queue-kernel`) and label-trigger (`trigger-tests-pr`) paths. - The receiver (databricks-sql-kernel-integration-tests.yml) already creates and completes "Kernel Integration Tests" under the integration-test App, so it is now the single source of truth — no duplicate, no orphan. - Fail-closed on a silent dispatch drop is preserved by the existing `if: failure()` steps plus branch protection treating a missing required check as blocking. - Update the stale header/sticky-comment text that described the removed overwrite mechanism. A companion ruleset change drops the `integration_id: 15368` pin from the required "Kernel Integration Tests" check so it matches by name — letting the PR-path auto-pass (github-actions) and the queue-path receiver result (integration-test App) both satisfy the gate, exactly as the connector's branch protection does. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .../workflows/trigger-integration-tests.yml | 120 ++++++------------ 1 file changed, 38 insertions(+), 82 deletions(-) diff --git a/.github/workflows/trigger-integration-tests.yml b/.github/workflows/trigger-integration-tests.yml index b6ed8a8e..367283fa 100644 --- a/.github/workflows/trigger-integration-tests.yml +++ b/.github/workflows/trigger-integration-tests.yml @@ -62,10 +62,12 @@ # Kernel Integration Tests result. # A missing install here means the dispatch succeeds, the # receiver runs the tests, then 403s when posting the check -# back — leaving the `in_progress` check posted by THIS -# workflow stuck forever (correctly: branch protection -# blocks merge, but operators have to know to investigate -# the App install, not the test result). +# back — so the required `Kernel Integration Tests` check is +# never created and branch protection blocks merge (fail-closed), +# but operators have to know to investigate the App install, not +# the test result. The receiver is the SOLE poster of that check +# (this workflow posts no placeholder — see the notes on the +# dispatch jobs below). # # The receiver-side timeout must be ≥ the longest realistic test # run + reasonable slack, and the merge-queue branch-protection @@ -290,52 +292,22 @@ jobs: # ensures a leaked token can only fire dispatches. permission-contents: write - # Post an `in_progress` Kernel Integration Tests check at the - # PR head SHA BEFORE the dispatch. Critical for two reasons: - # - # (1) **Overwrite the stale-green race.** - # `skip-integration-tests-pr` posts `conclusion: success` - # for the same check name on every - # opened/synchronize/reopened. Without this in_progress - # overwrite, a maintainer who labels-and-merges promptly - # would ship a PR whose latest "Kernel Integration Tests" - # check is still the auto-pass from the synchronize event - # — branch protection sees green, allows merge, no real - # signal ever runs against the receiver. The in_progress - # check is now the latest until the receiver overwrites - # it on completion. - # - # (2) **Silent-drop fail-closed if the receiver's handler is - # broken / renamed.** `POST .../dispatches` returns 204 - # even when no workflow on the receiving side is listening - # for `kernel-pr-test`. If `databricks-driver-test#375` - # reverts, gets renamed (e.g. `kernel-pr-tests` plural), - # or its handler is removed: dispatch succeeds, no - # `if: failure()` fires, and without this in_progress - # check the PR would merge on stale green with zero - # signal. With this step, the `in_progress` sits forever - # until something explicitly overwrites it — branch - # protection blocks merge. The kernel-side - # `INTEGRATION_TESTS_ENABLED` var protects rollout order; - # this protects steady-state drift. - - name: Post in_progress check (overwrite stale-green / fail-closed on silent drop) - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ github.token }} - script: | - await github.rest.checks.create({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'Kernel Integration Tests', - head_sha: context.payload.pull_request.head.sha, - status: 'in_progress', - started_at: new Date().toISOString(), - output: { - title: 'Dispatching to databricks-driver-test', - summary: 'Maintainer added `integration-test` label. Dispatching to the receiver repo; it will overwrite this check with the run result. If this check stays `in_progress` for an unusually long time, the receiver-side workflow may be broken or renamed — manual investigation needed.' - } - }); - + # NOTE: no kernel-side `in_progress` placeholder is posted here. + # The receiver (databricks-sql-kernel-integration-tests.yml in + # databricks-driver-test) is the SOLE creator of the real + # "Kernel Integration Tests" check, posting in_progress -> + # completed under the integration-test GitHub App. A kernel-side + # placeholder posted via `github.token` (the github-actions app) + # cannot be updated by the receiver's App — they are distinct + # check-runs — so it would orphan as a permanent `in_progress` + # and hang the merge queue. This mirrors + # databricks/databricks-sql-python's trigger-integration-tests.yml, + # which posts no placeholder. Fail-closed on a silent dispatch + # drop is preserved by the `if: failure()` step below plus + # branch protection treating a missing required check as + # blocking; matching the required check by NAME (not pinned to a + # specific integration_id) lets either the PR-path auto-pass or + # the receiver's result satisfy the gate. - name: Build payload (PR-title-safe via JSON.stringify) id: payload uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 @@ -377,13 +349,13 @@ jobs: # cycle when each event creates a fresh comment. # # The "View status" link points at the Kernel Integration - # Tests check on this PR's head SHA. The check itself - # carries the receiver-supplied `details_url` (the - # actual workflow run on `databricks-driver-test`) once - # the receiver overwrites the `in_progress` placeholder - # we posted before dispatch. Linking to the check - # directly — rather than the receiver workflow's run-list - # — means the comment doesn't go stale across re-runs. + # Tests check on this PR's head SHA. The receiver creates + # that check (in_progress -> completed) under the + # integration-test App and supplies its own `details_url` + # (the actual workflow run on `databricks-driver-test`). + # Linking to the check directly — rather than the receiver + # workflow's run-list — means the comment doesn't go stale + # across re-runs. body: | **Kernel integration tests triggered** for `${{ github.event.pull_request.head.sha }}`. @@ -566,31 +538,15 @@ jobs: # the matching note on the label-trigger path). permission-contents: write - # See the matching block on the label-trigger path for the - # full rationale: this `in_progress` check (a) overwrites - # any stale-green from earlier auto-pass paths and (b) - # turns a silent-drop (broken / renamed receiver-side - # handler) into a fail-closed timeout. Branch protection - # blocks merge until the receiver overwrites this check. - - name: Post in_progress check (overwrite stale-green / fail-closed on silent drop) - if: steps.changed.outputs.changed == 'true' && vars.INTEGRATION_TESTS_ENABLED == 'true' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ github.token }} - script: | - await github.rest.checks.create({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'Kernel Integration Tests', - head_sha: '${{ github.event.merge_group.head_sha }}', - status: 'in_progress', - started_at: new Date().toISOString(), - output: { - title: 'Dispatching to databricks-driver-test (merge queue)', - summary: 'Merge group is validating; dispatching to the receiver repo. If this check stays `in_progress` past the merge-queue timeout, the receiver-side workflow may be broken or renamed — manual investigation needed.' - } - }); - + # NOTE: no kernel-side `in_progress` placeholder here either — + # see the matching note on the label-trigger path above. The + # receiver owns the real "Kernel Integration Tests" check; a + # placeholder posted under the github-actions app would orphan + # (the receiver's App can't update another app's check-run) and + # hang the queue past `check_response_timeout_minutes`. This was + # the actual cause of the first queued PR stalling. The + # `if: failure()` step below still fails the check closed on a + # dispatch error. - name: Dispatch kernel tests if: steps.changed.outputs.changed == 'true' && vars.INTEGRATION_TESTS_ENABLED == 'true' uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0 From bd146e54176e5ab734c02badd7a5e3e334ff8aa0 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 06:45:47 +0000 Subject: [PATCH 5/6] =?UTF-8?q?ci:=20speed=20up=20PR=20CI=20=E2=80=94=20fi?= =?UTF-8?q?x=20cache-busting,=20pyo3=20double-build,=20napi=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured PR CI critical path was ~7 min with every job cold-building the ~57-crate dep tree. Three fixes: 1. Restore Rust build caching. setup-jfrog exported a fresh-per-run CARGO_REGISTRIES_JFROG_TOKEN into $GITHUB_ENV; Swatinem/rust-cache (run by setup-rust-toolchain) hashes every CARGO*-prefixed env var into its cache key, so every run got a unique key and a guaranteed miss. Proven: two Clippy runs had matching lockfile-hash but differing job-hash (v0-rust-clippy-...-713dabfe-b925cd2e vs ...-d7a226c9-b925cd2e). The env export was redundant — cargo, cargo-deny, and cargo-llvm-cov all read the token from ~/.cargo/credentials.toml via the config.toml credential-provider. Dropping the export restores stable keys and warm builds. 2. Stop pyo3 building the kernel twice. `uv sync` installed the project, triggering a full release build of the cdylib (~4m43s), then `maturin develop` rebuilt it in debug — x5 Python versions. Add `--no-install-project` so uv installs only deps; maturin builds the extension once. 3. Take napi's release build off the PR critical path. The lto=true `cargo build --release` (~4m) only verifies the release profile links; `cargo check --release` wouldn't exercise the LTO link, so keep the real build but gate it to `push` (post-merge canary on main). napi is not a required check, so PR feedback drops to fmt + clippy + test. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .github/actions/setup-jfrog/action.yml | 16 +++++++++++++--- .github/workflows/napi-checks.yml | 13 ++++++++++--- .github/workflows/pyo3-checks.yml | 9 ++++++++- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-jfrog/action.yml b/.github/actions/setup-jfrog/action.yml index 9c6e15b0..ce4e8dc6 100644 --- a/.github/actions/setup-jfrog/action.yml +++ b/.github/actions/setup-jfrog/action.yml @@ -110,9 +110,19 @@ runs: EOF chmod 600 ~/.cargo/credentials.toml - # Exported for tools like cargo-deny / cargo-llvm-cov that - # may read the env directly rather than the credentials file. - echo "CARGO_REGISTRIES_JFROG_TOKEN=Bearer ${JFROG_ACCESS_TOKEN}" >> "$GITHUB_ENV" + # NOTE: we deliberately do NOT export CARGO_REGISTRIES_JFROG_TOKEN + # into $GITHUB_ENV. cargo (and tools that shell out to it — + # cargo-deny, cargo-llvm-cov) read the token from the + # ~/.cargo/credentials.toml written above via the + # `credential-provider = ["cargo:token"]` line in config.toml, + # so the env var was redundant. Critically, the token is + # regenerated on every run, and Swatinem/rust-cache (run by + # actions-rust-lang/setup-rust-toolchain) hashes every + # `CARGO*`-prefixed env var into its cache key — so exporting a + # fresh token here gave every run a unique key and a guaranteed + # cache miss (full cold rebuild of the ~57-crate tree in every + # job). Keeping the token in the credentials file only restores + # stable cache keys and warm builds. echo "Cargo configured to use JFrog registry" diff --git a/.github/workflows/napi-checks.yml b/.github/workflows/napi-checks.yml index 80bc270d..683f033a 100644 --- a/.github/workflows/napi-checks.yml +++ b/.github/workflows/napi-checks.yml @@ -132,8 +132,15 @@ jobs: # Release-profile build verifies the cdylib actually links with # the production profile knobs (lto=true, codegen-units=1, - # strip="debuginfo"). Slower (~1m) but cheap insurance against - # release-only regressions that the debug-profile `cargo test` - # above wouldn't catch. + # strip="debuginfo"). The lto=true link is the slow part (~4 min + # here), and `cargo check --release` would NOT exercise it + # (check doesn't link the cdylib), so we keep the real build but + # run it only on push to main — a post-merge canary — rather + # than on every PR push. napi is not a required check, so this + # keeps PR feedback fast (fmt + clippy + test, ~2.5 min) while + # still catching release-only link regressions before they + # accumulate on main. The merge group does not run napi (no + # merge_group trigger), so main is the gate. - name: cargo build --release --locked + if: github.event_name == 'push' run: cargo build --release --locked diff --git a/.github/workflows/pyo3-checks.yml b/.github/workflows/pyo3-checks.yml index af87d4f2..28cc9025 100644 --- a/.github/workflows/pyo3-checks.yml +++ b/.github/workflows/pyo3-checks.yml @@ -136,7 +136,14 @@ jobs: # age filter on `db-pypi` are the baseline protection. uv # re-resolves each run within those bounds. working-directory: pyo3 - run: uv sync --group dev + # `--no-install-project` installs only the dependency groups, + # NOT the kernel cdylib itself. Without it, `uv sync` runs a + # full maturin/cargo RELEASE build of the extension here — and + # then the `maturin develop` step below rebuilds it again in + # debug, so the kernel compiled twice per matrix Python version + # (~5 min each, x5 versions). The Rust extension is built + # exactly once, by `maturin develop`. + run: uv sync --group dev --no-install-project - name: Cargo unit tests (pyo3 crate) # The pyo3 crate's Rust-side unit tests cover the GIL handoff From dd6117365f743d09e97586fec5720c65d62b46e2 Mon Sep 17 00:00:00 2001 From: Vikrant Puppala Date: Tue, 2 Jun 2026 06:53:58 +0000 Subject: [PATCH 6/6] ci: tidy workflow/job display names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit of every workflow + job name. No required-check context is renamed (Unit + doc tests and Kernel Integration Tests are untouched), so gating is unaffected — these are display-only cleanups for the checks UI. - trigger-integration-tests.yml: give all five jobs human-readable names instead of falling back to raw machine keys (remove-label-on-new-commit, skip-integration-tests-pr, label-noop-during-rollout, trigger-tests-pr, merge-queue-kernel). - license-check.yml: rename the job from `cargo-deny` to `License & advisory check` to match the Title Case convention every other workflow uses. - close-stale.yml: name the `stale` job. - pyo3-checks.yml / napi-checks.yml: drop the trailing slash in the precondition job names ("Check pyo3/ sub-crate exists" -> "Check pyo3 sub-crate exists"). GitHub renders checks as "Workflow / Job", so a slash inside the job name produced a confusing double-slash ("PyO3 Checks / Check pyo3/ sub-crate exists"). Note: the "License Check / Kernel Integration Tests" grouping seen in the UI is NOT fixable by renaming — it is GitHub bucketing an API-created check-run (posted via github.token) into an arbitrary same-app check-suite. It is cosmetic and does not affect gating. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala --- .github/workflows/close-stale.yml | 1 + .github/workflows/license-check.yml | 2 +- .github/workflows/napi-checks.yml | 2 +- .github/workflows/pyo3-checks.yml | 2 +- .github/workflows/trigger-integration-tests.yml | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml index 77185f7c..6bdd7ce3 100644 --- a/.github/workflows/close-stale.yml +++ b/.github/workflows/close-stale.yml @@ -29,6 +29,7 @@ permissions: jobs: stale: + name: Close stale issues and PRs runs-on: group: databricks-protected-runner-group labels: linux-ubuntu-latest diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index 89c12f7d..07b088ea 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -59,7 +59,7 @@ defaults: jobs: cargo-deny: - name: cargo-deny + name: License & advisory check runs-on: group: databricks-protected-runner-group labels: linux-ubuntu-latest diff --git a/.github/workflows/napi-checks.yml b/.github/workflows/napi-checks.yml index 683f033a..7700409e 100644 --- a/.github/workflows/napi-checks.yml +++ b/.github/workflows/napi-checks.yml @@ -68,7 +68,7 @@ jobs: # this workflow via root Cargo.toml changes before the napi crate # has merged. precondition: - name: "Check napi/ sub-crate exists" + name: "Check napi sub-crate exists" runs-on: group: databricks-protected-runner-group labels: linux-ubuntu-latest diff --git a/.github/workflows/pyo3-checks.yml b/.github/workflows/pyo3-checks.yml index 28cc9025..ce050cc8 100644 --- a/.github/workflows/pyo3-checks.yml +++ b/.github/workflows/pyo3-checks.yml @@ -58,7 +58,7 @@ jobs: # kernel-only PRs that trigger this workflow via root Cargo.toml # / Cargo.lock changes. precondition: - name: "Check pyo3/ sub-crate exists" + name: "Check pyo3 sub-crate exists" runs-on: group: databricks-protected-runner-group labels: linux-ubuntu-latest diff --git a/.github/workflows/trigger-integration-tests.yml b/.github/workflows/trigger-integration-tests.yml index 367283fa..ef5166b2 100644 --- a/.github/workflows/trigger-integration-tests.yml +++ b/.github/workflows/trigger-integration-tests.yml @@ -103,6 +103,7 @@ jobs: # workspace. # ============================================================================= remove-label-on-new-commit: + name: Reset integration-test label on push if: github.event_name == 'pull_request' && github.event.action == 'synchronize' # Own concurrency group with `cancel-in-progress: false` — see the # workflow-level comment above. The label-cleanup is a @@ -184,6 +185,7 @@ jobs: # (or earlier, when a maintainer adds the label). # ============================================================================= skip-integration-tests-pr: + name: Integration tests (auto-pass on PR) if: github.event_name == 'pull_request' && github.event.action != 'labeled' runs-on: group: databricks-protected-runner-group @@ -223,6 +225,7 @@ jobs: # sticky comment to make the no-op visible. # ============================================================================= label-noop-during-rollout: + name: Integration-test label (rollout no-op notice) if: | github.event_name == 'pull_request' && github.event.action == 'labeled' && @@ -252,6 +255,7 @@ jobs: Once the variable is set, re-add the label (or push) to trigger a real run. trigger-tests-pr: + name: Dispatch integration tests (labeled PR) # Companion-PR ordering gate: only fire dispatches once the # internal repo's receiving workflow (databricks-driver-test#375 # — see the PR description) has landed. Until then, @@ -400,6 +404,7 @@ jobs: # Otherwise dispatch and let the internal repo report the result. # ============================================================================= merge-queue-kernel: + name: Dispatch integration tests (merge queue) if: github.event_name == 'merge_group' runs-on: group: databricks-protected-runner-group