Repository: scala-steward-org/scala-steward
Pull request #2922 (2023-01-14 19:14:17)

Add `ForgeSpecificCfg` trait
This adds the `Config.ForgeSpecificCfg` trait which allows us to only pass config options to `ForgeSelection` that are relevant for the different `ForgeApiAlg`s instead of the complete `Config` object.

This simplifies the tests a little bit because we don't need create copies of `Config` to change forge specific configuration.

codecov[bot]: # [Codecov](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org) Report
Base: **90.02**% // Head: **89.90**% // Decreases project coverage by **`-0.11%`** :warning:
> Coverage data is based on head [(`1c2b037`)](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org) compared to base [(`86ad84a`)](https://codecov.io/gh/scala-steward-org/scala-steward/commit/86ad84a3a8914287b050eb1f2fbf6a68c28a4429?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org).
> Patch coverage: 73.33% of modified lines in pull request are covered.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #2922      +/-   ##
==========================================
- Coverage   90.02%   89.90%   -0.12%     
==========================================
  Files         154      154              
  Lines        3037     3042       +5     
  Branches      203      222      +19     
==========================================
+ Hits         2734     2735       +1     
- Misses        303      307       +4     
```


| [Impacted Files](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org) | Coverage Δ | |
|---|---|---|
| [...eward/core/forge/azurerepos/AzureReposApiAlg.scala](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org#diff-bW9kdWxlcy9jb3JlL3NyYy9tYWluL3NjYWxhL29yZy9zY2FsYXN0ZXdhcmQvY29yZS9mb3JnZS9henVyZXJlcG9zL0F6dXJlUmVwb3NBcGlBbGcuc2NhbGE=) | `95.65% <ø> (ø)` | |
| [...ala/org/scalasteward/core/application/Config.scala](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org#diff-bW9kdWxlcy9jb3JlL3NyYy9tYWluL3NjYWxhL29yZy9zY2FsYXN0ZXdhcmQvY29yZS9hcHBsaWNhdGlvbi9Db25maWcuc2NhbGE=) | `55.55% <33.33%> (-44.45%)` | :arrow_down: |
| [.../scala/org/scalasteward/core/application/Cli.scala](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org#diff-bW9kdWxlcy9jb3JlL3NyYy9tYWluL3NjYWxhL29yZy9zY2FsYXN0ZXdhcmQvY29yZS9hcHBsaWNhdGlvbi9DbGkuc2NhbGE=) | `100.00% <100.00%> (ø)` | |
| [...la/org/scalasteward/core/application/Context.scala](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org#diff-bW9kdWxlcy9jb3JlL3NyYy9tYWluL3NjYWxhL29yZy9zY2FsYXN0ZXdhcmQvY29yZS9hcHBsaWNhdGlvbi9Db250ZXh0LnNjYWxh) | `75.00% <100.00%> (ø)` | |
| [...a/org/scalasteward/core/forge/ForgeSelection.scala](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org#diff-bW9kdWxlcy9jb3JlL3NyYy9tYWluL3NjYWxhL29yZy9zY2FsYXN0ZXdhcmQvY29yZS9mb3JnZS9Gb3JnZVNlbGVjdGlvbi5zY2FsYQ==) | `100.00% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/scala-steward-org/scala-steward/pull/2922?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scala-steward-org).

fthomas: > Wouldn't it be possible to just store the `forgeSpecificCfg: ForgeSpecificCfg` as part of the `ForgeCfg` in the `Config` ?

Sure, but there are a few places where only the `ForgeCfg` is required but not the `ForgeSpecificCfg`. I therefore would like to keep them separate.

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/application/Cli.scala b/modules/core/src/main/scala/org/scalasteward/core/application/Cli.scala
index 9139132b..859e2640 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/application/Cli.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/application/Cli.scala
@@ -290,8 +290,8 @@ object Cli {
       "The Azure organization (required when --forge-type is azure-repos)"
     ).orNone
 
-  private val azureReposConfig: Opts[AzureReposConfig] =
-    azureReposOrganization.map(AzureReposConfig.apply)
+  private val azureReposCfg: Opts[AzureReposCfg] =
+    azureReposOrganization.map(AzureReposCfg.apply)
 
   private val refreshBackoffPeriod: Opts[FiniteDuration] = {
     val default = 0.days
@@ -338,7 +338,7 @@ object Cli {
     bitbucketCfg,
     bitbucketServerCfg,
     gitLabCfg,
-    azureReposConfig,
+    azureReposCfg,
     gitHubApp,
     urlCheckerTestUrls,
     defaultMavenRepo,
diff --git a/modules/core/src/main/scala/org/scalasteward/core/application/Config.scala b/modules/core/src/main/scala/org/scalasteward/core/application/Config.scala
index ae29852b..f5be851b 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/application/Config.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/application/Config.scala
@@ -65,7 +65,7 @@ final case class Config(
     bitbucketCfg: BitbucketCfg,
     bitbucketServerCfg: BitbucketServerCfg,
     gitLabCfg: GitLabCfg,
-    azureReposConfig: AzureReposConfig,
+    azureReposCfg: AzureReposCfg,
     githubApp: Option[GitHubApp],
     urlCheckerTestUrls: Nel[Uri],
     defaultResolver: Resolver,
@@ -84,6 +84,15 @@ final case class Config(
       prompt = s"Password for '$urlWithUser': "
       password <- processAlg.exec(Nel.of(gitCfg.gitAskPass.pathAsString, prompt), rootDir)
     } yield AuthenticatedUser(forgeCfg.login, password.mkString.trim)
+
+  def forgeSpecificCfg: ForgeSpecificCfg =
+    forgeCfg.tpe match {
+      case ForgeType.AzureRepos      => azureReposCfg
+      case ForgeType.Bitbucket       => bitbucketCfg
+      case ForgeType.BitbucketServer => bitbucketServerCfg
+      case ForgeType.GitHub          => GitHubCfg()
+      case ForgeType.GitLab          => gitLabCfg
+    }
 }
 
 object Config {
@@ -129,22 +138,27 @@ object Config {
       disableDefaults: Boolean
   )
 
-  final case class BitbucketServerCfg(
-      useDefaultReviewers: Boolean
-  )
+  sealed trait ForgeSpecificCfg extends Product with Serializable
+
+  final case class AzureReposCfg(
+      organization: Option[String]
+  ) extends ForgeSpecificCfg
 
   final case class BitbucketCfg(
       useDefaultReviewers: Boolean
-  )
+  ) extends ForgeSpecificCfg
+
+  final case class BitbucketServerCfg(
+      useDefaultReviewers: Boolean
+  ) extends ForgeSpecificCfg
+
+  final case class GitHubCfg(
+  ) extends ForgeSpecificCfg
 
   final case class GitLabCfg(
       mergeWhenPipelineSucceeds: Boolean,
       requiredReviewers: Option[Int]
-  )
-
-  final case class AzureReposConfig(
-      organization: Option[String]
-  )
+  ) extends ForgeSpecificCfg
 
   sealed trait StewardUsage
   object StewardUsage {
diff --git a/modules/core/src/main/scala/org/scalasteward/core/application/Context.scala b/modules/core/src/main/scala/org/scalasteward/core/application/Context.scala
index 710df09d..53b65490 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/application/Context.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/application/Context.scala
@@ -208,7 +208,8 @@ object Context {
       implicit val httpJsonClient: HttpJsonClient[F] = new HttpJsonClient[F]
       implicit val repoCacheRepository: RepoCacheRepository[F] =
         new RepoCacheRepository[F](repoCacheStore)
-      implicit val forgeApiAlg: ForgeApiAlg[F] = ForgeSelection.forgeApiAlg[F](config, forgeUser)
+      implicit val forgeApiAlg: ForgeApiAlg[F] =
+        ForgeSelection.forgeApiAlg[F](config.forgeCfg, config.forgeSpecificCfg, forgeUser)
       implicit val forgeRepoAlg: ForgeRepoAlg[F] = new ForgeRepoAlg[F](config)
       implicit val updateInfoUrlFinder: UpdateInfoUrlFinder[F] =
         new UpdateInfoUrlFinder[F](config.forgeCfg)
diff --git a/modules/core/src/main/scala/org/scalasteward/core/forge/ForgeSelection.scala b/modules/core/src/main/scala/org/scalasteward/core/forge/ForgeSelection.scala
index 9e49a8ea..fdff6bce 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/forge/ForgeSelection.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/forge/ForgeSelection.scala
@@ -21,7 +21,7 @@ import cats.{Applicative, MonadThrow}
 import org.http4s.headers.Authorization
 import org.http4s.{BasicCredentials, Header, Request}
 import org.scalasteward.core.application.Config
-import org.scalasteward.core.application.Config.ForgeCfg
+import org.scalasteward.core.application.Config.{ForgeCfg, ForgeSpecificCfg}
 import org.scalasteward.core.forge.ForgeType._
 import org.scalasteward.core.forge.azurerepos.AzureReposApiAlg
 import org.scalasteward.core.forge.bitbucket.BitbucketApiAlg
@@ -34,23 +34,27 @@ import org.typelevel.ci._
 import org.typelevel.log4cats.Logger
 
 object ForgeSelection {
-  def forgeApiAlg[F[_]](config: Config, user: AuthenticatedUser)(implicit
+  def forgeApiAlg[F[_]](
+      forgeCfg: ForgeCfg,
+      forgeSpecificCfg: ForgeSpecificCfg,
+      user: AuthenticatedUser
+  )(implicit
       httpJsonClient: HttpJsonClient[F],
       logger: Logger[F],
       F: MonadThrow[F]
   ): ForgeApiAlg[F] = {
-    val auth = (_: Any) => authenticate(config.forgeCfg.tpe, user)
-    config.forgeCfg.tpe match {
-      case AzureRepos =>
-        new AzureReposApiAlg[F](config.forgeCfg.apiHost, config.azureReposConfig, auth)
-      case Bitbucket =>
-        new BitbucketApiAlg(config.forgeCfg, config.bitbucketCfg, auth)
-      case BitbucketServer =>
-        new BitbucketServerApiAlg[F](config.forgeCfg.apiHost, config.bitbucketServerCfg, auth)
-      case GitHub =>
-        new GitHubApiAlg[F](config.forgeCfg.apiHost, auth)
-      case GitLab =>
-        new GitLabApiAlg[F](config.forgeCfg, config.gitLabCfg, auth)
+    val auth = (_: Any) => authenticate(forgeCfg.tpe, user)
+    forgeSpecificCfg match {
+      case specificCfg: Config.AzureReposCfg =>
+        new AzureReposApiAlg(forgeCfg.apiHost, specificCfg, auth)
+      case specificCfg: Config.BitbucketCfg =>
+        new BitbucketApiAlg(forgeCfg, specificCfg, auth)
+      case specificCfg: Config.BitbucketServerCfg =>
+        new BitbucketServerApiAlg(forgeCfg.apiHost, specificCfg, auth)
+      case _: Config.GitHubCfg =>
+        new GitHubApiAlg(forgeCfg.apiHost, auth)
+      case specificCfg: Config.GitLabCfg =>
+        new GitLabApiAlg(forgeCfg, specificCfg, auth)
     }
   }
 
diff --git a/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlg.scala
index 1d24547d..c0694a28 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlg.scala
@@ -21,7 +21,7 @@ import cats.syntax.all._
 import io.circe.Json
 import io.circe.syntax.KeyOps
 import org.http4s.{Request, Uri}
-import org.scalasteward.core.application.Config.AzureReposConfig
+import org.scalasteward.core.application.Config.AzureReposCfg
 import org.scalasteward.core.data.Repo
 import org.scalasteward.core.forge.ForgeApiAlg
 import org.scalasteward.core.forge.azurerepos.JsonCodec._
@@ -31,7 +31,7 @@ import org.scalasteward.core.util.HttpJsonClient
 
 final class AzureReposApiAlg[F[_]](
     azureAPiHost: Uri,
-    config: AzureReposConfig,
+    config: AzureReposCfg,
     modify: Repo => Request[F] => F[Request[F]]
 )(implicit client: HttpJsonClient[F], monadErrorF: MonadThrow[F])
     extends ForgeApiAlg[F] {


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
index 20146982..3c4905fc 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
@@ -7,7 +7,7 @@ import org.http4s.headers.Authorization
 import org.http4s.implicits._
 import org.http4s.{BasicCredentials, HttpApp, Uri}
 import org.scalasteward.core.TestInstances.ioLogger
-import org.scalasteward.core.application.Config.AzureReposConfig
+import org.scalasteward.core.application.Config.AzureReposCfg
 import org.scalasteward.core.data.Repo
 import org.scalasteward.core.forge.data._
 import org.scalasteward.core.forge.{ForgeSelection, ForgeType}
@@ -174,14 +174,9 @@ class AzureReposApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
 
   private val state = MockState.empty.copy(clientResponses = auth <+> httpApp)
 
-  private val azureRepoCfg = AzureReposConfig(organization = Some("azure-org"))
-  private val azureReposApiAlg = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(apiHost = apiHost, tpe = ForgeType.AzureRepos),
-      azureReposConfig = azureRepoCfg
-    ),
-    user
-  )
+  private val forgeCfg = config.forgeCfg.copy(apiHost = apiHost, tpe = ForgeType.AzureRepos)
+  private val azureReposCfg = AzureReposCfg(organization = Some("azure-org"))
+  private val azureReposApiAlg = ForgeSelection.forgeApiAlg[MockEff](forgeCfg, azureReposCfg, user)
 
   test("getRepo") {
     val obtained = azureReposApiAlg.getRepo(repo).runA(state)
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucket/BitbucketApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucket/BitbucketApiAlgTest.scala
index 67072064..0c752ae8 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucket/BitbucketApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucket/BitbucketApiAlgTest.scala
@@ -186,13 +186,9 @@ class BitbucketApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
   }
   private val state = MockState.empty.copy(clientResponses = auth <+> httpApp)
 
-  private val bitbucketApiAlg = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(tpe = ForgeType.Bitbucket),
-      bitbucketCfg = BitbucketCfg(useDefaultReviewers = true)
-    ),
-    user
-  )
+  private val forgeCfg = config.forgeCfg.copy(tpe = ForgeType.Bitbucket)
+  private val bitbucketCfg = BitbucketCfg(useDefaultReviewers = true)
+  private val bitbucketApiAlg = ForgeSelection.forgeApiAlg[MockEff](forgeCfg, bitbucketCfg, user)
 
   private val prUrl = uri"https://bitbucket.org/fthomas/base.g8/pullrequests/2"
   private val repo = Repo("fthomas", "base.g8")
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucketserver/BitbucketServerApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucketserver/BitbucketServerApiAlgTest.scala
index 4f83a745..4f7daccf 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucketserver/BitbucketServerApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/bitbucketserver/BitbucketServerApiAlgTest.scala
@@ -111,13 +111,9 @@ class BitbucketServerApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff]
   }
   private val state = MockState.empty.copy(clientResponses = auth <+> httpApp)
 
-  private val bitbucketServerApiAlg = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(tpe = ForgeType.BitbucketServer),
-      bitbucketServerCfg = BitbucketServerCfg(useDefaultReviewers = false)
-    ),
-    user
-  )
+  private val forgeCfg = config.forgeCfg.copy(tpe = ForgeType.BitbucketServer)
+  private val bitbucketServerApiAlg = ForgeSelection
+    .forgeApiAlg[MockEff](forgeCfg, BitbucketServerCfg(useDefaultReviewers = false), user)
 
   test("createPullRequest") {
     val data = NewPullRequestData(
@@ -146,16 +142,9 @@ class BitbucketServerApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff]
       base = main,
       labels = Nil
     )
-    val pr = ForgeSelection
-      .forgeApiAlg[MockEff](
-        config.copy(
-          forgeCfg = config.forgeCfg.copy(tpe = ForgeType.BitbucketServer),
-          bitbucketServerCfg = BitbucketServerCfg(useDefaultReviewers = false)
-        ),
-        user
-      )
-      .createPullRequest(repo, data)
-      .runA(state)
+    val apiAlg = ForgeSelection
+      .forgeApiAlg[MockEff](forgeCfg, BitbucketServerCfg(useDefaultReviewers = true), user)
+    val pr = apiAlg.createPullRequest(repo, data).runA(state)
     val expected =
       PullRequestOut(
         html_url = uri"https://example.org/fthomas/base.g8/pullrequests/2",
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/github/GitHubApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/github/GitHubApiAlgTest.scala
index cc6a72c4..2084b678 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/github/GitHubApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/github/GitHubApiAlgTest.scala
@@ -9,6 +9,7 @@ import org.http4s.headers.Authorization
 import org.http4s.implicits._
 import org.http4s.{BasicCredentials, HttpApp}
 import org.scalasteward.core.TestInstances.ioLogger
+import org.scalasteward.core.application.Config.GitHubCfg
 import org.scalasteward.core.data.Repo
 import org.scalasteward.core.forge.data._
 import org.scalasteward.core.forge.{ForgeSelection, ForgeType}
@@ -124,10 +125,8 @@ class GitHubApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
   }
   private val state = MockState.empty.copy(clientResponses = auth <+> httpApp)
 
-  private val gitHubApiAlg = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(forgeCfg = config.forgeCfg.copy(tpe = ForgeType.GitHub)),
-    user
-  )
+  private val forgeCfg = config.forgeCfg.copy(tpe = ForgeType.GitHub)
+  private val gitHubApiAlg = ForgeSelection.forgeApiAlg[MockEff](forgeCfg, GitHubCfg(), user)
 
   private val repo = Repo("fthomas", "base.g8")
 
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlgTest.scala
index 341f6544..29c487dd 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/gitlab/GitLabApiAlgTest.scala
@@ -113,26 +113,20 @@ class GitLabApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
   private val state = MockState.empty.copy(clientResponses = auth <+> httpApp)
 
   private val gitlabApiAlg = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(tpe = ForgeType.GitLab),
-      gitLabCfg = GitLabCfg(mergeWhenPipelineSucceeds = false, requiredReviewers = None)
-    ),
+    config.forgeCfg.copy(tpe = ForgeType.GitLab),
+    GitLabCfg(mergeWhenPipelineSucceeds = false, requiredReviewers = None),
     user
   )
 
   private val gitlabApiAlgNoFork = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(tpe = ForgeType.GitLab, doNotFork = true),
-      gitLabCfg = GitLabCfg(mergeWhenPipelineSucceeds = false, requiredReviewers = None)
-    ),
+    config.forgeCfg.copy(tpe = ForgeType.GitLab, doNotFork = true),
+    GitLabCfg(mergeWhenPipelineSucceeds = false, requiredReviewers = None),
     user
   )
 
   private val gitlabApiAlgLessReviewersRequired = ForgeSelection.forgeApiAlg[MockEff](
-    config.copy(
-      forgeCfg = config.forgeCfg.copy(tpe = ForgeType.GitLab, doNotFork = true),
-      gitLabCfg = GitLabCfg(mergeWhenPipelineSucceeds = true, requiredReviewers = Some(0))
-    ),
+    config.forgeCfg.copy(tpe = ForgeType.GitLab, doNotFork = true),
+    GitLabCfg(mergeWhenPipelineSucceeds = true, requiredReviewers = Some(0)),
     user
   )