Skip to content

fix(release): dedupe sponsor release notes#123

Merged
jdx merged 1 commit intomainfrom
codex/dedupe-sponsor-release-notes
Apr 26, 2026
Merged

fix(release): dedupe sponsor release notes#123
jdx merged 1 commit intomainfrom
codex/dedupe-sponsor-release-notes

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 26, 2026

Make the release sponsor append step idempotent by removing any existing communique sponsor section before appending the canonical en.dev blurb. This prevents communique-generated sponsor text and workflow reruns from producing duplicate sponsor release notes.


Note

Low Risk
Low risk workflow-only change; it only adjusts how the GitHub Actions job edits release notes to avoid duplicated sponsor text on reruns.

Overview
Makes the Append en.dev sponsor blurb step in .github/workflows/release-plz.yml idempotent by stripping any existing ## 💚 Sponsor communique section from the current GitHub release body before appending the canonical sponsor blurb and updating the release notes file.

Reviewed by Cursor Bugbot for commit 6cca86a. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.65%. Comparing base (1533cee) to head (6cca86a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #123   +/-   ##
=======================================
  Coverage   94.65%   94.65%           
=======================================
  Files          26       26           
  Lines        4697     4697           
  Branches     4697     4697           
=======================================
  Hits         4446     4446           
  Misses        160      160           
  Partials       91       91           

☔ View full report in Codecov by Sentry.
📢 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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR makes the "Append en.dev sponsor blurb" step idempotent by piping the existing release body through a perl one-liner that strips any pre-existing sponsor section before appending the canonical blurb, preventing duplicates on workflow reruns. The perl -0pe slurp-mode regex correctly handles both the "section already present" and "no section yet" cases, and the heredoc indentation is stripped correctly by YAML's run: | block scalar semantics.

Confidence Score: 5/5

Safe to merge — the change is a narrow, well-scoped fix to a single workflow step with no logic regressions.

No P0/P1 issues found. The perl regex is correct for slurp mode, heredoc indentation strips cleanly via YAML block scalar, and the idempotency goal is fully achieved. perl is always available on ubuntu-latest runners.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/release-plz.yml Adds a perl regex strip before re-appending the sponsor section to make the step idempotent; logic is sound and the regex correctly handles both first-run and rerun cases.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Releases API
    participant perl as perl (strip)
    participant cat as cat (heredoc)
    participant tmp as /tmp/release-notes.md
    participant edit as gh release edit

    GH->>perl: existing release body (json .body)
    perl->>tmp: body with sponsor section stripped
    cat->>tmp: append canonical sponsor blurb
    tmp->>edit: updated notes
    edit->>GH: PATCH release notes
Loading

Reviews (1): Last reviewed commit: "fix(release): dedupe sponsor release not..." | Re-trigger Greptile

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6cca86a. Configure here.

gh release view "$TAG" --json body --jq .body
cat <<'EOF'
gh release view "$TAG" --json body --jq .body \
| perl -0pe 's/\n*##\s+💚?\s*Sponsor communique\b.*\z//s' \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greedy \n* strips blank line on re-runs

Low Severity

The \n* anchor in the perl regex greedily consumes all newlines preceding the sponsor heading, including the blank-line separator between the body and the heading. On re-runs, the body is left without a trailing newline, and the heredoc's single leading \n only restores one newline (acting as a line ending), so the blank line before ## 💚 Sponsor communique is lost. This makes the step non-idempotent — the raw markdown changes between the first run and subsequent runs.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6cca86a. Configure here.

@jdx jdx merged commit 89934a9 into main Apr 26, 2026
9 checks passed
@jdx jdx deleted the codex/dedupe-sponsor-release-notes branch April 26, 2026 13:37
jdx added a commit that referenced this pull request Apr 26, 2026
A small patch release that stops generated release notes from saying the
same thing three times, and keeps communique's own sponsor footer from
compounding on workflow reruns.

## Fixed

- **Reserve Highlights for genuinely broad releases** — The release-note
system prompt and the `submit_release_notes` tool schema have been
retightened so the model stops producing a `## Highlights` section that
just restates the categorized `## Added` / `## Fixed` bullets underneath
it. The opening summary is now capped at 1-2 sentences, Highlights are
gated on "roughly 10+ distinct user-facing changes or 4+ independent
headline themes", and the prompt explicitly assigns each section a
distinct job: the opening paragraph frames the release, Highlights (when
present) group broad themes for skimming, and categorized sections carry
the concrete PR links, authors, examples, and compatibility notes. The
prompt also tells the model directly to avoid saying the same change
three times. Patch and small minor releases should now skip Highlights
entirely instead of padding them out.
([#124](#124)) (@jdx)
- **Dedupe the sponsor blurb on release reruns** — communique's own
`release-plz` workflow appends a `## 💚 Sponsor communique` footer to
each GitHub release. If the workflow re-ran, or if communique itself
drafted notes that already included a sponsor section, the footer would
stack up. The `Append en.dev sponsor blurb` step is now idempotent: it
strips any existing `## 💚 Sponsor communique` section from the current
release body before appending the canonical en.dev blurb.
([#123](#123)) (@jdx)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only bumps version metadata and updates generated
documentation/changelog; no runtime behavior changes are included in the
diff (aside from a potential `CHANGELOG.md` formatting glitch).
> 
> **Overview**
> Cuts the `v1.1.1` release by bumping the crate/CLI version from
`1.1.0` → `1.1.1` across `Cargo.toml`, `Cargo.lock`, the usage spec, and
generated CLI docs.
> 
> Updates `CHANGELOG.md` with a new `1.1.1` entry describing two fixes,
though the edit also leaves a **formatting issue** where the `1.1.0`
entry appears to run into the `1.0.4` header.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
82507c2. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jdx added a commit to jdx/hk that referenced this pull request Apr 26, 2026
## Summary

- The `Append en.dev sponsor blurb` step in
[.github/workflows/release.yml](.github/workflows/release.yml) was not
idempotent. Under communique 1.1.x, the LLM reproduces a `## Sponsor hk`
section verbatim from the previous release's body into the new body, and
this step would then unconditionally append a second `## 💚 Sponsor hk`
block on top — visible in
[v1.44.2](https://github.com/jdx/hk/releases/tag/v1.44.2) (already
manually fixed via `gh release edit`).
- Strip any existing `## …Sponsor hk` heading (and everything after it)
from the live release body before appending the canonical blurb. Mirrors
[jdx/communique#123](jdx/communique#123).
- The regex `s/\n*^##[^\n]*Sponsor hk\b.*\z//ms` matches both the
no-emoji form (`## Sponsor hk`, which communique generates because of
`[defaults] emoji = false` in `communique.toml`) and the canonical `## 💚
Sponsor hk` form, so the step is self-healing on reruns.

## Why this differs slightly from the upstream communique fix

communique uses `s/\n*##\s+💚?\s*Sponsor communique\b.*\z//s`, which only
works when the offending duplicate also contains 💚. That happens to be
true in their repo because they don't set `emoji = false`. For hk, the
LLM-injected duplicate has no emoji, so the byte-mode `💚?` quantifier
(which makes only the last byte of the 4-byte UTF-8 sequence optional,
not the whole codepoint) fails to match. The simpler `[^\n]*` form is
byte-safe and matches both variants.

## Test plan

- [x] `actionlint .github/workflows/release.yml` passes
- [x] `yamllint .github/workflows/release.yml` passes
- [x] Manual dry-run: piping the live v1.44.2 body through the new regex
strips both sponsor sections cleanly, leaving `**Full Changelog**: …` as
the last meaningful line
- [x] Manual one-shot fix already applied to v1.44.2 release notes
(sponsor count: 1)
- [ ] Next tagged release produces a body with exactly one `## 💚 Sponsor
hk` section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk CI-only change that adjusts how GitHub release notes are
post-processed; main risk is accidentally stripping trailing content if
the regex matches unexpectedly.
> 
> **Overview**
> Makes the `Append en.dev sponsor blurb` step in
`.github/workflows/release.yml` idempotent by first fetching the current
GitHub release body and stripping any existing `## …Sponsor hk` section
(and everything after it) before appending the canonical sponsor blurb.
> 
> This prevents reruns/LLM-generated notes from producing duplicate
sponsor sections in published release notes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e9bed07. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant