Harden CI: Artifactory OIDC, uv, PyPI Trusted Publishing - #535
Merged
Conversation
- Add Artifactory OIDC composite action for build-time dep resolution - Replace main.yml + tests.yml with fork-aware ci.yml (uv, SHA-pinned) - Add deploy.yml: PyPI Trusted Publishing, PEP 740 attestations, no stored tokens - Migrate setup.py to pyproject.toml (hatchling) + uv.lock - Update devbox.json to use uv - Update e2e-tests.yml: remove E2E_TESTS_TOKEN, SHA-pin actions, fork-aware
didiergarcia
previously approved these changes
Jul 10, 2026
…usted publishing - Rename workflow file to publish.yml (matches trusted publisher config) - Rename workflow to Publish (PyPI matches on workflow filename) - Switch environment: pypi -> production (matches trusted publisher config) - Use twine --trusted-publishing=always instead of API token
… curation age blocks on fresh deps
…backend uv sync/build --no-build-isolation requires the build backend to already be importable inside the venv. Since hatchling was only pip-installed into the system Python (not the venv uv creates), the editable install failed with ModuleNotFoundError. Letting uv handle build isolation naturally resolves hatchling from the configured index. Also unpins uv in publish.yml to match ci.yml (commit 4f058b3).
The OAuth manager uses RS256 (via PyJWT), which requires the cryptography package. Without the [crypto] extra, PyJWT can't find the algorithm and all OAuth tests fail.
Set line-length = 140 to match existing code style. Fix F841 (unused variable) in test_oauth.py and suppress F821 (__path__ reference in legacy test discovery). Auto-fix import sorting and apply ruff format across the codebase.
The all-checks job was stuck waiting for a runner because it used ubuntu-latest while the org only has ubuntu-x64 runners available. Apply the same fork-aware runner selection as other jobs.
didiergarcia
self-requested a review
August 11, 2026 17:36
didiergarcia
approved these changes
Aug 11, 2026
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
.github/actions/artifactory-oidc/composite action — exchanges GitHub OIDC token for short-lived Artifactory access token, configuresUV_INDEX_URL/PIP_INDEX_URLforvirtual-pypi-thirdpartymain.yml+tests.ymlwithci.yml— fork-aware runner selection, Artifactory resolution on same-repo PRs, SHA-pinned actions, uv-based test matrix (Python 3.9–3.13)deploy.yml— PyPI Trusted Publishing (OIDC, no stored token), PEP 740 attestations, gated behindenvironment: pypisetup.py→pyproject.toml(hatchling) +uv.lockdevbox.jsonto use uve2e-tests.yml— removeE2E_TESTS_TOKEN(sdk-e2e-tests going public), SHA-pin actions, fork-awareTest plan
ubuntu-latest, public PyPI)uv sync --frozenpasses against committeduv.locksegmentio/analytics-python, workflow:deploy.yml, environment:pypi)pypiGitHub environment with protection rulesARTIFACTORY_URLrepository variable