Commit b16b649
authored
Configure JFrog Artifactory as PyPI proxy for hardened runners (#1379)
## Summary
Hardened GitHub Actions runners block direct access to public registries
(PyPI, files.pythonhosted.org). This adds OIDC-based JFrog Artifactory
authentication so CI can download Python packages through the `db-pypi`
proxy.
Uses the same `jfrog/setup-jfrog-cli` action as [CLI PR
#4875](databricks/cli#4875).
## What changed
- **New composite action**
(`.github/actions/setup-jfrog-pypi/action.yml`): Uses
`jfrog/setup-jfrog-cli` for OIDC authentication (same action + SHA as
the CLI repo), then sets `UV_INDEX_URL` using the token from the
action's `oidc-token`/`oidc-user` outputs.
- **`test.yml`**: Added `id-token: write` permissions, JFrog setup step,
and `uv lock` before `make dev test`.
- **`push.yml`**: Added workflow-level `id-token: write` permissions
(needed for `workflow_call` to `test.yml`). Added JFrog setup + `uv
lock` to `fmt` and `check-manifest` jobs.
- **`Makefile`**: Added `fix-lockfile` target. All existing targets are
unchanged.
## How it works
`uv.lock` stores full registry URLs per package. Setting `UV_INDEX_URL`
to JFrog causes `uv sync --locked` to fail (stale lockfile). To work
around this, CI runs `uv lock` after JFrog setup, which rewrites the
lockfile with JFrog URLs while keeping the same versions. Then `make dev
test` / `make dev fmt` work unchanged with `--locked`. The lockfile
rewrite is ephemeral (never committed).
In the `fmt` job, `git checkout -- '*.lock'` restores the committed
lockfile after formatting, then `make fix-lockfile` normalizes any
accidentally committed proxy URLs. `git diff --exit-code` catches both
unformatted code and dirty lockfiles.
## `make fix-lockfile`
Replaces JFrog proxy URLs with their public PyPI equivalents in all
`*.lock` files. Prevents proxy URLs from being accidentally committed to
the repo.
**When to use it**: If you run `uv lock` while `UV_INDEX_URL` points to
JFrog (e.g. after sourcing CI env vars), run `make fix-lockfile` before
committing to normalize URLs back to public PyPI.
**CI enforcement**: The `fmt` job runs this before `git diff
--exit-code`, so committed proxy URLs fail CI.
## Out of scope
- **`tagging.yml`**: Generated from the Universe codegen template
(`openapi/genkit/sync/workflows/tagging.yml`). JFrog setup needs to be
upstreamed there.
- **`release.yml` / `release-test.yml`**: Need special publish runners
per the migration guide. Separate follow-up with the security team.
- **Runner migration**: Switching to hardened runner labels can be done
as a follow-up.
- **`Trigger Tests` CI failure**: Pre-existing IP allowlist issue
(DECO-26816).
NO_CHANGELOG=true1 parent 78914fa commit b16b649
4 files changed
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
42 | 52 | | |
43 | 53 | | |
44 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
| |||
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
0 commit comments