Skip to content

ci: notify Pubgrade in the release environment - #121

Merged
uniqueg merged 2 commits into
devfrom
ci/pubgrade-release-environment
Nov 9, 2026
Merged

uniqueg merged 2 commits into
devfrom
ci/pubgrade-release-environment

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

The job Notify Pubgrade of the release workflow named the environment pubgrade, which no longer exists; the next release would have created it again, without protection rules and without the settings.

  • notify runs in the release environment, like push and publish; the token PUBGRADE_TOKEN is a secret there.
  • The job runs only if the variable PUBGRADE_URL is set for the repository (if: vars.PUBGRADE_URL != ''). Variables of an environment aren't visible to a job's if:, which is evaluated before the job enters the environment. The alternative, a check in the first step, would make every release without Pubgrade wait for an approval in release for a job that then does nothing (and leave the run waiting if nobody approves). With the job-level condition, releases without Pubgrade skip the job cleanly; with Pubgrade, the job waits for an approval like the other release jobs.
  • The step fails if PUBGRADE_URL is set but PUBGRADE_REPOSITORY_ID or PUBGRADE_TOKEN is missing (before, a partial configuration also failed; a missing configuration did nothing).
  • docs/development.md says which settings go where: PUBGRADE_URL as a repository variable (in the environment it doesn't switch the job on; an organization variable would switch it on for every repository it is shared with), PUBGRADE_REPOSITORY_ID as a repository or release environment variable, PUBGRADE_TOKEN as a secret of the release environment. They also say that a failed or rejected notification leaves the release published (re-run the job, no new version), and that settings of the former pubgrade environment must be moved. The header comment of the workflow now points to that section instead of a "Releasing" section of the README that doesn't exist.

No change to permissions (the job keeps permissions: {}) or to which secrets exist. As it changes the release workflow, it gets the full review (adversarial and quality reviewer), not the light lane.

Closes #120

Verification

  • actionlint 1.7.7 (the image and digest of CI's lint job): no findings.
  • mkdocs build --strict: passes.
  • CI on 0a994e9 (run 42515212265): all jobs passed (Lint, Test, Docs, Smoke test, Scan image, CI passed; Push image and Publish image skipped as intended on PRs). Two more runs on the same commit were started by body edits; one of them was cancelled by the concurrency group, so its gate reported a failure, which the newer run's passing gate replaces.

Review: adversarial and quality reviewer, two rounds. Round 1: no high findings; the two medium ones (unwrapped header line, organization-level variable) were fixed along with the low ones, which were docs only. Round 2 (both reviewers, on 0a994e9): no high or medium findings.

Declined review findings

  • Round 2, quality, low: the sentence that the release environment only allows version tags might not hold. Declined: the environment is configured with the deployment tag rule v*.
  • Round 2, quality, low: say "if PUBGRADE_URL is set" instead of "if Pubgrade is configured" in the workflow header. Declined: the comment of notify and docs/development.md define it right there.

🤖 Generated with Claude Code

Summary by Sourcery

Align Pubgrade release notifications with the protected release environment and make their configuration and execution behavior explicit.

Bug Fixes:

  • Run Pubgrade notifications in the existing protected release environment instead of recreating the obsolete pubgrade environment.
  • Skip Pubgrade notification jobs when no repository-level PUBGRADE_URL is configured, while failing clearly on incomplete Pubgrade settings.

Enhancements:

  • Document Pubgrade configuration locations, approval behavior, release recovery, and migration from the former environment.
  • Update release workflow guidance to reference the versioning and releases documentation.

Documentation:

  • Clarify release environment approvals and Pubgrade setup in the development documentation.

The job Notify Pubgrade named the environment pubgrade, which no
longer exists; a release would have created it again, unprotected and
without the settings. Run it in the release environment, like the other
release jobs, with the token as a secret there.

Skip the job unless the variable PUBGRADE_URL is set for the
repository or the organization: a job's if: can't see environment
variables, and a check in a step would make every release without
Pubgrade wait for an approval of a job that does nothing. The step
fails if PUBGRADE_REPOSITORY_ID or PUBGRADE_TOKEN is missing.

Document where to set the three settings.

Refs #120

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg added this to the v1.2.0 milestone Nov 8, 2026
@uniqueg uniqueg added type: bug Something isn't working github_actions labels Nov 8, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Run Pubgrade notifications in the protected release environment, skip them unless PUBGRADE_URL is set, and fail clearly when the repository ID or token is missing.

  • .github/workflows/release.yml L311-327, L339-340

Documentation

Document the Pubgrade settings’ locations and the notification job’s skip, approval, and failure behavior, and clarify release approvals.

  • .github/workflows/release.yml L9-17, L311 (removed lines)
  • docs/development.md L144-147, L154-173

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 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.00%. Comparing base (59f242d) to head (0a994e9).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #121   +/-   ##
=======================================
  Coverage   65.00%   65.00%           
=======================================
  Files          66       66           
  Lines        2626     2626           
  Branches      272      272           
=======================================
  Hits         1707     1707           
  Misses        769      769           
  Partials      150      150           

☔ 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.

Recommend PUBGRADE_URL as a repository variable: in the release
environment it doesn't switch the job on, and an organization variable
would switch it on for all repositories it is shared with. Say that a
failed or rejected notification leaves the release published, that the
settings of the former pubgrade environment must be moved, and rewrap
the workflow's header comment.

Refs #120

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg added type: ci / cd Related to continuous integration / delivery and removed github_actions labels Nov 8, 2026
@uniqueg
uniqueg marked this pull request as ready for review November 9, 2026 00:44

@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

#120 Run the Pubgrade notification in the release environment · 2 of 3 met

# Requirement Status Notes
1 Run the Pubgrade notification job in the release environment. ✅ Met The notify job now uses environment: release.
2 Skip the job's steps cleanly when the Pubgrade settings aren't set. 🟡 Partly met The job is skipped when PUBGRADE_URL is unset, but the step fails when the URL is set and PUBGRADE_REPOSITORY_ID or PUBGRADE_TOKEN is missing.
3 Document which Pubgrade variables and secret to set in the release docs. ✅ Met The docs identify each setting and where to set it.

Sourcery assessment

Needs a human reviewer. Setting the repository-level URL activates a token-backed POST to Pubgrade, which can notify subscribed deployments; a mistakenly enabled or misdirected notification cannot be recalled. Reverting stops future notifications, but it cannot undo one already sent.


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

@uniqueg
uniqueg merged commit 3880cbf into dev Nov 9, 2026
44 of 52 checks passed
@uniqueg
uniqueg deleted the ci/pubgrade-release-environment branch November 9, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working type: ci / cd Related to continuous integration / delivery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the Pubgrade notification in the release environment

1 participant