Repository navigation
ci: approve library chart releases - #520
Conversation
Run the job that pushes, attests and signs foca-common in the protected environment `chart-release`, after the chart tests and the kind installation, so that a maintainer approves a tested chart before anything irreversible is published. Document the approval and the environment's settings in the chart's release docs and the contributing guide. Closes #449 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the tag and version checks into the test job, so that the maintainer approves a run whose tag is already known to be signed, on dev and matching the chart's version. The check that the version is not published yet stays right before the push. Note in the docs that a re-run of the publishing job needs a new approval. Refs #449 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #449 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR gates foca-common chart publication behind maintainer approval by moving all tag and chart validation into the existing test job, passing its validated version to the protected publish job, and documenting the required chart-release environment and rerun behavior. Flow diagram for the approved chart releaseflowchart LR
Tag["chart-vX.Y.Z tag"] --> Test[test job]
Test --> Checks["Tag and chart checks"]
Checks --> Version["Validated version output"]
Version --> Publish[publish job]
Publish --> Approval["chart-release environment approval"]
Approval --> Unpublished["Version not published"]
Unpublished --> Package["Package, push, attest, and sign"]
File-Level Changes
Assessment against linked issues
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 #520 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 55 55
Lines 6611 6611
=========================================
Hits 6611 6611
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-chart.yml" line_range="109-110" />
<code_context>
+ needs: test
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ environment:
+ name: chart-release
+ url: https://github.com/elixir-cloud-aai/foca/pkgs/container/charts%2Ffoca-common
+ permissions:
</code_context>
<issue_to_address>
**Chart publishes without approval**
When the chart-release environment is absent or lacks a required reviewer or chart-tag restriction when a chart tag triggers the workflow, the `publish` job proceeds without verifying environment protections; GitHub creates a missing environment without protection rules, so the chart is published, attested, and signed without maintainer approval.
Provision the `chart-release` environment with a required reviewer and a `chart-v*` tag restriction before chart tags trigger the workflow.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: .github/workflows/release-chart.yml:110
Summary
Releases of the library chart
foca-commonnow wait for a maintainer's approval before anything is published, as FOCA's own releases do with thepypienvironment.release-chart.yml:publish(package, push, attest and sign) runs in the environmentchart-release, aftertest. The tag and version checks (signed annotated tag of the checked-out commit, ondev, matchingversion) moved frompublishto the start oftest. The maintainer therefore approves a run whose tag and chart have passed all checks. The check that the version is not yet published stays inpublish, right before the push.publishreads the version fromneeds.test.outputs.version.urlpoints to the chart's package page.docs/helm-chart.mddescribes the new order and the environment, and says that a re-run of the publishing job needs a new approval. It also says that the environment must exist before the workflow first runs. The release section ofdocs/contributing.mdmentions the approval.The tag ruleset and the existing checks are unchanged. Job IDs and names are unchanged, so no required checks are affected.
Closes #449
Repository settings (maintainer, before merging)
The environment must exist before the next
chart-v*tag is pushed. Otherwise GitHub creates it on first use without protection rules.Settings → Environments → New environment
chart-release:pypireleases.chart-v*.pypi: "Prevent self-review" and turning off "Allow administrators to bypass configured protection rules". With the defaults, the admin who pushes the tag (only admins can) may approve their own run.Verification
actionlint .github/workflows/release-chart.yml: no findings.zizmor --offline .github/workflows/release-chart.yml: the same 2 lowself-repositoryfindings as ondev, none new.pre-commit run --files <changed files>: passed (check-yaml, whitespace, semgrep).mkdocs build --strict: passed.pytest tests/test_docs_hooks.py: 27 passed.yq) against the existing tagchart-v0.2.0at its commit, with read-only API calls: passed and wroteversion=0.2.0. With a mismatched tag (chart-v0.1.0at that commit) it failed as expected.needsoutputs on "Re-run failed jobs"). This needs the environment and a chart tag. A dry run in a fork could cover it. I did not check whether the environment already exists, because reading the repo's environments was not permitted.CI passed, Chart, Chart install, Lint, tests, scans, CodeQL, Read the Docs).Declined review findings
url404s before the first release: the package already exists (chart-v0.1.0andchart-v0.2.0are released) and is linked to this repo. The URL returns 200.testto reflect that it now also runs the tag checks: kept so that job IDs and names stay stable (CI naming rules, no check churn). The job comment documents the contract.dev, version) differs from the order in the script: no behavioural effect.pypienvironment don't prescribe it either.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Gate library chart publication on successful validation and maintainer approval through a protected GitHub Actions environment.
New Features:
chart-releaseenvironment before publishing library chart releases.Enhancements:
Deployment:
chart-releaseenvironment and link it to the published package.Documentation: