Skip to content

ci: publish in the environment release - #25

Merged
uniqueg merged 1 commit into
devfrom
ci/release-environment
Oct 31, 2026
Merged

uniqueg merged 1 commit into
devfrom
ci/release-environment

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Renames the GitHub environment of the PyPI job (pypi) in .github/workflows/release.yml from pypi to release, as decided for the org. The maintainer set up the environment release and registers the matching PyPI trusted publishers (workflow release.yml, environment release).

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.name is exactly release; the remaining pypi mention in the workflow is the job ID.

Verification

  • uv run pytest tests: 78 passed
  • mkdocs build --strict (docs group, as CI): passed
  • actionlint .github/workflows/release.yml: no findings
  • git diff --check, ast-grep scan, semgrep scan --config .semgrep: no findings
  • CI: all checks passed (run 41215789674)

Declined review findings

None.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Rename the PyPI publishing environment to release and update all related documentation and comments.

Enhancements:

  • Align the GitHub release workflow and related maintainer and release documentation with the release environment used for PyPI trusted publishing.

Deployment:

  • Rename the PyPI publishing job's GitHub environment from pypi to release.

Documentation:

  • Update PyPI trusted-publisher setup and release guidance to reference the release environment.

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]>
@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This light configuration-only change aligns the PyPI publishing workflow with the organization’s release GitHub environment and updates related comments and documentation; no release logic, permissions, secrets, or job structure changed.

File-Level Changes

Change Details Files
Renamed the GitHub Actions environment used by the PyPI publishing job from pypi to release without changing release logic or job structure.
  • Updated environment.name to release while retaining the pypi job ID and all permissions, protections, and publishing behavior.
  • Updated workflow comments and maintainer/release documentation to describe the release environment and its PyPI trusted-publisher configuration.
.github/workflows/release.yml
MAINTAINERS.md
docs/releasing.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dev@01e178d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             dev       #25   +/-   ##
=======================================
  Coverage       ?   100.00%           
=======================================
  Files          ?         6           
  Lines          ?       551           
  Branches       ?        71           
=======================================
  Hits           ?       551           
  Misses         ?         0           
  Partials       ?         0           
Flag Coverage Δ
foca-plugin-generic-example-noop 100.00% <ø> (?)
foca-plugin-generic-routing-random 100.00% <ø> (?)
foca-plugin-tes-routing-distance 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 31, 2026 15:45

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/release.yml Resolved
@uniqueg
uniqueg merged commit 2fd28d3 into dev Oct 31, 2026
35 checks passed
@uniqueg
uniqueg deleted the ci/release-environment branch October 31, 2026 16:00
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.

ci: publish in the environment release

1 participant