Repository navigation
ci: push images in dev-images and release - #576
Conversation
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]>
Reviewer's GuideProtects 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 flowsequenceDiagram
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
File-Level Changes
Possibly linked issues
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 #576 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 7068 7068
=========================================
Hits 7068 7068
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 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.
Summary
Implements the maintainer's decision on #574, aligned with cloud-registry:
release.yml:pushruns in the environmentrelease(after approval) and pushes the release images by digest only, untagged;scanstays without environment and secrets and scans those digests;publish-imageruns inreleaseand attests, signs and only then tags them.ci.yml: the dev image jobspushandpublishrun in the environmentdev-images(branchdevonly; CI triggers only on pushes and pull requests todev, 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 inreleaseneed 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-imageneedspypi, unchanged).Closes #574
Verification
actionlint .github/workflows/*.yml: no findings.zizmor --offline .github/workflows/: 4 low findings (pre-existingself-repositoryhints inrelease-chart.yml), fewer suppressed findings than ondev.mkdocs build --strict: passes.pytest tests/test_repository.py tests/test_version_mentions.py tests/test_docs_hooks.py: 112 passed.release.ymlis not verified by CI; thedev-imagesjobs run on the next push todev.Declined review findings
${{ 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.publish-imageno longer neededpypi; 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:
dev-imagesenvironment for thedevbranch.releaseenvironment before pushing release images and publishing signed, attested image tags.Enhancements:
CI:
dev-imagesenvironment and release image jobs with thereleaseenvironment.Documentation: