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

fix: JoinConfigChecker and Scala 3 #32323

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"name" : "<init>"
} ]
}, {
"name" : "akka.cluster.JoinConfigCompatChecker$$anon$1",
Copy link
Member Author

Choose a reason for hiding this comment

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

would be $anon$2 on Scala 3 so tests could never pass on both 2.13 and 3

"name" : "akka.cluster.JoinConfigCompatChecker$CompositeChecker",
"methods" : [ {
"name" : "<init>"
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,18 @@ object JoinConfigCompatChecker {
.get // can't continue if we can't load it
}

// composite checker
new JoinConfigCompatChecker {
override val requiredKeys: im.Seq[String] = {
// Always include akka.version (used in join logging)
"akka.version" +: checkers.flatMap(_.requiredKeys).to(im.Seq)
}
override def check(toValidate: Config, clusterConfig: Config): ConfigValidation =
checkers.foldLeft(Valid: ConfigValidation) { (acc, checker) =>
acc ++ checker.check(toValidate, clusterConfig)
}
new CompositeChecker(checkers)
}

private final class CompositeChecker(checkers: Set[JoinConfigCompatChecker]) extends JoinConfigCompatChecker {
override val requiredKeys: im.Seq[String] = {
// Always include akka.version (used in join logging)
"akka.version" +: checkers.flatMap(_.requiredKeys).to(im.Seq)
}
override def check(toValidate: Config, clusterConfig: Config): ConfigValidation =
checkers.foldLeft(Valid: ConfigValidation) { (acc, checker) =>
acc ++ checker.check(toValidate, clusterConfig)
}
}
}

Expand Down