Unsupported upgrade message could be more informative
While looking at #274, I noticed that the unsupported upgrade message could be more informative than it currently is.
Scenario
Let's set up a playground with an upgradeable bb.edn and non-upgradeable build.gradle
deps.edn
{:deps {etaoin/etaoin {:mvn/version "1.1.42"}}}
build.gradle (stolen from antq tests)
plugins {
id 'java-library'
}
repositories {
mavenCentral()
maven {
name = 'clojars'
url = 'https://repo.clojars.org'
}
}
dependencies {
implementation 'org.clojure:clojure:1.10.0'
testRuntimeOnly 'org.ajoberstar:jovial:0.3.0'
testImplementation 'org.clojure:tools.namespace:1.0.0'
}
task antq_list_repositories {
doLast {
project.repositories.each { println "ANTQ;" + it.name + ";" + it.url }
}
}
An interactive upgrade is probably fine
clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version "2.11.1276"}}}' -M -m antq.core --upgrade
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[##################################################] 4/4
| :file | :name | :current | :latest |
|--------------|-----------------------------|----------|---------|
| build.gradle | org.clojure/clojure | 1.10.0 | 1.12.0 |
| | org.clojure/tools.namespace | 1.0.0 | 1.5.0 |
| deps.edn | etaoin/etaoin | 1.0.39 | 1.1.42 |
Available changes:
- https://github.com/clojure/clojure/blob/clojure-1.12.0/changes.md
- https://github.com/clojure/tools.namespace/blob/v1.5.0/CHANGES.md
- https://github.com/clj-commons/etaoin/blob/v1.1.42/CHANGELOG.adoc
Do you want to upgrade etaoin/etaoin '1.0.39' to '1.1.42' in deps.edn (y/n): y
Upgraded etaoin/etaoin '1.0.39' to '1.1.42' in deps.edn.
Do you want to upgrade org.clojure/tools.namespace '1.0.0' to '1.5.0' in build.gradle (y/n): y
gradle: Not supported yet.
Do you want to upgrade org.clojure/clojure '1.10.0' to '1.12.0' in build.gradle (y/n): y
gradle: Not supported yet.
The message gradle: Not supported yet is probably good enough because we also have the interactive prompt to describe the dependency.
An automated upgrade lacks some detail
clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version "2.11.1276"}}}' -M -m antq.core --upgrade --force
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[##################################################] 4/4
| :file | :name | :current | :latest |
|--------------|-----------------------------|----------|---------|
| build.gradle | org.clojure/clojure | 1.10.0 | 1.12.0 |
| | org.clojure/tools.namespace | 1.0.0 | 1.5.0 |
| deps.edn | etaoin/etaoin | 1.0.39 | 1.1.42 |
Available changes:
- https://github.com/clojure/clojure/blob/clojure-1.12.0/changes.md
- https://github.com/clojure/tools.namespace/blob/v1.5.0/CHANGES.md
- https://github.com/clj-commons/etaoin/blob/v1.1.42/CHANGELOG.adoc
Upgraded etaoin/etaoin '1.0.39' to '1.1.42' in deps.edn.
gradle: Not supported yet.
gradle: Not supported yet.
I find gradle: Not supported yet. a bit terse.
Proposal
What do you think of this instead?:
[##################################################] 4/4
| :file | :name | :current | :latest |
|--------------|-----------------------------|----------|---------|
| build.gradle | org.clojure/clojure | 1.10.0 | 1.12.0 |
| | org.clojure/tools.namespace | 1.0.0 | 1.5.0 |
| deps.edn | etaoin/etaoin | 1.0.39 | 1.1.42 |
Available changes:
- https://github.com/clojure/clojure/blob/clojure-1.12.0/changes.md
- https://github.com/clojure/tools.namespace/blob/v1.5.0/CHANGES.md
- https://github.com/clj-commons/etaoin/blob/v1.1.42/CHANGELOG.adoc
Upgraded etaoin/etaoin '1.0.39' to '1.1.42' in deps.edn.
SKIPPED upgrade of org.clojure/tools.namespace '1.0.0' to '1.5.0' in build.gradle - antq does not support upgrading gradle dependencies.
SKIPPED upgrade of org.clojure/clojure '1.10.0' to '1.12.0' in build.gradle - antq does not support upgrading gradle dependencies.
(compare last 2 lines of this output to the above output)
The same messaging would be used for both --ugrade and --upgrade --force.
Happy to tweak messaging if necessary.
This more detailed messaging would be more in line with what I'm thinking for non-upgradeable lein-loaded dependencies for #274.
Whatcha think?
Oh and: very happy to do a wee PR for this if you agree it is a good idea.
@lread Sorry for late reply.
The message shown with --force is definitely unfriendly, so your proposal looks good to me :)