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

new better release settings #2732

Merged
merged 4 commits into from
Feb 27, 2019
Merged

Conversation

kailuowang
Copy link
Contributor

@kailuowang kailuowang commented Feb 15, 2019

The old release steps are from the sbt 0.13 era. Now that modular crossScalaVersions issue is improved in sbt 1.x, we need to switch to this new release steps - i.e. the root module should have a Nil crossScalaVersions setting, then each module can have their own crossScalaVersions settings and release accordingly.
This change also reduced significantly the number of unnecessary settings on the root module - which fixes #2730

To test this build code, I released a 0.0.1-DONOTUSE, and tested with cats-tagless

@codecov-io
Copy link

codecov-io commented Feb 15, 2019

Codecov Report

Merging #2732 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2732      +/-   ##
==========================================
+ Coverage   95.13%   95.14%   +0.01%     
==========================================
  Files         365      365              
  Lines        6799     6816      +17     
  Branches      304      297       -7     
==========================================
+ Hits         6468     6485      +17     
  Misses        331      331
Impacted Files Coverage Δ
.../scala/cats/laws/discipline/ArrowChoiceTests.scala 100% <0%> (ø) ⬆️
.../main/scala/cats/laws/discipline/StrongTests.scala 100% <0%> (ø) ⬆️
laws/src/main/scala/cats/laws/StrongLaws.scala 100% <0%> (ø) ⬆️
...c/main/scala/cats/laws/discipline/ArrowTests.scala 100% <0%> (ø) ⬆️
...a/cats/laws/discipline/CommutativeArrowTests.scala 100% <0%> (ø) ⬆️

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 663f654...9c73039. Read the comment docs.

@LukaJCB LukaJCB self-requested a review February 15, 2019 16:41
Copy link
Contributor

@ceedubs ceedubs left a comment

Choose a reason for hiding this comment

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

Thanks, @kailuowang! Generally sounds good to me; I just had a question or two.

I've also wondered whether we should switch to using sbt-ci-release. With cross-versioning we'd have to get a bit wordier in our Travis config, and I think that we might need to make our builds a bit more stable first, but it may be able to reduce the developer burden of publishing.

build.sbt Outdated
.settings(moduleName := "root")
.settings(catsSettings)
.settings(moduleName := "root", crossScalaVersions := Nil)
.settings(publishSettings)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks a little weird to have publishSettings followed by noPublishSettings. This is intentional, right? If so, it might be helpful to have a brief comment about why this is being done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I added some comment here. The basic thing is that sbt release command is run through aggregation from this root module. Thus it requires some release settings, then the noPublishSettings makes sure the module itself is not published.

@@ -825,12 +824,11 @@ lazy val sharedReleaseProcess = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommand("validate"),
releaseStepCommandAndRemaining("+validate"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a switch from running validate from the current version to all versions? If so, does this lead to OOMs or anything?

Copy link
Contributor Author

@kailuowang kailuowang Feb 16, 2019

Choose a reason for hiding this comment

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

Not really. Before the validate is still run against all scala versions because the crossScalaVersions settings on the root module and the releaseCrossBuild := true. sbt release automatically runs certain steps on each modules against all crossScalaVersions set on the root module. Now, with the new sbt version , the +validate will performe on each aggregated module correctly on their own crossScalaVersions. The root module's crossScalaVersions should set as Nil, otherwise it will conflict with the aggregrated module's crossScalaVersion.

@frosforever
Copy link
Contributor

Verifying this does indeed fix #2730. Thanks @kailuowang!

@ceedubs
Copy link
Contributor

ceedubs commented Feb 16, 2019

Thanks, @kailuowang! LGTM but it looks like scalafmt is complaining about formatting in build.sbt.

build.sbt Outdated
.settings(noPublishSettings)
.settings(moduleName := "root", crossScalaVersions := Nil)
.settings(publishSettings) // these settings are needed to release all aggregated modules under this root module
.settings(noPublishSettings) // this is to exclue the root module itself from being published.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.settings(noPublishSettings) // this is to exclue the root module itself from being published.
.settings(noPublishSettings) // this is to exclue the root module itself from being published.

There is a dangling space at the end of this line. I've removed it in this suggestion.

@ceedubs
Copy link
Contributor

ceedubs commented Feb 18, 2019

@kailuowang once you fix the build.sbt formatting issue, you may run into an issue where now SBT complains about the build's sbt ++TRAVIS_SCALA_VERSION commands for projects that don't have that version number listed in their crossScalaVersions. If so, I think that #2737 fixes this issue. Though I'm not sure that adding the ! to the command is the best solution. It's possible that we should be removing 2.13 from the crossScalaVersion and that we should explicitly add a ! to the 2.13 tests. Not sure what the best approach is.

@kailuowang
Copy link
Contributor Author

Thanks @ceedubs. I will be traveling without laptop for a week, if you want to, feel free to merge this PR into #2737

@kailuowang
Copy link
Contributor Author

@LukaJCB any feedback?

Copy link
Member

@LukaJCB LukaJCB left a comment

Choose a reason for hiding this comment

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

I'm really not an sbt expert, but the changes do make sense to me :)

@kailuowang kailuowang merged commit bc54c8a into typelevel:master Feb 27, 2019
@kailuowang kailuowang deleted the improve-release branch February 27, 2019 18:03
@kailuowang kailuowang added this to the 2.0.0-M1 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants