Skip to content

Add script to ping PR authors and issue reporters after a release - #329

Open
wallrj-cyberark wants to merge 2 commits into
cert-manager:masterfrom
wallrj-cyberark:add-ping-release-prs-script
Open

Add script to ping PR authors and issue reporters after a release#329
wallrj-cyberark wants to merge 2 commits into
cert-manager:masterfrom
wallrj-cyberark:add-ping-release-prs-script

Conversation

@wallrj-cyberark

@wallrj-cyberark wallrj-cyberark commented Jul 1, 2026

Copy link
Copy Markdown
Member

What does this do?

Adds hack/ping-release-prs.sh. After a release is published, it posts a comment on each included PR telling the author the change is available, and a comment on each issue those PRs close asking the reporter to verify the fix.

It is idempotent. It skips any PR or issue that already has a comment linking to the release, and it reads 100 comments per page so a long thread does not hide an earlier ping.

Why

  • For v1.21.0-beta.0 about 40 of these comments were posted by hand, with two different formats and one near-duplicate caused by GitHub's 30-comment default page size.
  • For v1.21.1 nobody was pinged at all. A dry run of this script against the v1.21.1 release notes reports every PR as not yet pinged.
  • v1.21.2 (Release cert-manager v1.21.2 cert-manager#9237) is a patch release, and the release notes list cherry-pick PRs. Those PRs have no linked issues and are authored by the bot, so the first version of this script would have commented on the cherry-picks and pinged nobody. The second commit fixes that.

How it works

For each PR number given:

  1. If the PR body says "cherry-pick of #N", it uses PR N instead.
  2. Skips the PR if a comment already links to the release tag. Otherwise posts a comment mentioning the author.
  3. For each issue the PR closes: skips it if the reporter is the PR author or a member of the repository's organization, skips it if already pinged, otherwise posts a comment mentioning the reporter.

The wording says "pre-release" or "release" to match the GitHub release, and the lookup fails early if the tag does not exist.

Usage

# Dry run first to see what would be posted.
./hack/ping-release-prs.sh --release v1.21.2 --dry-run 9222 9231 9232 ...

# Real run.
./hack/ping-release-prs.sh --release v1.21.2 9222 9231 9232 ...

# Different repository.
./hack/ping-release-prs.sh --release v1.21.2 --repo cert-manager/cert-manager 9222 9231 ...

Requires gh (authenticated) and jq.

Dry run for v1.21.2

14 PR comments and 3 issue comments would be posted.

PR #9222 is a cherry-pick of #9010
PR #9010
  pinging PR
PR #9231 is a cherry-pick of #8977
PR #8977
  pinging PR
PR #9232 is a cherry-pick of #9035
PR #9035
  pinging PR
PR #9234 is a cherry-pick of #8978
PR #8978
  pinging PR
PR #9235 is a cherry-pick of #9086
PR #9086
  pinging PR
  Issue #9064
    pinging @ivgotcrazy
PR #9236 is a cherry-pick of #9124
PR #9124
  pinging PR
  Issue #9074
    pinging @sfc-gh-srhodes
PR #9238 is a cherry-pick of #9118
PR #9118
  pinging PR
  Issue #9119
    reported by cert-manager member @wallrj — skipping
PR #9239 is a cherry-pick of #9202
PR #9202
  pinging PR
PR #9240 is a cherry-pick of #9170
PR #9170
  pinging PR
  Issue #9148
    reported by cert-manager member @wallrj — skipping
PR #9262 is a cherry-pick of #9206
PR #9206
  pinging PR
PR #9278 is a cherry-pick of #9228
PR #9228
  pinging PR
  Issue #9223
    pinging @ChaoHuang2018
PR #9312 is a cherry-pick of #9270
PR #9270
  pinging PR
  Issue #9269
    reported by cert-manager member @wallrj — skipping
PR #9313 is a cherry-pick of #9274
PR #9274
  pinging PR
  Issue #9273
    self-reported by @shashankvarma499 — skipping
PR #9314 is a cherry-pick of #9303
PR #9303
  pinging PR
  Issue #9297
    reported by cert-manager member @wallrj — skipping
Done.

A website PR adds this as a step in the release process.

[Claude Fable 5.1]

hack/ping-release-prs.sh checks each given PR number to see whether a
ping comment referencing the release tag URL has already been posted (using
per_page=100 to avoid missing comments on long threads). If not, it posts a
brief comment on the PR and on any linked closing issues, skipping
self-reported issues automatically.

The script is idempotent and supports --dry-run.

Signed-off-by: Richard Wall <[email protected]>
@cert-manager-prow cert-manager-prow Bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Jul 1, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joshvanl for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 1, 2026
…rted issues

For a patch release the release notes list the cherry-pick PRs. Those have
no linked issues and are authored by the bot, so the script commented on
the cherry-pick and pinged nobody. It now follows "cherry-pick of #N" in
the PR body to the original PR, so the pings land where the contributor
and reporter are watching.

The comment said "pre-release" whatever the release was. It now says
"pre-release" or "release" to match the GitHub release, and the lookup
fails early if the tag does not exist.

Issues reported by a member of the repository's organization are skipped,
as self-reported issues already were. Maintainers know about the release.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants