fix: batch bun global installs to prevent resolution hang - #1376
Conversation
bun hangs when resolving too many packages at once in a single bun add --global call. Install in batches of 10 instead.
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 9 seconds. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Mesa DescriptionTL;DRBatched What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Pull request overview
This PR mitigates bun global install hangs by batching global package installs, aligning the Home Manager npm-globals activation script and its ShellSpec coverage with the new behavior.
Changes:
- Replace a single large
bun install --globalinvocation with batchedbun add --globalcalls (batch size 10) to avoid resolver hangs. - Update ShellSpec expectations to assert the new bun command and batching mechanism.
- Adjust Makefile dotagents integration flags to keep local targets authoritative and skip submodule sync.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spec/npm_globals_spec.sh | Updates tests to match batched bun add --global behavior and presence of BATCH_SIZE. |
| Makefile | Tweaks dotagents include behavior by adding DOTAGENTS_SKIP_SYNC and updating the related comment. |
| home-manager/modules/npm-globals/install-npm-globals.sh | Implements batched global installs via a bash array and loop to prevent bun resolution hangs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request updates the dotagents subproject and modifies the Makefile to skip synchronization. The primary change is in the install-npm-globals.sh script, where global package installation is now processed in batches of 10 using bun add --global to mitigate issues where bun hangs during large dependency resolutions. Test specifications have been updated to reflect these changes. I have no feedback to provide.
Summary
bun add --globalcalls into groups of 10 packages instead of installing all 55 at oncebun install --globalto batchedbun add --globalTest plan
shellspec spec/npm_globals_spec.shpasses (17 examples, 0 failures)shellcheckpasses on modified scriptSummary by cubic
Batched global installs to stop
bunfrom hanging and unblocked upgrade CI by avoiding adotagentssync collision. Packages now install in groups of 10 withbun add --global, and tests were updated.bun add --globalto prevent resolution hangs.DOTAGENTS_SKIP_SYNC=1to avoiddotagentssync target collision, addressing update scripts #1372.bun add --globaland batching logic.Written for commit d77dad8. Summary will update on new commits.