Skip to content

fix: scope Zoekt changelog updates to Unreleased - #1563

Merged
brendan-kellam merged 3 commits into
mainfrom
brendan/fix-zoekt-sync-changelog
Aug 10, 2026
Merged

fix: scope Zoekt changelog updates to Unreleased#1563
brendan-kellam merged 3 commits into
mainfrom
brendan/fix-zoekt-sync-changelog

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop changelog insertion state at the first release header after Unreleased
  • prevent automated Zoekt entries from being appended to historical Changed sections
  • add regression coverage with multiple historical releases

Testing

  • bash .github/scripts/testZoektSync.sh
  • git diff --check

Note

Low Risk
Changes are limited to CI changelog automation and its shell tests; no runtime app or security paths are affected.

Overview
Fixes the Zoekt changelog helper so automated Updated the bundled Zoekt version lines are written only under ## [Unreleased], not into ### Changed sections on older release headers.

The awk script now always ends the Unreleased scope when it hits a ## version header (e.g. ## [1.0.0]), instead of only doing that when it still needed to create a Changed section. That stops follow-on ### Changed blocks in historical releases from being treated as Unreleased.

testZoektSync.sh adds a fixture with multiple released versions that already have Changed sections and asserts the PR link appears exactly once after the helper runs.

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

Summary by CodeRabbit

  • Bug Fixes

    • Fixed automated changelog updates so new entries are added only to the Unreleased section, rather than historical releases.
    • Prevented duplicate entries when the changelog update runs repeatedly.
  • Documentation

    • Added an Unreleased changelog entry describing the correction.

@github-actions

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The AWK changelog update now inserts entries only within Unreleased. Tests cover released sections and duplicate prevention. CHANGELOG.md records the fix.

Changes

Zoekt changelog insertion

Layer / File(s) Summary
Scope changelog insertion to Unreleased
.github/scripts/addZoektSyncChangelogEntry.sh, CHANGELOG.md
The AWK logic handles level-two headings within Unreleased and inserts ### Changed and the entry only when needed. The changelog records the fix.
Validate released sections and uniqueness
.github/scripts/testZoektSync.sh
The fixture includes Changed sections in released versions. An assertion verifies that the generated pull-request entry appears exactly once.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: limiting Zoekt changelog updates to the Unreleased section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/fix-zoekt-sync-changelog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Removed entry about fixing automated Zoekt changelog updates.
@brendan-kellam
brendan-kellam merged commit a8da0d8 into main Aug 10, 2026
10 of 11 checks passed
@brendan-kellam
brendan-kellam deleted the brendan/fix-zoekt-sync-changelog branch August 10, 2026 19:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/testZoektSync.sh:
- Around line 166-168: Update the changelog assertions around the existing
entry_count check to count “sourcebot/pull/42” specifically within the fixture
block from “## [Unreleased]” through the next “## ” heading, while retaining the
full-fixture count assertion to verify uniqueness. Ensure the assertions confirm
the entry appears exactly once and only under Unreleased.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa9a350e-8a10-4bf3-99e3-61862621922c

📥 Commits

Reviewing files that changed from the base of the PR and between 9e882d4 and 9f8b3e0.

📒 Files selected for processing (3)
  • .github/scripts/addZoektSyncChangelogEntry.sh
  • .github/scripts/testZoektSync.sh
  • CHANGELOG.md

Comment on lines +166 to +168
entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
assert_equals "$entry_count" 1 \
"the changelog helper should add the PR entry only to Unreleased"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the entry location, not only the total count.

This assertion scans the full fixture. It passes if the helper inserts the entry once in a released ### Changed section. Count the entry inside the block from ## [Unreleased] to the next ## heading, and keep the total-count assertion to verify both scope and uniqueness.

Proposed assertion
 entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
 assert_equals "$entry_count" 1 \
   "the changelog helper should add the PR entry only to Unreleased"
+unreleased_entry_count=$(awk '
+  $0 == "## [Unreleased]" { in_unreleased = 1; next }
+  in_unreleased && /^## / { exit }
+  in_unreleased && /sourcebot\/pull\/42/ { count++ }
+  END { print count + 0 }
+' "$changelog_fixture")
+assert_equals "$unreleased_entry_count" 1 \
+  "the changelog helper should place the PR entry inside Unreleased"

As stated in the PR objectives, the generated entry must be scoped to Unreleased.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
assert_equals "$entry_count" 1 \
"the changelog helper should add the PR entry only to Unreleased"
entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
assert_equals "$entry_count" 1 \
"the changelog helper should add the PR entry only to Unreleased"
unreleased_entry_count=$(awk '
$0 == "## [Unreleased]" { in_unreleased = 1; next }
in_unreleased && /^## / { exit }
in_unreleased && /sourcebot\/pull\/42/ { count++ }
END { print count + 0 }
' "$changelog_fixture")
assert_equals "$unreleased_entry_count" 1 \
"the changelog helper should place the PR entry inside Unreleased"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/testZoektSync.sh around lines 166 - 168, Update the
changelog assertions around the existing entry_count check to count
“sourcebot/pull/42” specifically within the fixture block from “## [Unreleased]”
through the next “## ” heading, while retaining the full-fixture count assertion
to verify uniqueness. Ensure the assertions confirm the entry appears exactly
once and only under Unreleased.

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