Skip to content

ci: notify Pubgrade only once registered - #157

Merged
uniqueg merged 1 commit into
devfrom
ci/156-notify-gate
Dec 2, 2026
Merged

uniqueg merged 1 commit into
devfrom
ci/156-notify-gate

Conversation

@uniqueg

@uniqueg uniqueg commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The release job Notify Pubgrade runs only when both vars.PUBGRADE_URL (organization variable) and the repository variable vars.PUBGRADE_REPOSITORY_ID are set: the same expression as ci: notify Pubgrade only once registered tesk-api#242 and ci: notify Pubgrade of released images drs-filer#141. PUBGRADE_URL alone gates nothing, because it is an organization variable.
  • CI's Lint job has a new step, Check Pubgrade condition, that pins this condition with yq (as in tesk-api#242).
  • "Versioning and releases" in docs/development.md says where each setting goes, that PUBGRADE_REPOSITORY_ID switches the job on, and that an identifier set only in the release environment now leaves the job skipped (up to 0.3.1, PUBGRADE_URL alone switched it on).
  • The caller example in "Notify Pubgrade from CI" (docs/usage.md) uses the same condition, and says to put it on the job when the job needs an environment approval, so that other repositories copy the two-variable gate.

Pubgrade is registered at its own instance: PUBGRADE_REPOSITORY_ID is a repository variable (gh variable list), so releases keep notifying Pubgrade.

Closes #156

Verification

  • The body of the new lint step fails on the release.yml of origin/dev and passes on this branch (run locally with yq v4.53.6).

  • pre-commit run --all-files passes; actionlint ran without shellcheck (not installed locally), CI's Lint job runs it with shellcheck.

  • mkdocs build --strict passes (with the external/pubgrade-sidecar submodule).

  • No Python code changed; the test suites run in CI.

  • Full review lane (release workflow change): neither reviewer found a high or medium finding. Low findings fixed: rewrapped comment and docs lines, and the Lint job descriptions in ci.yml now name the new check.

  • CI on ci: notify Pubgrade only once registered #157: all checks pass (CI passed), including the new Check Pubgrade condition step in Lint.

Declined review findings

  • docs/releases/0.3.1.md still describes the one-variable gate: 0.3.1 is released and those notes describe that release. The change goes into the next release's curated notes.
  • Commit trailer model name: the trailer follows the session's attribution instruction (Claude Opus 5.5).

🤖 Generated with Claude Code

Summary by Sourcery

Gate Pubgrade release notifications on repository registration as well as the configured service URL.

Bug Fixes:

  • Run Pubgrade notifications only when both the organization URL and repository registration ID are configured, preventing unregistered repositories from waiting for release-environment approval.

CI:

  • Add a lint check that verifies the release workflow uses the required two-variable Pubgrade condition.

Documentation:

  • Update release and usage guidance to explain the two-variable gate, where settings belong, and its effect on environment approvals.

PUBGRADE_URL is an organization variable, so it alone gates nothing:
the release job Notify Pubgrade now also needs the repository variable
PUBGRADE_REPOSITORY_ID, as in tesk-api and drs-filer (D-516). CI's Lint
job pins the condition with yq. The development guide says where each
setting goes, and the example in "Notify Pubgrade from CI" uses the
same condition, so that callers copy the two-variable gate.

Closes #156

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uniqueg uniqueg self-assigned this Dec 2, 2026
@sourcery-ai

sourcery-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Gate Pubgrade notifications on both the organization URL and the repository registration ID, and have CI enforce that the release workflow keeps the same condition.

  • .github/workflows/ci.yml L2-8, L73-74, L115-126
  • .github/workflows/release.yml L16-18, L35-38, L606-618

Documentation

Explain the new registration gate, setting locations, and release-environment behavior for Pubgrade notifications.

  • docs/development.md L220-224, L259-278

Update the caller example and guidance to use both variables, especially when an environment approval is required.

  • docs/usage.md L149, L159-166

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

@read-the-docs-community

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · Pubgrade · built Dec. 2, 2026, 12:46 a.m. UTC

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #157   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         1772      1772           
=========================================
  Hits          1772      1772           

☔ 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 December 2, 2026 00:59
@uniqueg
uniqueg requested a review from akash2237778 as a code owner December 2, 2026 00:59
@sourcery-ai

sourcery-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit f1b9349

#156 ci: notify Pubgrade only once registered · 4 of 5 met · 1 to check by hand

# Requirement Status Notes
1 The release notify job uses the two-variable condition and explains why. ✅ Met The job checks both variables, and its comment explains why the repository ID is also required.
2 CI's Lint job pins the condition. ✅ Met The new lint step compares the notify job's if expression to the required condition.
3 The development guide documents the variable locations and that the repository ID switches notification on. ✅ Met The settings table and switching-on guidance identify the URL as an organization variable and the repository ID as a repository variable.
4 The usage guide's caller example uses the two-variable condition. ✅ Met The example uses the required condition and explains when to put it on the job.
5 Pubgrade is registered at its own instance so its releases keep notifying Pubgrade. 👀 Check by hand (external system) Verify in the repository's GitHub settings that PUBGRADE_REPOSITORY_ID is set to the ID for its registration at Pubgrade.

@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!

Sourcery assessment

Approved.


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

@uniqueg
uniqueg merged commit 29e924e into dev Dec 2, 2026
67 checks passed
@uniqueg
uniqueg deleted the ci/156-notify-gate branch December 2, 2026 01:24
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: notify Pubgrade only once registered

1 participant