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

[2.8.x]: Fix release process #352

Merged
merged 2 commits into from
Nov 26, 2019
Merged

[2.8.x]: Fix release process #352

merged 2 commits into from
Nov 26, 2019

Conversation

marcospereira
Copy link
Member

Two major problems:

  1. It was not promoting the staged repository
  2. It was generating multiple staging repositories

This should fix both by using the defaults provided by interplay.

Two major problems:

1. It was not promoting the staged repository
2. It was generating two staged repositories

This should fix both by using the defaults provided by interplay.
@marcospereira marcospereira changed the base branch from master to 2.8.x November 19, 2019 23:22
@octonato
Copy link
Contributor

@marcospereira, something went wrong in Travis. Build is failing with error in build definition.

@ignasi35
Copy link
Member

@marcospereira, something went wrong in Travis. Build is failing with error in build definition.

Failed to sort List(
  interplay.PlayNoPublishBase, 
  org.scalajs.sbtplugin.ScalaJSPlugin, 
  interplay.PlayRootProjectBase, 
  sbt.plugins.CorePlugin, 
  interplay.PlaySonatypeBase, 
  sbt.plugins.JvmPlugin, 
  interplay.PlayBuildBase, 
  interplay.PlayReleaseBase, 
  sbt.plugins.IvyPlugin, 
  sbt.plugins.Giter8TemplatePlugin, 
  scalajscrossproject.ScalaJSCrossPlugin, 
  interplay.PlayBintrayBase, 
  de.heikoseeberger.sbtheader.HeaderPlugin, 
  org.scalafmt.sbt.ScalafmtPlugin, 
  org.scalajs.sbtplugin.internal.ScalaJSGlobalPlugin, 
  sbtwhitesource.WhiteSourcePlugin, 
  com.typesafe.tools.mima.plugin.MimaPlugin, 
  org.portablescala.sbtplatformdeps.PlatformDepsPlugin, 
  sbt.plugins.SemanticdbPlugin, 
  sbt.plugins.JUnitXmlReportPlugin, 
  sbtcrossproject.CrossPlugin, 
  com.jsuereth.sbtpgp.SbtPgp, 
  sbtrelease.ReleasePlugin, 
  interplay.PlayWhitesourcePlugin) 
topologically

Sounds like a cyclical dependency on the plugins.

build.sbt Outdated
@@ -132,18 +126,15 @@ lazy val commonSettings = Def.settings(

lazy val root = project
.in(file("."))
.enablePlugins(PlayRootProject, ScalaJSPlugin)
.enablePlugins(PlayRootProject, ScalaJSPlugin, PlayNoPublish)
Copy link
Member

Choose a reason for hiding this comment

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

(I'll ignore ScalaJSPlugin)

The enablePlugins above can be expanded to:

  1. PlayRootProject expands to PlayRootProjectBase &&! PlaySbtCompat.optScriptedAutoPlugin
  2. PlayNoPublish expands to PlayNoPublishBase &&! BintrayPlugin &&! Sonatype

Then we have:

enablePlugins(
  PlayRootProjectBase &&! PlaySbtCompat.optScriptedAutoPlugin, // exclude(ScriptedAutoPlugin)
  PlayNoPublishBase &&! BintrayPlugin &&! Sonatype // exclude(BintrayPlugin, Sonatype)
)

Now, PlayRootProjectBase brings some stuff transitively:

object PlayRootProjectBase extends AutoPlugin {
  override def trigger = noTrigger
  override def requires = PlayBuildBase && PlayBintrayBase && PlaySonatypeBase && PlayReleaseBase

So the end result looks like:

enablePlugins(
  PlayRootProjectBase &&! PlaySbtCompat.optScriptedAutoPlugin, // exclude(ScriptedAutoPlugin)
  PlayBuildBase, 
  PlayBintrayBase,  // brings `BintrayPlugin` transitively
  PlaySonatypeBase, // brings `Sonatype` transitively
  PlayReleaseBase,

  PlayNoPublishBase &&! BintrayPlugin &&! Sonatype // exclude(BintrayPlugin, Sonatype)
  PlayBuildBase,    // transitively added by `PlayNoPublishBase`
)

Which, I guess, looks like:

enablePlugins(
  PlayRootProjectBase
  PlayBuildBase, 
  PlayReleaseBase,
  PlayNoPublishBase
)

IIUC, the purpose is to not publish the root project. In that case, we don't want PlayReleaseBase.

Then, we could be tempted to also remove PlayRootProjectBase (which is the one bringing in PlayReleaseBase but PlayRootProjectBase is defining the crossScalaVersions)

I don't know what I'm talking about anymore.


OMG, this is so confusing.

According to the docs this aggregating root project should be a PlayRootProject and then, each of the aggregated projects that must not be published should be PlayNoPublish.

Ofc, interplay being created before sbt 1.x it's possible that some assumptions no longer hold true in the sbt 1.3+ ecosystem.

Copy link
Member

Choose a reason for hiding this comment

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

I think the NoPublish is unnecessary and your change above:


  publishTo := Some(
    if (isSnapshot.value)
      Opts.resolver.sonatypeSnapshots
    else
      Opts.resolver.sonatypeStaging
  ),

is enough.

@ignasi35 ignasi35 requested a review from octonato November 22, 2019 17:11
build.sbt Outdated
@@ -126,7 +126,7 @@ lazy val commonSettings = Def.settings(

lazy val root = project
.in(file("."))
.enablePlugins(PlayRootProject, ScalaJSPlugin, PlayNoPublish)
Copy link
Member Author

Choose a reason for hiding this comment

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

As PlayNoPublish was removed, we need to add the settings manually. I think publish / skip := true should be enough (as documented here) but maybe re-add publishTo: None as well.

Copy link
Member

Choose a reason for hiding this comment

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

publish / skip := true is what we use in other projects (eg https://github.com/playframework/play-grpc/blob/master/project/Publish.scala#L13).

I've ran show publishTo with this setup and the root project reports no target (which is what I think we wanted).

How about we merge and we revisit this on the next release?

@marcospereira marcospereira merged commit 2dae1d2 into playframework:2.8.x Nov 26, 2019
@marcospereira marcospereira deleted the build/fix-release-process branch November 26, 2019 20:05
octonato added a commit that referenced this pull request Nov 28, 2019
[2.8.x]: Fix release process (bp #352)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants