Skip to content

ci: workflow audit — merge-queue fixes, caching/build speedups, coverage - #106

Merged
vikrantpuppala merged 6 commits into
mainfrom
ci/workflow-audit-fixes
Jun 2, 2026
Merged

vikrantpuppala merged 6 commits into
mainfrom
ci/workflow-audit-fixes

Conversation

@vikrantpuppala

@vikrantpuppala vikrantpuppala commented Jun 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

Follow-ups from a full audit of the repo's GitHub Actions setup. The scope grew as the merge queue (enabled but never previously exercised) surfaced latent bugs once this PR became the first to actually go through it. Grouped by theme below.

Squash-merge note: this lands as one commit; the per-commit history on the branch breaks the work into reviewable steps.

1. Merge-queue correctness (the queue was enabled but broken)

  • merge-queue-kernel checkout 403. The job declared permissions: { checks: write } with no contents: read; any permissions: block zeroes unlisted scopes, so actions/checkout failed Repository not found (exit 128). Only the queue path checks out code, so it stayed latent until now. Added contents: read.
  • Orphaned in_progress check hung the queue. The kernel posted an in_progress "Kernel Integration Tests" check via the github-actions App and assumed the receiver (databricks-driver-test) would overwrite it. A check-run can only be updated by its creating App; the receiver posts under the integration-test App, so it created its own completed check while the placeholder stayed in_progress forever. Removed the kernel-side placeholder from both the merge-queue and label-trigger paths so the receiver is the sole poster — matching databricks/databricks-sql-python's pattern.
  • Required-checks list trimmed (ruleset change, applied out-of-band) to Unit + doc tests + Kernel Integration Tests; DCO/Formatting/Clippy/tls-build are advisory. Dropped the integration_id pin on Kernel Integration Tests so it matches by name (PR-path auto-pass and queue-path receiver result both satisfy it). pr-checks gains a merge_group trigger so the required Unit + doc tests reports on the merge group.

2. CI speedups (measured critical path ~7 min → warm builds much faster)

  • Restored Rust build caching. setup-jfrog exported a fresh-per-run CARGO_REGISTRIES_JFROG_TOKEN; Swatinem/rust-cache hashes every CARGO* env var into its key, so every run got a unique key and a guaranteed cold build. Proven via two runs with matching lockfile-hash but differing job-hash. Dropped the redundant env export (cargo/deny/llvm-cov read the token from ~/.cargo/credentials.toml). Verified: first-ever Cache hit ... full match: true; Clippy 114s→41s, tls-rustls build 123s→44s.
  • pyo3 no longer builds the kernel twice. uv sync built the cdylib in release (~4m43s), then maturin develop rebuilt it in debug, ×5 Python versions. Added --no-install-project so maturin builds it once.
  • napi release build off the PR path. The lto=true cargo build --release (~4m) now runs only on push to main (post-merge canary); napi isn't a required check, so PRs get fmt+clippy+test.

3. Coverage / matrix / deps

  • pyo3 Python matrix {3.9, 3.12} → {3.10, 3.11, 3.12, 3.13, 3.14}; requires-python → >=3.10; pyarrow → >=23.0.1,<24 (23.x is the first series with cp314 wheels — matches databricks-sql-connector 5.0.0 / #818). abi3-py39 → abi3-py310 to match the ABI floor. Dropped the unsupported --interpreter flag from maturin develop.
  • License check extended to the standalone napi workspace (its own lockfile is invisible to the root cargo deny); allow CC0-1.0 (transitive tiny-keccak, in both root and napi graphs). Path filter + merge_group parity.
  • Coverage path-filtered so docs/workflow-only PRs skip the instrumented rebuild.
  • Dependabot gains a cargo entry for the /napi standalone workspace.
  • napi pins aligned (checkout v4→v6.0.2, setup-rust-toolchain v1.15.2→v1.16.1) and routed through the JFrog cargo proxy.

4. Naming cleanup (display-only; no required-check context renamed)

  • Named the 5 trigger-integration-tests jobs (were raw machine keys); cargo-deny job → License & advisory check; named the close-stale job.
  • Dropped the slash inside the precondition names (Check pyo3/ sub-crate exists → Check pyo3 sub-crate exists) so the Workflow / Job UI rendering isn't a confusing double-slash.

Verification

  • actionlint clean on all workflows.
  • Full PR-check run green (0 failures), including cargo-deny and Coverage/llvm-cov (confirming the dropped env var didn't break JFrog auth).
  • Cache hit confirmed on the follow-up run; warm-build timings measured.
  • cargo deny over the napi workspace passes after the CC0-1.0 allow; root still passes.

Not in this PR (tracked follow-ups)

  • Making napi/pyo3/license-check required (needs path filters dropped or always-reporting skip jobs first).
  • OS matrix (macOS/Windows) — protected runner group is Linux-only.
  • MSRV / toolchain pin.

@vikrantpuppala
vikrantpuppala requested a review from a team as a code owner June 2, 2026 05:20
@vikrantpuppala
vikrantpuppala force-pushed the ci/workflow-audit-fixes branch from 37b2435 to d443923 Compare June 2, 2026 05:26
@vikrantpuppala vikrantpuppala changed the title ci: fix merge-queue check gaps, widen pyo3 matrix, scan napi deps ci: widen pyo3 matrix, scan napi deps, fix maturin develop Jun 2, 2026
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 <vikrant.puppala@databricks.com>
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 <vikrant.puppala@databricks.com>
@vikrantpuppala
vikrantpuppala added this pull request to the merge queue Jun 2, 2026
…eue)

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 <vikrant.puppala@databricks.com>
@vikrantpuppala
vikrantpuppala removed this pull request from the merge queue due to a manual request Jun 2, 2026
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 <vikrant.puppala@databricks.com>
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 <vikrant.puppala@databricks.com>
@vikrantpuppala vikrantpuppala changed the title ci: widen pyo3 matrix, scan napi deps, fix maturin develop ci: workflow audit — merge-queue fixes, caching/build speedups, coverage Jun 2, 2026
@vikrantpuppala
vikrantpuppala added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit ad63c71 Jun 2, 2026
21 checks passed

This branch was previously deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants