Repository navigation
ci: publish in the environment release - #25
Conversation
Rename the GitHub environment of the PyPI job of release.yml from `pypi` to `release`. PyPI trusted publishing binds the environment name; the maintainer set up the environment and the trusted publishers. Comments and docs follow. Closes #22 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis light configuration-only change aligns the PyPI publishing workflow with the organization’s File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #25 +/- ##
=======================================
Coverage ? 100.00%
=======================================
Files ? 6
Lines ? 551
Branches ? 71
=======================================
Hits ? 551
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="169" />
<code_context>
timeout-minutes: 15
environment:
- name: pypi
+ name: release
url: https://pypi.org/project/${{ needs.build.outputs.name }}/${{ needs.build.outputs.version }}/
permissions:
</code_context>
<issue_to_address>
**Older release tags fail publishing**
When a release tag is pushed at a commit whose workflow still names `pypi`, after the PyPI publisher has been switched to trust only `release`, the workflow from that tagged commit still requests the `pypi` environment, while PyPI trusts the `release` environment, so trusted publishing fails and the release cannot complete.
Keep the old publisher/environment available until releases using older workflow commits are no longer possible, or ensure release tags are only created on commits containing this workflow change.
</issue_to_address>Linked issues
#22 ci: align the release job names · 3 of 5 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add a prepare job named “Prepare release” to hold the checks, and make the other jobs depend on it. |
❌ Not addressed | The workflow still puts the checks in build and has no prepare job. |
| 2 | Name registry-publishing jobs after what they release and make their names unique across workflows. | ❌ Not addressed | The PyPI job remains pypi / “Publish to PyPI”; this change only renames its environment. |
| 3 | Use publish / “Publish release” to create the GitHub release. |
✅ Met | The workflow already has a publish job named “Publish release” that creates the GitHub release. |
| 4 | Use the release environment for publishing and dev-images for CI pushes once the maintainer has renamed the environments. |
✅ Met | The PyPI publishing job now uses release; no CI-push jobs requiring dev-images are present in the workflows. |
| 5 | Keep required checks unaffected; the ruleset requires only CI passed. |
✅ Met | The change does not modify required-check configuration. |
Sourcery assessment
Needs a human reviewer. 1 finding to address first, and the publish job now requests an OIDC identity tied to the release GitHub environment instead of pypi, so the PyPI trust configuration and that environment’s protection rules determine who can upload packages. If those rules are weaker than intended, an unauthorized upload cannot be fully undone by reverting the workflow.
Blocking findings: .github/workflows/release.yml:169
Summary
Renames the GitHub environment of the PyPI job (
pypi) in.github/workflows/release.ymlfrompypitorelease, as decided for the org. The maintainer set up the environmentreleaseand registers the matching PyPI trusted publishers (workflowrelease.yml, environmentrelease).Comments and docs naming the environment follow: workflow header and job comments,
MAINTAINERS.md(PyPI setup, open items 3 and 4),docs/releasing.md. No test names the environment.Scope: the environment rename only. The release job-name alignment and the README image rewrite for PyPI move to follow-up issues; #22 is updated accordingly.
Closes #22
Lane
Light lane: changes only the environment name (a configuration value) plus comments and docs; no logic, secrets, permissions or job structure change. Reviewed the diff by hand:
environment.nameis exactlyrelease; the remainingpypimention in the workflow is the job ID.Verification
uv run pytest tests: 78 passedmkdocs build --strict(docs group, as CI): passedactionlint .github/workflows/release.yml: no findingsgit diff --check,ast-grep scan,semgrep scan --config .semgrep: no findingsDeclined review findings
None.
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Rename the PyPI publishing environment to
releaseand update all related documentation and comments.Enhancements:
releaseenvironment used for PyPI trusted publishing.Deployment:
pypitorelease.Documentation:
releaseenvironment.