babashka / neil

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

neil dep upgrade changes git url #235

Open borkdude opened 3 months ago

borkdude commented 3 months ago

neil dep upgrade changes the git url, in the following cases:

{babashka/pods {#_#_:local/root "/Users/borkdude/Dropbox/dev/clojure/babashka/babashka.pods"
                            :git/url "https://github.com/babashka/babashka.pods"
                            :git/sha "47e55fe5e728578ff4dbf7d2a2caf00efea87b1e"}}

the git url is changed to github.com/babashka/pods

cognitect/test-runner
             {:git/url "https://github.com/cognitect-labs/test-runner"
              :git/sha "9d36f36ff541dac680a05010e4348c744333f191"}

the git url is changed to github.com/cognitect/test-runner

Suggestion: never change the git url

cc @teodorlu if you're bored :)

teodorlu commented 3 months ago

Happy to take this one!

teodorlu commented 3 months ago

I may be missing something—in my local testing, neil dep upgrade doesn't seem to change anything for the examples with pods and test-runner.

Any advice?

babashka pods

$ cat deps.edn
{:deps
 {babashka/pods {#_#_:local/root "/Users/borkdude/Dropbox/dev/clojure/babashka/babashka.pods"
                 :git/url "https://github.com/babashka/babashka.pods"
                 :git/sha "47e55fe5e728578ff4dbf7d2a2caf00efea87b1e"}}}
$ neil dep upgrade
$ cat deps.edn 
{:deps
 {babashka/pods {#_#_:local/root "/Users/borkdude/Dropbox/dev/clojure/babashka/babashka.pods"
                 :git/url "https://github.com/babashka/babashka.pods"
                 :git/sha "47e55fe5e728578ff4dbf7d2a2caf00efea87b1e"}}}
$ neil --version
neil 0.3.67
$ brew info neil
==> babashka/brew/neil: stable 0.3.67

Installed
/opt/homebrew/Cellar/neil/0.3.67 (7 files, 85.8KB) *
  Built from source on 2024-08-02 at 20:03:03
From: https://github.com/babashka/homebrew-brew/blob/HEAD/Formula/neil.rb
==> Dependencies
Required: borkdude/brew/babashka ✔
$ neil-dev dep upgrade
$ cat deps.edn 
{:deps
 {babashka/pods {#_#_:local/root "/Users/borkdude/Dropbox/dev/clojure/babashka/babashka.pods"
                 :git/url "https://github.com/babashka/babashka.pods"
                 :git/sha "47e55fe5e728578ff4dbf7d2a2caf00efea87b1e"}}}

cognitect test runner

$ cat deps.edn 
{:deps {cognitect/test-runner
        {:git/url "https://github.com/cognitect-labs/test-runner"
         :git/sha "9d36f36ff541dac680a05010e4348c744333f191"}}}
$ neil dep upgrade          
$ cat deps.edn
{:deps {cognitect/test-runner
        {:git/url "https://github.com/cognitect-labs/test-runner"
         :git/sha "9d36f36ff541dac680a05010e4348c744333f191"}}}
$ neil-dev dep upgrade
$ cat deps.edn        
{:deps {cognitect/test-runner
        {:git/url "https://github.com/cognitect-labs/test-runner"
         :git/sha "9d36f36ff541dac680a05010e4348c744333f191"}}}
borkdude commented 3 months ago

Perhaps this is because neil dep upgrade didn't actually upgrade anything in your last example? I ran neil dep upgrade on clj-kondo before pinning the test runner, so if you remove :neil/pinned true you should be able to replicate it.

teodorlu commented 3 months ago

That was it.

  1. No upgrades -> no git URL changes
  2. Upgrades -> potential unwanted git URL changes.

Thanks!