Conversation
|
📝 WalkthroughWalkthroughRefactored release script to identify bumped packages by comparing current package.json versions against the previous release, replacing commit-diff logic. Added per-commit author resolution by mapping email addresses to GitHub usernames. Reworked changelog generation to extract entries from bumped packages' CHANGELOG.md files with author annotations. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit 8e4949a
☁️ Nx Cloud last updated this comment at |
Bundle Size Benchmarks
Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/create-github-release.mjs`:
- Around line 57-60: The regex currently captures only the 7-char displayed SHA
from the link text (commitMatch) which can be ambiguous; update the parsing so
you extract the full 40-character SHA from the link target/URL in the same line
before calling resolveAuthorForCommit. Locate the block that defines commitMatch
and the call to resolveAuthorForCommit, change the regex to capture the link
target (or separately parse the URL portion) and pull the 40-char hex SHA
(a-f0-9{40}) from that URL, then pass that full SHA into resolveAuthorForCommit
instead of the short hash.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 17c70583-4252-4d76-83ec-c65604a3cdb7
📒 Files selected for processing (1)
scripts/create-github-release.mjs
| // Match commit hash links like [`9a4d924`](url) | ||
| const commitMatch = line.match(/\[`([a-f0-9]{7,})`\]/) | ||
| if (commitMatch && line.startsWith('- ')) { | ||
| const author = await resolveAuthorForCommit(commitMatch[1]) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
python <<'PY'
import pathlib
import re
import subprocess
import sys
all_shas = subprocess.check_output(["git", "rev-list", "--all"], text=True).splitlines()
shorts = sorted(set(
m.group(1)
for p in pathlib.Path("packages").glob("*/CHANGELOG.md")
for m in re.finditer(r'\[`([a-f0-9]{7,})`\]\(', p.read_text())
))
ambiguous = []
for short in shorts:
count = sum(sha.startswith(short) for sha in all_shas)
if count != 1:
ambiguous.append((short, count))
if ambiguous:
print("Ambiguous short SHAs referenced from changelogs:")
for short, count in ambiguous:
print(f"{short}: {count} matching commits")
sys.exit(1)
print("All current changelog short SHAs resolve uniquely; parsing the full SHA is still safer.")
PYRepository: TanStack/router
Length of output: 146
Parse the full commit SHA from the link target instead of the abbreviated hash.
The current regex extracts only the 7-character display hash. While all short SHAs in the current changelogs resolve uniquely, parsing the full 40-character SHA from the link URL is safer and avoids potential ambiguities if the repository grows.
Suggested change
- const commitMatch = line.match(/\[`([a-f0-9]{7,})`\]/)
+ const commitMatch = line.match(
+ /\[`[a-f0-9]{7,}`\]\([^)]*\/commit\/([a-f0-9]{40})\)/
+ )
if (commitMatch && line.startsWith('- ')) {
const author = await resolveAuthorForCommit(commitMatch[1])🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/create-github-release.mjs` around lines 57 - 60, The regex currently
captures only the 7-char displayed SHA from the link text (commitMatch) which
can be ambiguous; update the parsing so you extract the full 40-character SHA
from the link target/URL in the same line before calling resolveAuthorForCommit.
Locate the block that defines commitMatch and the call to
resolveAuthorForCommit, change the regex to capture the link target (or
separately parse the URL portion) and pull the 40-char hex SHA (a-f0-9{40}) from
that URL, then pass that full SHA into resolveAuthorForCommit instead of the
short hash.
Summary by CodeRabbit