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

chore(deps): Non-AWS dependency updates #96

Closed
wants to merge 13 commits into from

Conversation

gu-scala-steward-public-repos[bot]
Copy link
Contributor

@gu-scala-steward-public-repos gu-scala-steward-public-repos bot commented Feb 14, 2024

About this PR

Updates:

Usage

Please merge!

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a .scala-steward.conf file.

Have a fantastic day writing Scala!

⚙ Adjust future updates

Add these to your .scala-steward.conf file to ignore future updates of these dependencies:

updates.ignore = [
  { groupId = "com.github.sbt", artifactId = "sbt-release" },
  { groupId = "com.gu", artifactId = "content-atom-model" },
  { groupId = "com.gu", artifactId = "fezziwig" },
  { groupId = "com.twitter", artifactId = "scrooge-core" },
  { groupId = "com.twitter", artifactId = "scrooge-serializer" },
  { groupId = "com.typesafe.play", artifactId = "play-guice" },
  { groupId = "com.typesafe.play", artifactId = "sbt-plugin" },
  { groupId = "io.circe", artifactId = "circe-parser" },
  { groupId = "org.mockito", artifactId = "mockito-core" },
  { groupId = "org.scala-lang", artifactId = "scala-library" },
  { groupId = "org.scala-lang.modules", artifactId = "scala-collection-compat" },
  { groupId = "org.scala-sbt", artifactId = "sbt" },
  { groupId = "org.scala-sbt", artifactId = "sbt-dependency-tree" },
  { groupId = "org.scalatest", artifactId = "scalatest" },
  { groupId = "org.scalatestplus", artifactId = "mockito-4-6" },
  { groupId = "org.typelevel", artifactId = "cats-core" }
]

Or, add these to slow down future updates of these dependencies:

dependencyOverrides = [
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.github.sbt", artifactId = "sbt-release" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.gu", artifactId = "content-atom-model" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.gu", artifactId = "fezziwig" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.twitter", artifactId = "scrooge-core" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.twitter", artifactId = "scrooge-serializer" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.typesafe.play", artifactId = "play-guice" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "com.typesafe.play", artifactId = "sbt-plugin" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "io.circe", artifactId = "circe-parser" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.mockito", artifactId = "mockito-core" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scala-lang", artifactId = "scala-library" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scala-lang.modules", artifactId = "scala-collection-compat" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scala-sbt", artifactId = "sbt" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scala-sbt", artifactId = "sbt-dependency-tree" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scalatest", artifactId = "scalatest" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.scalatestplus", artifactId = "mockito-4-6" }
  },
  {
    pullRequests = { frequency = "30 days" },
    dependency = { groupId = "org.typelevel", artifactId = "cats-core" }
  }
]
labels: dependencies, sbt-plugin-update, library-update, test-library-update, early-semver-minor, semver-spec-minor, early-semver-patch, semver-spec-patch, version-scheme:early-semver, early-semver-major, semver-spec-major, commit-count:n:13

@rtyley
Copy link
Member

rtyley commented Feb 14, 2024

This PR contained Play upgrades from 2.9 to 3.0, but that would require a bit more work! In the meantime, I've removed all play-related commits from this PR, and the tests now pass.

rtyley added a commit to guardian/gha-scala-library-release-workflow that referenced this pull request Feb 16, 2024
The branch name of `update/non_aws` caused problems with the PREVIEW release
workflow in this recent run for guardian/atom-maker#96:

https://github.com/guardian/atom-maker/actions/runs/7905475560/job/21578205513

We saw this error from `sbt-release`:

```
Version [3.0.0-PREVIEW.updatenon_aws.2024-02-14T1807.431c7567] format is not compatible with ([0-9]+)((?:\.[0-9]+)+)?([\.\-0-9a-zA-Z]*)?
```

You can see that the existing branch-name-cleanup code in `gha-scala-library-release-workflow`
(see https://github.com/guardian/gha-scala-library-release-workflow/blob/26b2cde0632c786fea6a4fc4b40c7a3cfbaa68bb/.github/workflows/reusable-release.yml#L87 ,
and in particular the `${GITHUB_REF_NAME//[^[:alnum:]-_]/}` part)
has already done a bit of cleanup on the original branch name `update/non_aws` -
making it into `updatenon_aws` with the slash (`/`) stripped out, but it's the
remaining _underscore_ (`_`) that's causing the problem - the regex `sbt-release` is using
for version numbers, defined here:

https://github.com/sbt/sbt-release/blob/v1.4.0/src/main/scala/Version.scala#L58

...specifically the `([\.\-0-9a-zA-Z]*)` bit, doesn't like underscores in version numbers,
so the `non_aws` part is no good, and we get the version format error.

Note that the current semver spec (2.0.0) has a tight constraint on allowable characters
in a version string:

  "Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]"
  -- https://semver.org/#spec-item-9

...so `sbt-release` is correct here, we shouldn't allow underscores.

Consequently, this change ensures we strip underscores too - you can check this at the
bash prompt like this:

```
$ GITHUB_REF_NAME="update/non_aws/roberto-tyley-is-da-coolest.so-true"
$ echo "-PREVIEW.${GITHUB_REF_NAME//[^[:alnum:]-]/}.$(date +%Y-%m-%dT%H%M)"
-PREVIEW.updatenonawsroberto-tyley-is-da-coolestso-true.2024-02-16T1503
```

It would probably be nicer to convert slashes and underscores to dashes, but this at least
should produce stuff that `sbt-release` doesn't mind.
Copy link

@rtyley has published a preview version of this PR with release workflow run #11, based on commit 431c756:

3.0.0-PREVIEW.updatenonaws.2024-02-21T1525.431c7567

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the update/non_aws branch, or use the GitHub CLI command:

gh workflow run release.yml --ref update/non_aws

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant