You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ Approved with suggestions — low-severity items only, safe to merge
What was reviewed
File
Change
automation/utils/bin/rui-create-gh-release.ts
Added fast-path: if version already stamped in CHANGELOG.md, skip changelog PR and write release notes directly
Skipped (out of scope): dist/, pnpm-lock.yaml
CI checks still in progress at review time; Snyk license/security checks are ERROR (pre-existing, unrelated to this change).
Findings
⚠️ Low — getLatestReleaseContent() always returns content[1], not necessarily pkg.version
File:automation/utils/bin/rui-create-gh-release.ts line 79 Note:hasVersion(pkg.version) scans the entire content array, so it returns true even if pkg.version is at index 2, 3, etc. (i.e., an older stamped entry). getLatestReleaseContent() unconditionally returns content[1] — the most recent stamped entry — regardless of which version matched. If a CHANGELOG has two stamped entries and pkg.version is the older one, the wrong release notes get written.
In practice this is unlikely (a release script runs against the current version, which should always be the latest entry), but the code silently produces incorrect output rather than throwing. A defensive guard would make the intent explicit:
constcontent=changelog.getLatestReleaseContent();// Optional guard — belt-and-suspendersconstlatestVersion=changelog.changelog.content[1];if("version"inlatestVersion&&!latestVersion.version.equals(pkg.version)){thrownewError(`Version mismatch: expected ${version} at top of CHANGELOG but found ${latestVersion.version.format()}`);}awaitwriteFile(notesFile,content);
Or, if WidgetChangelogFileWrapper exposes a method to get content for a specific version, use that instead.
Positives
The early-exit check (changelog.hasVersion(pkg.version)) directly reuses the existing WidgetChangelogFileWrapper API rather than duplicating parsing logic — clean integration.
Both branches of the new if/else preserve the existing process.env.RELEASE_NOTES_FILE = notesFile assignment, keeping the downstream createGithubReleaseFrom call unchanged.
The comment above the new block (// If the version is already stamped...) explains the non-obvious scenario that motivated this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.