Skip to content

fix: compare correct branches in changelog guard check#2299

Open
r0b1n wants to merge 1 commit into
mainfrom
fix/chanegelogs-checker
Open

fix: compare correct branches in changelog guard check#2299
r0b1n wants to merge 1 commit into
mainfrom
fix/chanegelogs-checker

Conversation

@r0b1n

@r0b1n r0b1n commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@r0b1n r0b1n requested a review from a team as a code owner July 2, 2026 10:42
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

AI Code Review

⚠️ Approved with suggestions — low-severity items only, safe to merge


What was reviewed

File Change
automation/utils/bin/rui-check-changelogs.ts Bug fix: compare base (not head) against the merged tree; replace JSON identity check for released versions with a key-based diff that produces per-version error messages; add formatVersion helper

Skipped (out of scope): dist/, pnpm-lock.yaml


Findings

⚠️ Low — formatVersion uses any instead of the parsed entry type

File: automation/utils/bin/rui-check-changelogs.ts lines 60–66
Note: The entry parameter is typed as any, which bypasses TypeScript's strict checks for this utility. The parsed result type from parseWidget / parseModule is already imported-adjacent — consider typing entry as the actual parsed section/entry shape (or at minimum { version?: { format?: () => string } | string; type?: string }). Not blocking, but it weakens the type safety the rest of the file relies on.


Positives

  • The core bug fix is correct: diffing base → mergedTree instead of head → mergedTree is the right comparison; the old approach missed files only changed in the PR branch, which is exactly the scenario a changelog guard needs to catch.
  • The replacement compareReleasedVersions logic is a clear improvement: iterating old entries and looking them up by key produces actionable per-version error messages (removed vs modified) instead of the opaque "blob doesn't match" failure from JSON.stringify equality.
  • Removing the redundant console.error call before the early return false in compareChangelogContent keeps error reporting consolidated in compareReleasedVersions — no duplicate messages.
  • The updated comment at line 163–165 accurately describes the new diffing strategy, making the intent clear for future maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants