Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic sbt-scalafix version #2475

Merged
merged 3 commits into from
Jan 24, 2022
Merged

dynamic sbt-scalafix version #2475

merged 3 commits into from
Jan 24, 2022

Conversation

mzuehlke
Copy link
Member

Retrieve the latest sbt-scalafix plugin version from coursier (versionCache) instead of relying on a hardcoded version.

Fixes #2357

Retrieve the latest `sbt-scalafix` plugin version from coursier (`versionCache`) instead of relying on a hard coded version.
@fthomas
Copy link
Member

fthomas commented Jan 23, 2022

This is great!

@fthomas fthomas added the enhancement New feature or request label Jan 23, 2022
@fthomas fthomas added this to the 0.14.0 milestone Jan 23, 2022
* use resolver from the config, instead of hard wiring maven central
@mzuehlke
Copy link
Member Author

Thanks for the comments @fthomas
I'm not sure how to get the test reliable. Depending on wether the data is in the cache or not the executed command are different. One idea wold be to run the cmd sbtAlg.runMigration... twice.
The 1st to make sure the cache is properly filled but don't look at the state afterwards and the 2nd to assert the expect change. Doesn't look that nice. Or reduce the TTL to 0 then we in tests always expect value to be written to the cache. But this would make the test slower....

@fthomas
Copy link
Member

fthomas commented Jan 24, 2022

Another option could be to add a
/tmp/scala-steward/workspace/store/versions/v2/https/repo1.maven.org/maven2/ch/epfl/scala/sbt-scalafix_2.12_1.0/versions.json to the initial MockState so that VersionsCache always reads the versions from that file.

@codecov
Copy link

codecov bot commented Jan 24, 2022

Codecov Report

Merging #2475 (bd096e8) into master (b0699bf) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2475      +/-   ##
==========================================
+ Coverage   81.11%   81.20%   +0.08%     
==========================================
  Files         142      142              
  Lines        2468     2479      +11     
  Branches       41       59      +18     
==========================================
+ Hits         2002     2013      +11     
  Misses        466      466              
Impacted Files Coverage Δ
...a/org/scalasteward/core/buildtool/sbt/SbtAlg.scala 98.11% <100.00%> (+0.15%) ⬆️
.../org/scalasteward/core/buildtool/sbt/package.scala 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0699bf...bd096e8. Read the comment docs.

@mzuehlke mzuehlke merged commit 9ebf96e into master Jan 24, 2022
@mzuehlke mzuehlke deleted the dynamic-sbt-scalafix-version branch January 24, 2022 14:06
@bjaglin
Copy link
Contributor

bjaglin commented Apr 3, 2022

Cool feature! Does this pick up RC releases as well? I am curious to know if/how I could test the impact of https://github.com/scalacenter/sbt-scalafix/releases/tag/v0.10.0-RC1 (particularly for scalacenter/sbt-scalafix#292).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not hardcode sbt-scalafix version
3 participants