🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

generalize upgrade to take more than one lib pair simultaneously - #5963

Merged
aryairani merged 17 commits into
trunkfrom
multi-arg-upgrade
Oct 30, 2025
Merged

generalize upgrade to take more than one lib pair simultaneously#5963
aryairani merged 17 commits into
trunkfrom
multi-arg-upgrade

Conversation

@mitchellwrosen

@mitchellwrosen mitchellwrosen commented Oct 27, 2025

Copy link
Copy Markdown
Member

Overview

This PR generalizes upgrade to allow upgrading multiple libraries simultaneously:

> upgrade foo1 foo2 bar1 bar2 baz1 baz2 ...

(it's an error to provide an odd number of arguments).

One small user-visible implementation quirk: if an upgrade fails, we had been putting the user on a branch called upgrade-<old>-to-<new> to resolve it, as a reminder about the branch context. However, I didn't want to continue that template for an arbitrary number of library upgrades, so if a 2+ library upgrade fails, the user is just put on a branch called upgrade (or upgrade__2 if upgrade is taken, etc).

Test coverage

I've added tests to the upgrade.md transcript.

@mitchellwrosen
mitchellwrosen marked this pull request as ready for review October 28, 2025 17:30
@aryairani aryairani added this to the 1.0.0 milestone Oct 29, 2025
@aryairani

Copy link
Copy Markdown
Contributor

Nice!

Could you explain the different cases with the different messages; I guess when there's underscores in the arg names, then it doesn't try to "rename", and then under certain circumstances it does?

And then I think we should probably not have a bulleted list with just one bullet.

@mitchellwrosen

mitchellwrosen commented Oct 30, 2025

Copy link
Copy Markdown
Member Author

Regarding renaming, it's the same behavior as before - if the library you are upgrading to ends in __N then we try to rip it off afterwards. This is to catch the common case of installing an unpublished library, like:

> lib.install @mitchellwrosen/something
-- ok I installed lib.mitchellwrosen_something_main

> lib.install @mitchellwrosen/something
-- ok I installed lib.mitchellwrseon_something_main__2

> upgrade mitchellwrosen_something_main mitchellwrosen_something_main__2
-- ok I upgraded mitchellwrosen_something_main to mitchellwrosen_something_main__2, then renamed it to mitchellwrosen_something_main

@mitchellwrosen

Copy link
Copy Markdown
Member Author

And then I think we should probably not have a bulleted list with just one bullet.

Ok, I just replaced it with a comma-separated list then, like in the successful upgrade message

@aryairani
aryairani merged commit 7a04846 into trunk Oct 30, 2025
32 checks passed
@aryairani
aryairani deleted the multi-arg-upgrade branch October 30, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants