babashka / neil

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

Don't drop `:exclusions` when running `neil dep add` or `neil dep upgrade` #190

Closed teodorlu closed 10 months ago

teodorlu commented 10 months ago

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

teodorlu commented 10 months ago

This is the test that fails:

https://github.com/teodorlu/neil/blob/ab7e5ffa92bbdb3dcbeac26a4fe6da985487faa6/test/babashka/neil/dep_upgrade_test.clj#L133

A deps.edn file that had a :sha version keeps that version around (per ab7e5ff). Example:

$ cat deps.edn 
{:deps {clj-kondo/clj-kondo
                            {:git/url "https://github.com/clj-kondo/clj-kondo"
                             :sha "6ffc3934cb83d2c4fff16d84198c73b40cd8a078"}}}
$ neil-dev dep upgrade
:action "upgrading" :lib clj-kondo/clj-kondo :current-version nil :sha 8d1531b23485815ab26a7da10eac9950ecc2338d
$ cat deps.edn 
{:deps {clj-kondo/clj-kondo
                            {:git/url "https://github.com/clj-kondo/clj-kondo"
                             :sha "6ffc3934cb83d2c4fff16d84198c73b40cd8a078"
                             :git/sha "8d1531b23485815ab26a7da10eac9950ecc2338d"}}}

bad! This even causes clj to error:

$ clj
Error building classpath. git coord has both :sha and :git/sha for clj-kondo/clj-kondo
teodorlu commented 10 months ago

How about using reference-style markdown links for CHANGELOG.md?

Currently, we write the CHANGELOG like this (scroll right):

- [#181](https://github.com/babashka/neil/issues/181): fix `neil --version`
- fix tests by referring to latest hiccup ([@teodorlu](https://github.com/teodorlu))
- [#180](https://github.com/babashka/neil/issues/180): `neil dep upgrade`: allow upgrading from an unstable version to the latest unstable version ([@teodorlu](https://github.com/teodorlu))
- [#180](https://github.com/babashka/neil/issues/180): `neil dep upgrade`: with `--unstable`, opt-into unstable library updates ([@teodorlu](https://github.com/teodorlu))
- [#183](https://github.com/babashka/neil/issues/183): Don't drop `:exclusions` when running `neil dep add` or `neil dep upgrade` ([@borkdude](https://github.com/borkdude) and [@teodorlu](https://github.com/teodorlu))

With the proposed link format, we'd write the CHANGELOG like this (scroll right):

- [#181](https://github.com/babashka/neil/issues/181): fix `neil --version`
- fix tests by referring to latest hiccup ([@teodorlu])
- [#180](https://github.com/babashka/neil/issues/180): `neil dep upgrade`: allow upgrading from an unstable version to the latest unstable version ([@teodorlu])
- [#180](https://github.com/babashka/neil/issues/180): `neil dep upgrade`: with `--unstable`, opt-into unstable library updates ([@teodorlu])
- [#183](https://github.com/babashka/neil/issues/183): Don't drop `:exclusions` when running `neil dep add` or `neil dep upgrade` ([@borkdude] and [@teodorlu])

[@borkdude]: https://github.com/borkdude
[@teodorlu]: https://github.com/teodorlu

That way, we can write [@borkdude] and have the link to https://github.com/borkdude/ work automatically. Thoughts?

borkdude commented 10 months ago

I'm using script/changelog.clj to render these links after typing, but if your suggested way renders the exact same way, I'd be down with that.

borkdude commented 10 months ago

Thanks a lot!