Skip to content

ci: push images in dev-images and release - #576

Merged
uniqueg merged 1 commit into
devfrom
ci/574-image-environments
Oct 31, 2026
Merged

uniqueg merged 1 commit into
devfrom
ci/574-image-environments

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements the maintainer's decision on #574, aligned with cloud-registry:

  • release.yml: push runs in the environment release (after approval) and pushes the release images by digest only, untagged; scan stays without environment and secrets and scans those digests; publish-image runs in release and attests, signs and only then tags them.
  • ci.yml: the dev image jobs push and publish run in the environment dev-images (branch dev only; CI triggers only on pushes and pull requests to dev, so nothing is blocked).
  • docs/contributing.md ("Versioning and releases"): the environments, the three approvals of a release (push, PyPI, publish images; one approval covers all matrix jobs), that re-runs of jobs in release need a new approval, that both environments must exist with their rules first, and that the environments gate the jobs, not the Docker Hub secrets (organization secrets).

A release now needs three approvals, in this order: pushing the images, publishing to PyPI (after the scan) and publishing the images (publish-image needs pypi, unchanged).

Closes #574

Verification

  • actionlint .github/workflows/*.yml: no findings.
  • zizmor --offline .github/workflows/: 4 low findings (pre-existing self-repository hints in release-chart.yml), fewer suppressed findings than on dev.
  • mkdocs build --strict: passes.
  • pytest tests/test_repository.py tests/test_version_mentions.py tests/test_docs_hooks.py: 112 passed.
  • The release jobs only run on tags, so the approval flow of release.yml is not verified by CI; the dev-images jobs run on the next push to dev.
  • CI: all checks passed (CI passed, Read the Docs, Codecov).

Declined review findings

  • Release concurrency group is ${{ github.workflow }} (one release at a time), unlike cloud-registry's per-tag group; a third tag pushed while one run waits for approval and another is queued replaces the queued run. Pre-existing and a separate design choice, not part of ci: push images in the environments dev-images and release #574.
  • One approval fewer would be possible if publish-image no longer needed pypi; kept, as the order PyPI-before-images is unchanged and outside the decision.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Protect development and release image publication with GitHub environment controls and document the resulting approval workflow.

New Features:

  • Gate development image pushing and publishing behind the dev-images environment for the dev branch.
  • Require approval through the release environment before pushing release images and publishing signed, attested image tags.

Enhancements:

  • Separate release image pushing, scanning, PyPI publication, and image publication into an approval-controlled release flow while keeping scans free of release credentials.
  • Document release and development image environment requirements, approval order, branch and tag rules, and re-approval behavior.

CI:

  • Protect development image jobs with the dev-images environment and release image jobs with the release environment.

Documentation:

  • Update contributing guidance to describe the three-stage release approval process and required GitHub environment configuration.

Run the CI image jobs push and publish in the environment dev-images
and the release image jobs push and publish-image in the environment
release, as in cloud-registry: the release images are pushed by digest
only after approval, scanned without credentials or signing identity,
and attested, signed and tagged after another approval. Document the
environments and approvals in docs/contributing.md.

Closes #574

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg added this to the v0.20.0 milestone Oct 31, 2026
@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Protects dev and release image workflows with GitHub environments, ensuring release images are pushed only after approval, scanned without release credentials, and attested, signed, and tagged only after subsequent approvals; contributor documentation now explains the required environment rules and approval flow.

Sequence diagram for the protected release image flow

sequenceDiagram
    participant Release as release workflow
    participant Approval as release environment
    participant Registry as Docker Hub
    participant Scan as scan jobs
    participant PyPI as PyPI
    participant Publish as publish-image

    Release->>Approval: push approval
    Approval-->>Release: approved
    Release->>Registry: push image by digest
    Release->>Scan: scan pushed digest
    Scan-->>Release: scan result
    Release->>Approval: pypi approval
    Approval-->>Release: approved
    Release->>PyPI: publish distributions
    Release->>Approval: publish-image approval
    Approval-->>Release: approved
    Publish->>Registry: attest and sign digest
    Publish->>Registry: tag signed digest
Loading

File-Level Changes

Change Details Files
Gate development image publishing behind the dedicated branch-restricted environment.
  • Assign the dev image push job to the dev-images environment.
  • Assign the dev image publish job to the dev-images environment.
  • Rely on environment rules to restrict these jobs to the dev branch.
.github/workflows/ci.yml
Rework release image publishing so credentials and signing are protected by approval stages while scans remain isolated.
  • Move release digest pushes behind required approval in the release environment.
  • Keep image scanning outside the environment without release credentials or signing identity.
  • Gate final attestation, signing, and tagging behind a second release approval after scanning and PyPI publication.
  • Document the staged push, scan, PyPI, and publish-image workflow and matrix approval behavior.
.github/workflows/release.yml
Document environment setup, approval sequencing, and rerun/secret-gating behavior for maintainers.
  • Describe the three required release approvals and their order.
  • Document release tag rules, dev-images branch rules, and the need to configure both environments before use.
  • Clarify that environments gate jobs rather than organization-level Docker Hub secrets.
  • Explain that rerunning release-environment jobs requires renewed approval.
docs/contributing.md

Possibly linked issues


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.
✅ Project coverage is 100.00%. Comparing base (04eebb1) to head (2e11f7b).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #576   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         7068      7068           
=========================================
  Hits          7068      7068           
Flag Coverage Δ
test_unit 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 18:03

@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 reviewed your changes and they look great!

Linked issues

#574 ci: push images in the environments dev-images and release · 5 of 5 met

# Requirement Status Notes
1 Run the CI image jobs push and publish in the dev-images environment. ✅ Met Both jobs in ci.yml declare environment: dev-images.
2 Keep CI limited to pushes and pull requests to dev, without adding a tag trigger. ✅ Met The existing ci.yml triggers remain limited to branches: [dev] for push and pull_request.
3 Run the release image jobs push and publish-image in the release environment, deciding whether push also waits for approval. ✅ Met Both jobs declare environment: release; the push job comment says it waits for required reviewer approval.
4 Keep Docker Hub credentials as organization-level secrets; do not move them. ✅ Met The documentation identifies DOCKERHUB_LOGIN and DOCKERHUB_TOKEN as organization secrets.
5 Update workflow comments and docs/contributing.md to describe the environments. ✅ Met Workflow comments describe the environment gates, and the contributing guide documents the environments and approval flow.

Sourcery assessment

Needs a human reviewer. A release approval now gates pushing and signing/tagging container images. If an image is published incorrectly, reverting the workflow will not retract copies already pulled or reliably undo the published release tags.


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

@uniqueg
uniqueg merged commit c9310e8 into dev Oct 31, 2026
31 checks passed
@uniqueg
uniqueg deleted the ci/574-image-environments branch October 31, 2026 18:12
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: push images in the environments dev-images and release

1 participant