babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
374 stars 27 forks source link

`neil dep upgrade`: allow upgrading from unstable version to more recent unstable version #179

Closed teodorlu closed 1 year ago

teodorlu commented 1 year ago

Please answer the following questions and leave the below in as part of your PR.

Rationale

When working with libraries where there is no stable version released, it's nice to be able to upgrade to most recent unstable version. We could allow this with neil dep upgrade.

Proposed semantics

  1. A version will never be superseded by an older version
  2. A stable version will be superseded by stable versions only
  3. Unstable versions will be replaced by the latest version - whether stable or unstable.
teodorlu commented 1 year ago

Let's say I'm on mylib 0.1-alpha. There is both a more recent stable version, mylib 0.2, and a more recent unstable version mylib 0.3-alpha.

What version do we want neil dep upgrade to pick?

teodorlu commented 1 year ago

I'm leaning towards "if you are currently on an unstable version, you get the latest version period". In the example above, I'd be upgraded to mylib 0.3-alpha.

Summary:

  1. A version will never be superseded by an older version
  2. A stable version will be superseded by stable versions only
  3. Unstable versions will be replaced by the latest version - whether stable or unstable.
borkdude commented 1 year ago

@teodorlu Two minor things:

teodorlu commented 1 year ago

Yes, both need to be fixed before we consider merging! I guess I could have reverted back to a "draft pr" state, this isn't quite done yet.

I tried making the "prefer stable versions change", and started out writing the preferred-upgrade-version function with tests. Which worked as I expected. Then I tried to integrate it with the rest of Neil, and just got stuck! So I threw away my local changes, and decided I'd try again later.

borkdude commented 1 year ago

OK, please ping me when I should review again :)

teodorlu commented 1 year ago

Will do! I'll mark this as draft for now, and move it back to ready for review next time.

teodorlu commented 1 year ago

I'm throwing this PR away and trying again in #180 !