Skip to content

ci: release only commits whose CI passed - #591

Merged
uniqueg merged 2 commits into
devfrom
ci/release-check-ci
Nov 1, 2026
Merged

uniqueg merged 2 commits into
devfrom
ci/release-check-ci

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

release.yml (job prepare, "Prepare release") and release-chart.yml (job test, "Test chart release") now fail unless a successful run of ci.yml exists for a push of the tagged commit. The step, API query and error text are those of the other repos' release workflows (step "Check that CI passed for the release commit"); the jobs get actions: read at job level only. Every publishing job already depends on prepare (push, release-image, transitively scan, pypi, publish) or test (publish in the chart workflow). Docs updated (docs/contributing/index.md, docs/helm-chart.md).

Closes #590

Verification

  • actionlint and zizmor --offline on the workflows: no new findings (pre-existing SC2102 info in ci.yml and zizmor lows are unrelated).
  • The repo has no tests for its workflows; the workflow cannot run before a tag, so the step is verified by review only (same query as the reference repos).
  • Not run: the release workflows themselves (need a tag).

Lane

Regular lane (release workflows): adversarial and quality review, one round. No high or medium findings; later fixes were comments and docs only.

Declined review findings

  • Move the step into a composite action (duplicated in two workflows, quality review, medium): declined, the step is ten lines, and the reference repos inline it; a shared action would add indirection for the release workflows.
  • Rename REPOSITORY to GH_REPO: declined, the reference repos use REPOSITORY.
  • Retry or || true around the API call: not added; a transient API error fails safely and a re-run fixes it.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Gate library and Helm chart releases on successful CI for the tagged commit.

Bug Fixes:

  • Require release workflows to verify that the tagged commit has a successful push-triggered CI run before publishing releases.

Enhancements:

  • Grant release jobs read-only access to workflow runs and document the CI prerequisite for library and Helm chart releases.

CI:

  • Add CI status checks to library and chart release workflows, failing releases until the tagged commit’s CI has passed.

Documentation:

  • Update release documentation to explain the required successful CI run and rerun guidance.

uniqueg and others added 2 commits November 1, 2026 21:23
The release workflows now fail in their first job unless a successful run of ci.yml exists for a push of the tagged commit, so nothing is published for a commit whose CI failed or never ran. The error says to re-run the workflow once CI passed. Docs updated.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Release preparation and chart testing now verify through the GitHub Actions API that a push-triggered ci.yml run succeeded for the tagged commit, with narrowly scoped workflow-read permissions; all downstream publishing remains gated, and contributor documentation describes the prerequisite and rerun behavior.

Sequence diagram for CI-gated release publishing

sequenceDiagram
    actor Maintainer
    participant ReleaseWorkflow
    participant GitHubActionsAPI
    participant PublishJobs

    Maintainer->>ReleaseWorkflow: Push release tag
    ReleaseWorkflow->>GitHubActionsAPI: gh api actions/workflows/ci.yml/runs
    GitHubActionsAPI-->>ReleaseWorkflow: Successful push run for GITHUB_SHA
    alt CI run exists
        ReleaseWorkflow->>PublishJobs: Allow downstream release jobs
        PublishJobs-->>Maintainer: Publish release artifacts
    else CI missing or still running
        ReleaseWorkflow-->>Maintainer: Fail and request workflow rerun
    end
Loading

File-Level Changes

Change Details Files
Gate both release workflows on a successful push-triggered CI run for the tagged commit.
  • Add an inline GitHub API check that queries successful ci.yml runs by commit SHA and push event.
  • Fail the release job while CI is running or absent, with instructions to rerun after CI succeeds.
  • Place the check in the prerequisite jobs so all publishing jobs are transitively gated.
.github/workflows/release.yml
.github/workflows/release-chart.yml
Grant minimal workflow-run read access to the release prerequisite jobs.
  • Add job-level actions: read permission alongside contents: read.
.github/workflows/release.yml
.github/workflows/release-chart.yml
Document the new successful-CI prerequisite for library and Helm chart releases.
  • Explain that CI must pass for a push of the tagged commit before rerunning the release workflow.
  • Clarify the relevant branch and failure behavior.
docs/contributing/index.md
docs/helm-chart.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 Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f68171e) to head (c8042cc).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #591   +/-   ##
=========================================
  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 November 1, 2026 20:37

@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

#590 ci: release only commits whose CI passed · 5 of 5 met

# Requirement Status Notes
1 Require a successful ci.yml run for a push of the tagged commit before release. ✅ Met Both release workflows query for a successful push-triggered CI run matching GITHUB_SHA and fail if none exists.
2 Tell maintainers to rerun the release workflow once CI has passed. ✅ Met Both checks emit an error instructing maintainers to rerun the workflow once CI passed.
3 Gate every publishing job on the CI check. ✅ Met The package release's publishing jobs depend directly or transitively on prepare; chart publishing depends on test, which runs the check.
4 Add workflow tests where the repository tests workflows. ✅ Met The repository has no workflow tests; its existing tests cover citation handling.
5 Update the release documentation. ✅ Met The contributing and Helm chart release docs describe the CI prerequisite and rerun behavior.

Sourcery assessment

Approved.


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

@uniqueg
uniqueg merged commit 5a9abdb into dev Nov 1, 2026
80 checks passed
@uniqueg
uniqueg deleted the ci/release-check-ci branch November 1, 2026 20:46
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: release only commits whose CI passed

1 participant