Repository: scala-steward-org/scala-steward (scala)

Issue:
Found 1 update ... no files were changed
Hi,

Scala steward works great on most of our projects. However some dependency updates do not get their MR.

It seems to be in the case where the version for the update is "shared" between several libraries from the same group.

The 3 scala-opentracing libraries should upgrade at the same time.

Here an extract of the sbt build:
```scala
import sbt._

object Versions {
  val cats                = "2.1.1"
  val catsEffect          = "2.1.4"
  val circe               = "0.13.0"
  val tracing             = "2.4.1"
}

object CompileTimeDependencies {
  val cats                   = "org.typelevel"                               %% "cats-core"                             % Versions.cats
  val catsEffect             = "org.typelevel"                               %% "cats-effect"                           % Versions.catsEffect
  val circe                  = "io.circe"                                    %% "circe-core"                            % Versions.circe
  val circeGeneric           = "io.circe"                                    %% "circe-generic"                         % Versions.circe
  val circeRefined           = "io.circe"                                    %% "circe-refined"                         % Versions.circe
  val tracing                = "com.colisweb"                                %% "scala-opentracing-core"                % Versions.tracing
  val tracingContext         = "com.colisweb"                                %% "scala-opentracing-context"             % Versions.tracing
  val tracingHttp4s          = "com.colisweb"                                %% "scala-opentracing-http4s-server-tapir" % Versions.tracing
}

```

And the logs:

```
2020-09-01 05:20:27,479 INFO  ──────────── Nurture colisweb/back/ddd-packing-api ────────────
2020-09-01 05:20:27,479 INFO  Clone and synchronize colisweb/back/ddd-packing-api
2020-09-01 05:20:27,658 INFO  Parsed RepoConfig(CommitsConfig(None),PullRequestsConfig(None),UpdatesConfig(List(),List(),List(),None),Always)
2020-09-01 05:20:27,658 INFO  Found 1 update:
  com.colisweb:{(scala-opentracing-context, scala-opentracing-context_2.12), (scala-opentracing-core, scala-opentracing-core_2.12), (scala-opentracing-http4s-server-tapir, scala-opentracing-http4s-server-tapir_2.12)} : 2.4.1 -> 2.5.0
2020-09-01 05:20:27,667 INFO  Process update com.colisweb:{(scala-opentracing-context, scala-opentracing-context_2.12), (scala-opentracing-core, scala-opentracing-core_2.12), (scala-opentracing-http4s-server-tapir, scala-opentracing-http4s-server-tapir_2.12)} : 2.4.1 -> 2.5.0
2020-09-01 05:20:27,836 INFO  Trying heuristic 'moduleId'
2020-09-01 05:20:27,847 INFO  Trying heuristic 'strict'
2020-09-01 05:20:27,861 INFO  Trying heuristic 'original'
2020-09-01 05:20:27,885 INFO  Trying heuristic 'relaxed'
2020-09-01 05:20:27,895 INFO  Trying heuristic 'sliding'
2020-09-01 05:20:27,908 INFO  Trying heuristic 'completeGroupId'
2020-09-01 05:20:27,915 INFO  Trying heuristic 'groupId'
2020-09-01 05:20:27,922 INFO  Trying heuristic 'specific'
2020-09-01 05:20:27,927 WARN  No files were changed
2020-09-01 05:20:27,945 INFO  ──────────── Total time: Nurture colisweb/back/ddd-packing-api: 466ms ────────────
2020-09-01 05:20:27,946 INFO  ──────────── Total time: Steward colisweb/back/ddd-packing-api: 49s 605ms ───────────
```

Pull request:
reproduce #1586

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala b/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
index c7b9b138df..deeb34cf72 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
@@ -171,7 +171,7 @@ object UpdateHeuristic {
   val sliding = UpdateHeuristic(
     name = "sliding",
     replaceVersion = defaultReplaceVersion(
-      _.mainArtifactId.toSeq.sliding(5).map(_.unwrap).take(5).filterNot(_ === "scala").toList
+      _.mainArtifactId.toSeq.sliding(5).map(_.unwrap).filterNot(_ === "scala").toList
     )
   )
 


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
index 5a22bc7c95..054a5d0153 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
@@ -442,6 +442,27 @@ class UpdateHeuristicTest extends AnyFunSuite with Matchers {
       ._1 shouldBe None
   }
 
+  test("cognito value for aws-java-sdk-cognitoidp artifact") {
+    val original = """val cognito       = "1.11.690" """
+    val expected = """val cognito       = "1.11.700" """
+    Single("com.amazonaws" % "aws-java-sdk-cognitoidp" % "1.11.690", Nel.of("1.11.700"))
+      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.sliding.name)
+  }
+
+  test("issue 1586 - tracing value for opentracing library") {
+    val original = """val tracing = "2.4.1" """
+    val expected = """val tracing = "2.5.0" """
+    Group(
+      "com.colisweb" % Nel.of(
+        "scala-opentracing-core",
+        "scala-opentracing-context",
+        "scala-opentracing-http4s-server-tapir"
+      ) % "2.4.1",
+      Nel.of("2.5.0")
+    )
+      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.sliding.name)
+  }
+
   test("fail on versions duplicated in a comment") {
     val original = """val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.3""""
     val expected = """val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.4""""