Skip to content

chore(ci): align checkout pin, add dependabot config, fix stale pyproject comments - #41

Merged
gopalldb merged 3 commits into
mainfrom
chore/ci-hygiene
May 22, 2026
Merged

gopalldb merged 3 commits into
mainfrom
chore/ci-hygiene

Conversation

@gopalldb

@gopalldb gopalldb commented May 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes three audit findings related to CI and dependency hygiene.

Audit Commit What
#9 2acc8e5 dco-check.yml checkout was @v6.0.2; all other workflows use @v4. Aligned to v4. Both SHA-pinned — no security delta.
#10 820e69c No .github/dependabot.yml. Added one covering cargo + github-actions. pip intentionally omitted per go/pinning-python-deps (externally-published-library rule).
#16 (dependency-pinning audit row 3) 732827b pyo3/pyproject.toml comments claimed uv sync --frozen + committed uv.lock with SHA256 hashes. Actual CI uses uv sync --group dev (no --frozen, no committed lockfile) per the externally-published-library policy. Rewrote both comment blocks to match reality. Documentation-only fix.

#9 — Checkout pin alignment

dco-check.yml:37 was the only workflow using actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2. All other 7 workflows use actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4. Both are SHA-pinned, so no actual security delta — purely version-drift hygiene.

#10 — Dependabot configuration

New .github/dependabot.yml:

  • cargo ecosystem: tracks the Rust crate graph weekly, complements the existing cargo-deny gate. Patch + minor grouped to reduce PR churn; security advisories still surface as individual PRs. Limit: 10 open PRs.
  • github-actions ecosystem: tracks SHA-pinned action versions weekly. Patch + minor grouped. Limit: 5 open PRs.

pip ecosystem intentionally NOT included. The kernel is treated as an externally-published library per go/pinning-python-deps:

  • Major-version upper bounds in pyo3/pyproject.toml (e.g. pyarrow>=14,<19).
  • uv sync re-resolves on each CI run within those bounds.
  • No committed lockfile (would impede downstream pip install).

Letting Dependabot rewrite pinned pip versions would conflict with that policy.

#16 — pyproject.toml comment accuracy

The [project].dependencies block comment said:

The CI environment is fully hash-locked via uv.lock (see below), separately from this contract.

And the [dependency-groups].dev block said:

uv sync --frozen installs from uv.lock, which carries SHA256 hashes for every artifact + transitive dep.

Neither was true. The repo has no uv.lock committed; the workflow runs uv sync --group dev (no --frozen). The workflow's own inline comment correctly describes the policy ("No --frozen and no committed lockfile: per go/pinning-python-deps the externally-published-library rule says not to pin transitive deps") — only the pyproject comments were stale.

This documentation drift was actively misleading dependency-pinning audits, contributing to false "unpinned pyarrow" findings. Both comment blocks now match the actual in-repo policy.

No behavioural change.

Audit items NOT addressed here

Test plan

  • Reviewer checks GitHub recognises the dependabot config (Insights → Dependency graph → Dependabot tab shows cargo + github-actions ecosystems active).
  • DCO check on this PR runs successfully with the new v4 checkout (the workflow runs on PR open, once Actions are enabled).
  • Reviewer skims the pyproject comment changes to confirm they match the workflow's actual behaviour (uv sync --group dev, no --frozen).

This pull request and its description were written by Isaac.

gopalldb added 2 commits May 22, 2026 08:33
`dco-check.yml` was the only workflow using `actions/checkout@v6.0.2`
while the other 7 (`pr-checks`, `coverage`, `license-check`,
`pyo3-checks`, `rust-e2e`, `close-stale`, plus composites under
`.github/actions/`) all use `actions/checkout@v4` at SHA
34e114876b0b11c390a56381ad16ebd13914f8d5.

No security delta — both are SHA-pinned. Pure version-drift hygiene
so a maintainer reading the workflows sees one consistent version
across the repo.

Co-authored-by: Isaac
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
Closes the dependency-hygiene gap by configuring Dependabot to track
the two ecosystems the kernel actually uses: `cargo` (Rust crates)
and `github-actions` (SHA-pinned actions).

`pip` is intentionally excluded. Per go/pinning-python-deps, the
kernel is treated as an externally-published library: major-version
bounds in `pyo3/pyproject.toml` + `uv sync` re-resolution per CI run,
no committed lockfile. Letting Dependabot rewrite pinned pip
versions would conflict with that policy.

Both ecosystems batch minor + patch updates via groups to reduce
PR churn; security advisories still surface as individual PRs.
Limits: cargo 10 open PRs, github-actions 5.

Co-authored-by: Isaac
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
The dependency-block comments claimed CI uses `uv sync --frozen`
with a committed `uv.lock` carrying SHA256 hashes. The actual
policy (per `.github/workflows/pyo3-checks.yml` + go/pinning-python-
deps externally-published-library rule) is the opposite: no
committed lockfile, no `--frozen`, just major-version bounds + the
db-pypi JFrog proxy's 7-day age filter.

The mismatch was misleading to security reviewers and to future
contributors trying to understand the supply-chain story. Audits
of dependency pinning flagged the pyarrow dep as "unpinned" partly
because the comments suggested hash-locked CI that didn't exist.

This commit rewrites both comment blocks to match the actual
in-repo policy:
- `[project].dependencies` block: explains the major-version bound
  and points at the workflow + policy doc.
- `[dependency-groups].dev` block: explains `uv sync --group dev`
  (no `--frozen`), JFrog age-filter as baseline protection, uv
  re-resolution per CI run within the major-version bounds.

No behavioural change. Documentation accuracy only.

Co-authored-by: Isaac
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
@gopalldb gopalldb changed the title chore(ci): align checkout pin + add dependabot config chore(ci): align checkout pin, add dependabot config, fix stale pyproject comments May 22, 2026
gopalldb added a commit that referenced this pull request May 22, 2026
…#42)

## Summary

Closes audit finding #2 (recap from a recent security audit batch): the
original CODEOWNERS landed in PR #37 only covered `.github/workflows/`
and the CODEOWNERS file itself. Audit asked for the Cargo dependency
graph + license-policy gate to also require team review, since adding a
new crate or relaxing license rules is security-relevant.

## What this adds

New ownership rows for `@databricks/eng-oss-sql-driver`:

| Path | Why |
|---|---|
| `.github/dependabot.yml` | Dependency-update automation config —
controls what auto-PRs land |
| `.github/actions/` | Composite actions (e.g. `setup-jfrog`) |
| `/Cargo.toml`, `/Cargo.lock` | Top-level crate graph |
| `/deny.toml` | `cargo-deny` license / RustSec advisory gate |
| `/about.toml` | Attribution-page source |
| `/pyo3/Cargo.toml`, `/pyo3/pyproject.toml` | PyO3 sub-crate manifests
(pip dep flows through `pyproject.toml` per `go/pinning-python-deps`) |

Pre-existing coverage preserved: `.github/workflows/` +
`.github/CODEOWNERS` itself.

## Enforcement

These rules are enforced by the `protect-main` ruleset's
`require_code_owner_review` rule (already on). PRs touching any of the
paths above will auto-request review from
`@databricks/eng-oss-sql-driver` and cannot merge without it.

## File rewrite

Also rewrites the file with comments explaining:
- GitHub's last-match-wins semantics (so future editors don't get
tripped up reordering rules)
- Which ruleset enforces the rules
- Why each ownership row exists

No behavioural change to the existing two paths — purely additive.

## Test plan

- [ ] Confirm GitHub recognises the expanded file (PR's Reviewers
sidebar should auto-request `@databricks/eng-oss-sql-driver` since this
PR itself edits a CODEOWNERS-protected path).
- [ ] Touch a covered file (e.g. `Cargo.toml` in a follow-up PR) and
confirm the review-request fires.

## Related

- PR #37 — original CODEOWNERS (workflows + self).
- PR #41 — separate CI-hygiene batch (dependabot.yml addition, checkout
v6→v4 pin alignment). That PR will naturally interact with this one; the
rebase order depends on merge order.

This pull request and its description were written by Isaac.

Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
@gopalldb
gopalldb merged commit f87e0c7 into main May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants