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

Add config key for default maven repo and self check url #1899

Merged

Conversation

meier-christoph
Copy link
Contributor

This PR adds a few additional arguments to cli and config for the default maven repo and the self check uri.

For a full offline run add :

--self-check-uri https://github.example.org \
--default-maven-repo https://nexus.example.org \
--scalafix-migrations /data/config/scalafix-migrations.conf \
--artifact-migrations /data/config/artifact-migrations.conf \
--disable-default-scalafix-migrations

We are using scala-steward in a closed environment with github enterprise and are currently running a fork of scala-steward v0.8, this is a cherry pick from our fork as we would like to switch over to the github apps variant asap

@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #1899 (bd627df) into master (d901845) will decrease coverage by 0.01%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1899      +/-   ##
==========================================
- Coverage   78.74%   78.72%   -0.02%     
==========================================
  Files         131      131              
  Lines        2263     2266       +3     
  Branches       65       58       -7     
==========================================
+ Hits         1782     1784       +2     
- Misses        481      482       +1     
Impacted Files Coverage Δ
.../scala/org/scalasteward/core/application/Cli.scala 96.15% <ø> (ø)
...ala/org/scalasteward/core/application/Config.scala 97.29% <75.00%> (-2.71%) ⬇️
...la/org/scalasteward/core/application/Context.scala 86.44% <100.00%> (ø)
...g/scalasteward/core/application/SelfCheckAlg.scala 100.00% <100.00%> (ø)
...lasteward/core/buildtool/BuildToolDispatcher.scala 78.94% <100.00%> (ø)
...a/org/scalasteward/core/buildtool/sbt/SbtAlg.scala 94.87% <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 d901845...bd627df. Read the comment docs.

@fthomas
Copy link
Member

fthomas commented Feb 1, 2021

I've two questions. Why would you want to override the URL for UrlChecker and how do you override the default Maven repository in other tools like Coursier and sbt? I could imagine that if you're already overriding the default Maven repository for Coursier, maybe we could always query it from Coursier so that there would be no need to override it in Scala Steward too.

@meier-christoph
Copy link
Contributor Author

We have our own github enterprise running on-prem in an isolated network. The self check would just fail and timeout after a few seconds since github.com is not reachable.

We only use sbt (which is why I haven't touched mill and I am not very familiar with it) and you can actually override the repositories that are used via SBT_OPTS e.g. -Dsbt.repository.config=<file with urls to enterprise repo> and -Dsbt.override.build.repos=true.

If you are using coursier via cli you can also set the repository using args or as environment variable but we don't use coursier outside of sbt v1.

To be honnest I wasn't sure what scala-steward was using the default maven repo for. There was a lot of trial and error befor it worked. For example, I had to build a new container and pre-build scalafmt in standalone mode as by default it would try to fetch some dependencies on the first run via coursier.

@fthomas
Copy link
Member

fthomas commented Feb 26, 2021

Thanks for the explanation, @meier-christoph. I'm OK with merging this but could please change --self-check-uri to --url-checker-test-url or --url-checker-self-check-url? I think that makes it clearer that the purpose of this URL is to check that the UrlChecker works.

@fthomas fthomas added the enhancement New feature or request label Feb 26, 2021
@fthomas fthomas added this to the 0.10.0 milestone Feb 26, 2021
@meier-christoph
Copy link
Contributor Author

@fthomas thanks for the feedback, I made the changes as you suggested.

Copy link
Member

@fthomas fthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fthomas fthomas merged commit 46a0e57 into scala-steward-org:master Mar 5, 2021
fthomas added a commit that referenced this pull request Dec 6, 2023
... instead of hardcoding Maven Central. If the default resolver is not
overridden it, it will be Maven Central, so nothing will change in this
case.

I'm doing this for the same reason as given in
#1899 where the
hardcoded Maven Central was replaced in `SbtAlg` with the default
resolver.
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.

2 participants