Repository navigation
ci: notify Pubgrade in the release environment - #121
Conversation
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]>
Reviewer's GuideConfigurationRun Pubgrade notifications in the protected
DocumentationDocument the Pubgrade settings’ locations and the notification job’s skip, approval, and failure behavior, and clarify release approvals.
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 #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. 🚀 New features to boost your workflow:
|
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]>
There was a problem hiding this comment.
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.
Summary
The job
Notify Pubgradeof the release workflow named the environmentpubgrade, which no longer exists; the next release would have created it again, without protection rules and without the settings.notifyruns in thereleaseenvironment, likepushandpublish; the tokenPUBGRADE_TOKENis a secret there.PUBGRADE_URLis set for the repository (if: vars.PUBGRADE_URL != ''). Variables of an environment aren't visible to a job'sif:, 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 inreleasefor 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.PUBGRADE_URLis set butPUBGRADE_REPOSITORY_IDorPUBGRADE_TOKENis missing (before, a partial configuration also failed; a missing configuration did nothing).docs/development.mdsays which settings go where:PUBGRADE_URLas 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_IDas a repository orreleaseenvironment variable,PUBGRADE_TOKENas a secret of thereleaseenvironment. 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 formerpubgradeenvironment 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
actionlint1.7.7 (the image and digest of CI's lint job): no findings.mkdocs build --strict: passes.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
releaseenvironment only allows version tags might not hold. Declined: the environment is configured with the deployment tag rulev*.PUBGRADE_URLis set" instead of "if Pubgrade is configured" in the workflow header. Declined: the comment ofnotifyanddocs/development.mddefine 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:
releaseenvironment instead of recreating the obsoletepubgradeenvironment.PUBGRADE_URLis configured, while failing clearly on incomplete Pubgrade settings.Enhancements:
Documentation: