Configure JFrog Artifactory as PyPI proxy for hardened runners#1379
Open
mihaimitrea-db wants to merge 12 commits intomainfrom
Open
Configure JFrog Artifactory as PyPI proxy for hardened runners#1379mihaimitrea-db wants to merge 12 commits intomainfrom
mihaimitrea-db wants to merge 12 commits intomainfrom
Conversation
Hardened GitHub Actions runners block direct access to public registries. This adds OIDC-based authentication to JFrog Artifactory and routes all uv package downloads through the db-pypi proxy. A `make fix-lockfile` target prevents proxy URLs from leaking into the committed lockfile.
The JFrog proxy URL structure has /packages/packages/ (the proxy path plus the original PyPI path), so the sed replacement must map db-pypi/packages to files.pythonhosted.org (without /packages suffix). Also, uv lock through JFrog drops size/upload-time metadata from the lockfile. Restore committed lockfiles with git checkout before the diff check so only formatting changes and accidentally committed proxy URLs are caught.
The tagging workflow used setup-uv v4.2.0 without a version pin, installing whatever uv release was latest. Align it with the rest of the workflows: setup-uv v7.3.0 pinned to uv 0.6.5.
tagging.yml is generated from the Universe codegen template and is not in the critical path for unblocking unit tests. The uv version pin and JFrog setup need to be upstreamed to the genkit sync template instead.
Release workflows need special publish runners and coordination with the security team per the migration guide. Keep this PR focused on unblocking CI (tests, fmt, check-manifest).
Remove uv lock from CI and use uv sync --frozen instead of --locked. If the hardened runners transparently route files.pythonhosted.org through the JFrog proxy, downloads from lockfile URLs should work without rewriting them.
uv run without --frozen triggers auto-sync, which re-locks the lockfile with JFrog URLs and drops size/upload-time metadata. Pass --frozen to all uv run calls since we already synced the environment explicitly.
Add UV_SYNC_FLAGS and UV_RUN_FLAGS variables to the Makefile so CI can pass --frozen without duplicating commands. Local dev defaults remain unchanged (--locked for sync, no flags for run).
Set UV_FROZEN=1 in the composite action so uv natively skips lockfile re-resolution on all commands. This lets workflows call make dev test and make dev fmt unchanged -- no Makefile modifications needed beyond the new fix-lockfile target.
Replace the manual OIDC token exchange (~20 lines of curl/jq) with the jfrog/setup-jfrog-cli action, which handles OIDC internally and exposes the token via step outputs. Same action + SHA as the CLI repo (PR #4875).
uv rejects --locked and --frozen together. Add UV_LOCK_FLAG variable (defaults to --locked) that the composite action clears via env var, letting UV_FROZEN=1 handle lockfile behavior in CI instead.
Run uv lock after JFrog setup to rewrite the lockfile with JFrog URLs (same versions, different registry). This lets make dev test and make dev fmt work unchanged with --locked. In fmt, restore committed lockfiles before the diff check so only formatting issues and accidentally committed proxy URLs are caught.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Open
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pypiproxy.Uses the same
jfrog/setup-jfrog-cliaction as CLI PR #4875.What changed
.github/actions/setup-jfrog-pypi/action.yml): Usesjfrog/setup-jfrog-clifor OIDC authentication (same action + SHA as the CLI repo), then setsUV_INDEX_URLusing the token from the action'soidc-token/oidc-useroutputs.test.yml: Addedid-token: writepermissions, JFrog setup step, anduv lockbeforemake dev test.push.yml: Added workflow-levelid-token: writepermissions (needed forworkflow_calltotest.yml). Added JFrog setup +uv locktofmtandcheck-manifestjobs.Makefile: Addedfix-lockfiletarget. All existing targets are unchanged.How it works
uv.lockstores full registry URLs per package. SettingUV_INDEX_URLto JFrog causesuv sync --lockedto fail (stale lockfile). To work around this, CI runsuv lockafter JFrog setup, which rewrites the lockfile with JFrog URLs while keeping the same versions. Thenmake dev test/make dev fmtwork unchanged with--locked. The lockfile rewrite is ephemeral (never committed).In the
fmtjob,git checkout -- '*.lock'restores the committed lockfile after formatting, thenmake fix-lockfilenormalizes any accidentally committed proxy URLs.git diff --exit-codecatches both unformatted code and dirty lockfiles.make fix-lockfileReplaces JFrog proxy URLs with their public PyPI equivalents in all
*.lockfiles. Prevents proxy URLs from being accidentally committed to the repo.When to use it: If you run
uv lockwhileUV_INDEX_URLpoints to JFrog (e.g. after sourcing CI env vars), runmake fix-lockfilebefore committing to normalize URLs back to public PyPI.CI enforcement: The
fmtjob runs this beforegit 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.Trigger TestsCI failure: Pre-existing IP allowlist issue (DECO-26816).NO_CHANGELOG=true