chore: generate package versions output for releases#2259
Conversation
|
Warning Rate limit exceeded@saikumarrs has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 21 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA shell script was added to generate a Markdown table listing package versions within a monorepo. It compares current versions to those on the Changes
Suggested reviewers
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2259 +/- ##
========================================
Coverage 61.85% 61.85%
========================================
Files 480 480
Lines 16561 16561
Branches 3266 3284 +18
========================================
Hits 10244 10244
+ Misses 5134 5091 -43
- Partials 1183 1226 +43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Adds automation to generate and include a Markdown table of package version changes in the release PR description.
- Introduces a shell script to compare current and main-branch versions for all packages.
- Updates the
draft-new-release.ymlworkflow to run the script and embed its output in the PR body.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/collect-packages-versions.sh | New script to list packages and their new versions in a Markdown table |
| .github/workflows/draft-new-release.yml | Executes the script and appends the generated table to the PR message |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
scripts/collect-packages-versions.sh (1)
43-45: Handle filenames with spaces & ensure deterministic order
Switch to null-delimited output andread -rto safely process package paths containing whitespace, and sort the results for consistent ordering.-find packages -name package.json | while read pkg; do - print_version_row "$pkg" -done +find packages -type f -name package.json -print0 \ + | sort -z \ + | while IFS= read -r -d '' pkg; do + print_version_row "$pkg" +done
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.github/workflows/draft-new-release.ymlis excluded by!**/*.yml
📒 Files selected for processing (1)
scripts/collect-packages-versions.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Unit Tests and Lint
- GitHub Check: Bundle size checks
- GitHub Check: Security and code quality checks
🔇 Additional comments (2)
scripts/collect-packages-versions.sh (2)
3-19: Well-documented script header
The multi-line comment clearly explains the purpose, usage, and output format of the script.
22-23: Correct Markdown table headers
The header and separator lines are formatted correctly for a Markdown table.
size-limit report 📦
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (4)
scripts/collect-packages-versions.sh (4)
11-13: Verify usage section filename consistency with workflow
The usage example directs output topackage_versions.md. Ensure that any CI or release workflow, as well as documentation, references the same filename to prevent mismatches.
42-45: Use robustreadand remove trailing whitespace
When iterating over file paths, useIFS= read -r pkgto avoid backslash interpretation. Also eliminate the trailing space afterdone.-find packages -name package.json | while read pkg; do +find packages -name package.json | while IFS= read -r pkg; do print_version_row "$pkg" -done +done
1-2: 🛠️ Refactor suggestionEnhance script robustness with strict modes & dependency checks
Switch to a portable shebang, enable strict error handling withset -euo pipefail, and verify thatgitandjqare installed before proceeding. Also remove the existingset -eto avoid duplication.-#!/bin/bash -set -e +#!/usr/bin/env bash + +# Exit on error, undefined variable, and pipeline failures +set -euo pipefail + +# Ensure required commands are available +command -v jq >/dev/null 2>&1 || { echo "Error: jq is required but not installed." >&2; exit 1; } +command -v git >/dev/null 2>&1 || { echo "Error: git is required but not installed." >&2; exit 1; }Also applies to: 20-20
27-31: 🛠️ Refactor suggestionFix command substitution and
jqpipeline grouping
The current assignment splits the pipe outside the substitution, leading to syntax errors and incorrect behavior. Wrap the entire pipeline inside the command substitution:- prev_version=$(git show origin/main:"$file_path" 2>/dev/null || echo '{}') | jq -r .version) + prev_version=$( + git show origin/main:"$file_path" 2>/dev/null || echo '{}' + | jq -r .version + )🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 27-27: Couldn't find 'fi' for this 'if'.
(SC1046)
[error] 27-27: Couldn't parse this if expression. Fix to allow more checks.
(SC1073)
[error] 31-31: Expected 'fi' matching previously mentioned 'if'.
(SC1047)
[error] 31-31: Expected 'fi'. Fix any mentioned problems and try again.
(SC1072)
🧹 Nitpick comments (1)
scripts/collect-packages-versions.sh (1)
32-34: String comparison portability
Using==inside single[is a Bash extension; switch to POSIX-compatible=or use[[ ... ]]for clarity:-if [ "$version" == "$prev_version" ]; then +if [ "$version" = "$prev_version" ]; then
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/collect-packages-versions.sh(1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
scripts/collect-packages-versions.sh
[error] 27-27: Couldn't find 'fi' for this 'if'.
(SC1046)
[error] 27-27: Couldn't parse this if expression. Fix to allow more checks.
(SC1073)
[error] 31-31: Expected 'fi' matching previously mentioned 'if'.
(SC1047)
[error] 31-31: Expected 'fi'. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Security and code quality checks
- GitHub Check: Bundle size checks
- GitHub Check: Unit Tests and Lint
🔇 Additional comments (4)
scripts/collect-packages-versions.sh (4)
22-23: Correctly formatted table header
The Markdown header for the package versions table is properly formatted and aligns with expectations.
25-27: Function declaration and file existence check
Theprint_version_rowfunction is clearly defined and correctly guards against missing files.🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 27-27: Couldn't find 'fi' for this 'if'.
(SC1046)
[error] 27-27: Couldn't parse this if expression. Fix to allow more checks.
(SC1073)
28-30: Extract package metadata
Usingjqto pull thenameandversionfields is concise and efficient.
39-41: Invoke row printing for root package
Callingprint_version_row "package.json"correctly includes the root package in the output.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/collect-packages-versions.sh(1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
scripts/collect-packages-versions.sh
[error] 27-27: Couldn't find 'fi' for this 'if'.
(SC1046)
[error] 27-27: Couldn't parse this if expression. Fix to allow more checks.
(SC1073)
[error] 31-31: Expected 'fi' matching previously mentioned 'if'.
(SC1047)
[error] 31-31: Expected 'fi'. Fix any mentioned problems and try again.
(SC1072)
🔇 Additional comments (3)
scripts/collect-packages-versions.sh (3)
25-30: Approve: JSON parsing and file‐existence check
Theprint_version_rowfunction correctly guards on file existence, then usesjqto extract thenameandversionfields. This is clear and efficient.🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 27-27: Couldn't find 'fi' for this 'if'.
(SC1046)
[error] 27-27: Couldn't parse this if expression. Fix to allow more checks.
(SC1073)
32-36: Approve: unchanged‐version handling and Markdown formatting
The logic to substitute unchanged versions withN/Aand emit a Markdown table row is concise and correct.
43-45: Approve: package discovery loop
Usingfindpiped intowhile read -ris a robust way to enumerate allpackage.jsonfiles underpackages.
|
MoumitaM
left a comment
There was a problem hiding this comment.
You can also add the current version to that table. At a glance, we will be able to see if it is a patch or a minor version update. This is just a suggestion; otherwise looks good.



PR Description
I've updated the draft new release workflow to also create table at the end of the release PR description to list all the packages and their new versions.
Linear task (optional)
N/A
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit