Repository: 7mind/izumi
Pull request #2039 (2023-11-17 13:24:23)

Update classgraph to 4.8.165
## About this PR
📦 Updates [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from `4.8.164` to `4.8.165`

## Usage
✅ **Please merge!**

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

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/107f04a421f61cdc38a02414d928d1964bc3874b/docs/repo-specific-configuration.md) file.

_Have a fantastic day writing Scala!_

<details>
<summary>⚙ Adjust future updates</summary>

Add this to your `.scala-steward.conf` file to ignore future updates of this dependency:
```
updates.ignore = [ { groupId = "io.github.classgraph", artifactId = "classgraph" } ]
```
Or, add this to slow down future updates of this dependency:
```
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "io.github.classgraph", artifactId = "classgraph" }
}]
```
</details>

<sup>
labels: library-update, early-semver-patch, semver-spec-patch, commit-count:1
</sup>


Patch:
diff --git a/distage/distage-framework/.js/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala b/distage/distage-framework/.js/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
index dd86d98b0..1f8ea8b32 100644
--- a/distage/distage-framework/.js/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
+++ b/distage/distage-framework/.js/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
@@ -1,6 +1,6 @@
 package izumi.distage.framework.services
 
-trait ConfigLoader extends AbstractConfigLoader {}
+trait ConfigLoader extends AbstractConfigLoader
 
 object ConfigLoader {
   def empty: ConfigLoader = () => ???
diff --git a/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigArgsProvider.scala b/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigArgsProvider.scala
index a45e84f0a..477b73502 100644
--- a/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigArgsProvider.scala
+++ b/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigArgsProvider.scala
@@ -13,11 +13,15 @@ trait ConfigArgsProvider {
 }
 
 object ConfigArgsProvider {
+  def const(args: ConfigLoader.Args): ConfigArgsProvider = new ConfigArgsProvider.Const(args)
+  def empty: ConfigArgsProvider = ConfigArgsProvider.Empty
 
-  object Empty extends ConfigArgsProvider {
-    override def args(): ConfigLoader.Args = ConfigLoader.Args(None, List.empty)
+  open class Const(args0: ConfigLoader.Args) extends ConfigArgsProvider {
+    override def args(): ConfigLoader.Args = args0
   }
 
+  object Empty extends ConfigArgsProvider.Const(ConfigLoader.Args(None, List.empty))
+
   @nowarn("msg=Unused import")
   class Default(
     parameters: RawAppArgs,
diff --git a/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala b/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
index cf19b9d8d..e9c2dcb01 100644
--- a/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
+++ b/distage/distage-framework/.jvm/src/main/scala/izumi/distage/framework/services/ConfigLoader.scala
@@ -27,7 +27,7 @@ import scala.util.{Failure, Success, Try}
   *   - `common-reference.conf`
   *   - `common-reference-dev.conf`
   *
-  * NOTE: You can change default config locations by overriding `make[ConfigLocation]`
+  * NOTE: You can change default config locations by overriding `make[ConfigLocationProvider]`
   * binding in [[izumi.distage.roles.RoleAppMain#roleAppBootOverrides]] (defaults defined in [[izumi.distage.roles.RoleAppBootModule]])
   *
   * When explicit configs are passed to the role launcher on the command-line using the `-c` option, they have higher priority than all the reference configs.
@@ -44,10 +44,10 @@ import scala.util.{Failure, Success, Try}
   *   - explicits: `role1.conf`, `role2.conf`, `global.conf`,
   *   - resources: `role1[-reference,-dev].conf`, `role2[-reference,-dev].conf`, ,`application[-reference,-dev].conf`, `common[-reference,-dev].conf`
   *
-  * @see [[ConfigLoader.ConfigLocation]]
+  * @see [[ConfigLocationProvider]]
   * @see [[ConfigLoader.LocalFSImpl]]
   */
-trait ConfigLoader extends AbstractConfigLoader {}
+trait ConfigLoader extends AbstractConfigLoader
 
 @nowarn("msg=Unused import")
 object ConfigLoader {
diff --git a/project/Versions.scala b/project/Versions.scala
index 6f617734d..fad1f2ff1 100644
--- a/project/Versions.scala
+++ b/project/Versions.scala
@@ -31,12 +31,12 @@ object V {
   val scala_java_time = "2.5.0"
 
   // java-only dependencies below
-  val classgraph = "4.8.164"
+  val classgraph = "4.8.165"
   val slf4j = "2.0.9"
   val typesafe_config = "1.4.0"
 
   // good to drop - java
-  val bytebuddy = "1.14.9"
+  val bytebuddy = "1.14.10"
   val docker_java = "3.3.4"
 
   // microsite-only


Test patch:
diff --git a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/BootstrapFactory.scala b/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/BootstrapFactory.scala
index 1fcbce99e..3a63faaa8 100644
--- a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/BootstrapFactory.scala
+++ b/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/BootstrapFactory.scala
@@ -1,16 +1,23 @@
 package izumi.distage.testkit.runner.impl.services
 
 import distage.config.AppConfig
+import izumi.distage.config.model.{GenericConfigSource, RoleConfig}
 import izumi.distage.framework.config.PlanningOptions
 import izumi.distage.framework.model.ActivationInfo
-import izumi.distage.framework.services.ModuleProvider
+import izumi.distage.framework.services.ConfigMerger.ConfigMergerImpl
+import izumi.distage.framework.services.{ConfigArgsProvider, ConfigLoader, ConfigLocationProvider, ModuleProvider}
 import izumi.distage.model.definition.Activation
 import izumi.distage.roles.launcher.AppShutdownInitiator
 import izumi.distage.roles.model.meta.RolesInfo
 import izumi.fundamentals.platform.cli.model.raw.RawAppArgs
+import izumi.logstage.api.IzLogger
 import izumi.logstage.api.logger.LogRouter
 import izumi.reflect.TagK
 
+/**
+  * The purpose of this class is to allow testkit user to override
+  * module loading and config loading logic by overriding [[izumi.distage.testkit.model.TestConfig]]
+  */
 trait BootstrapFactory {
   def makeModuleProvider[F[_]: TagK](
     options: PlanningOptions,
@@ -20,10 +27,25 @@ trait BootstrapFactory {
     activationInfo: ActivationInfo,
     activation: Activation,
   ): ModuleProvider
+
+  def makeConfigLoader(configBaseName: String, logger: IzLogger): ConfigLoader
+
+  protected def makeConfigLocationProvider(configBaseName: String): ConfigLocationProvider
 }
 
 object BootstrapFactory {
   object Impl extends BootstrapFactory {
+    override protected def makeConfigLocationProvider(configBaseName: String): ConfigLocationProvider = {
+      ConfigLocationProvider.Default
+    }
+
+    override def makeConfigLoader(configBaseName: String, logger: IzLogger): ConfigLoader = {
+      val argsProvider = ConfigArgsProvider.const(ConfigLoader.Args(None, List(RoleConfig(configBaseName, active = true, GenericConfigSource.ConfigDefault))))
+      val merger = new ConfigMergerImpl(logger)
+      val locationProvider = makeConfigLocationProvider(configBaseName)
+      new ConfigLoader.LocalFSImpl(logger, merger, locationProvider, argsProvider)
+    }
+
     override def makeModuleProvider[F[_]: TagK](
       options: PlanningOptions,
       config: AppConfig,
diff --git a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/TestConfigLoader.scala b/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/TestConfigLoader.scala
index a4c24378a..50134b5d0 100644
--- a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/TestConfigLoader.scala
+++ b/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/runner/impl/services/TestConfigLoader.scala
@@ -1,8 +1,6 @@
 package izumi.distage.testkit.runner.impl.services
 
-import izumi.distage.config.model.{AppConfig, GenericConfigSource, RoleConfig}
-import izumi.distage.framework.services.ConfigMerger.ConfigMergerImpl
-import izumi.distage.framework.services.{ConfigArgsProvider, ConfigLoader, ConfigLocationProvider}
+import izumi.distage.config.model.AppConfig
 import izumi.distage.testkit.model.TestEnvironment
 import izumi.logstage.api.IzLogger
 
@@ -22,7 +20,8 @@ object TestConfigLoader {
         .computeIfAbsent(
           (env.configBaseName, env.bootstrapFactory, env.configOverrides),
           _ => {
-            val configLoader = makeConfigLoader(env.configBaseName, envLogger)
+            val configLoader = env.bootstrapFactory
+              .makeConfigLoader(env.configBaseName, envLogger)
               .map {
                 appConfig =>
                   env.configOverrides match {
@@ -36,14 +35,5 @@ object TestConfigLoader {
           },
         )
     }
-
-    protected def makeConfigLoader(configBaseName: String, logger: IzLogger): ConfigLoader = {
-      val provider = new ConfigArgsProvider {
-        override def args(): ConfigLoader.Args = ConfigLoader.Args(None, List(RoleConfig(configBaseName, active = true, GenericConfigSource.ConfigDefault)))
-      }
-      val merger = new ConfigMergerImpl(logger)
-      new ConfigLoader.LocalFSImpl(logger, merger, ConfigLocationProvider.Default, provider)
-    }
-
   }
 }