-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: Improve the bump command
#11226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Claude finished @kdy1's task —— View job Code Review for PR #11226Reviewing the changes to improve the Todo List:
Review SummaryThis PR makes two key improvements to the bump command in ✅ Positive Changes
🔍 Code Quality AssessmentStrengths:
Minor Considerations:
🛡️ Security & Safety
🧪 Test CoverageThe changes are defensive improvements that should be backwards compatible. However, consider adding tests for:
📈 Performance Impact
✅ Overall AssessmentThis is a well-implemented fix that addresses the specific issue described in the PR. The changes are:
Recommendation: Approve - These changes correctly implement the intended functionality to exclude binding crates from version bumping while improving error handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves handling of unpublishable packages in the SWC releaser tool. The changes ensure that packages marked with publish = false (represented as an empty vector in cargo_metadata) are properly excluded from version bumping operations.
- Filters out unpublishable packages when building the version map
- Changes error handling to gracefully skip packages without versions instead of failing
- Prevents version bumping attempts on packages that should not be published
Comments suppressed due to low confidence (1)
tools/swc-releaser/src/main.rs:188
- The
is_breakingmethod still uses the old error handling pattern and will fail if a package is not in the versions map. This is inconsistent with the graceful handling added tobump_crate. If a changeset references an unpublishable package,is_breakingwill error beforebump_crategets a chance to skip it gracefully. Consider applying the same pattern here: return early with a default value (e.g.,false) when the package is not found in the versions map.
fn is_breaking(&self, pkg_name: &str, change_type: Option<&ChangeType>) -> Result<bool> {
let original_version = self
.versions
.get(pkg_name)
.context(format!("failed to find original version for {pkg_name}"))?;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Binary Sizes
Commit: 0c4e28e |
CodSpeed Performance ReportMerging #11226 will not alter performanceComparing Summary
Footnotes |
Description:
Bump command should not bump the versions of binding crates, because those are managed by https://github.com/swc-project/swc/blob/2edbd40241b3402c8542241b1f8d82a4ebadd801/scripts/publish.sh .
But before this PR, there was a bug related to packages that are not published to crates.io, so there was an issue in a commit like 5e6af60