Add version filtering in configuration - #85
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “filters” concept to configuration to restrict acceptable update versions per dependency/plugin, and wires it through core policy evaluation plus Gradle-plugin/CLI configuration surfaces.
Changes:
- Introduces
Filter(library/plugin) in coreConfiguration, plus an internalFilterPolicyapplied during version selection. - Exposes filter configuration via the Gradle plugin DSL (
addFilter(...)) and CLI TOML parsing/serialization. - Updates docs/tests and adjusts CI workflows to build CLI artifacts in
check.yml.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle-plugin/src/main/java/com/deezer/caupain/plugin/DependencyUpdatePlugin.kt | Passes extension filters into the task configuration. |
| gradle-plugin/src/main/java/com/deezer/caupain/plugin/DependenciesUpdateTask.kt | Adds task filters property (but currently not wired into core Configuration). |
| gradle-plugin/src/main/java/com/deezer/caupain/plugin/DependenciesUpdateExtension.kt | Adds filters property and addFilter(...) DSL helpers. |
| gradle-plugin/src/functionalTest/kotlin/com/deezer/caupain/plugin/TestProject.kt | Exercises filter DSL in functional-test project setup. |
| gradle-plugin/README.md | Documents dependency/plugin filtering usage (one example currently mismatches API). |
| gradle-plugin/api/gradle-plugin.api | Updates public Gradle plugin API surface for filters. |
| core/src/commonMain/kotlin/com/deezer/caupain/model/Configuration.kt | Adds filters to configuration and introduces public Filter model. |
| core/src/commonMain/kotlin/com/deezer/caupain/policies/FilterPolicy.kt | Adds internal policy implementing the filtering semantics. |
| core/src/commonMain/kotlin/com/deezer/caupain/DependencyUpdateChecker.kt | Automatically appends FilterPolicy when filters are configured. |
| core/src/commonTest/kotlin/com/deezer/caupain/model/FilterPolicyTest.kt | Unit tests for filter selection behavior. |
| core/api/core.api | Updates JVM API snapshot for new configuration/filter APIs. |
| core/api/core.klib.api | Updates KLib API snapshot for new configuration/filter APIs. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/CaupainCLI.kt | Wires parsed filters into the core Configuration(...) call. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/model/Configuration.kt | Adds filters to CLI model configuration interface. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/serialization/Configuration.kt | Registers FilterSerializer for TOML parsing. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/serialization/Filter.kt | Implements TOML serializer/deserializer for core Filter. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/serialization/TomlContentPolymorphicSerializer.kt | Adds shared polymorphic TOML serializer base. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/serialization/Repository.kt | Refactors repository TOML deserialization to use the new polymorphic base. |
| cli/src/commonMain/kotlin/com/deezer/caupain/cli/model/Repository.kt | Simplifies DefaultRepository enum shape (removes stored key). |
| cli/src/commonTest/kotlin/com/deezer/caupain/cli/ConfigurationParsingTest.kt | Adds TOML parsing assertions for filters. |
| cli/src/jvmTest/kotlin/com/deezer/caupain/cli/CaupainCLIConfigTest.kt | Adds CLI config merge tests for filters. |
| cli/README.md | Documents TOML filters configuration. |
| .github/workflows/check.yml | Adds a new build job to build/upload CLI artifacts (currently contains invalid references). |
| .github/workflows/build_from_pr_comment.yml | Removes the /buildBinaries build job (build moved to check.yml). |
Comments suppressed due to low confidence (1)
.github/workflows/check.yml:173
- The
buildjob sets commit status usingsteps.comment-branch.outputs.head_sha, but there is nocomment-branchstep in this workflow. This will fail at runtime; either add the PR-branch lookup step (like inbuild_from_pr_comment.yml) or use${{ github.sha }}for PR builds.
- name: Update summary
run: |
echo "[Binaries](${{ steps.upload_artifact.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx12g -Dfile.encoding=UTF-8"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
core/src/commonMain/kotlin/com/deezer/caupain/model/Configuration.kt:152
- The
@JvmOverloadsfactory functionConfiguration(...)gained a new parameter (filters) in the middle of the parameter list. This changes the generated JVM overload signatures and will break existing Java/Kotlin (binary) callers using positional overloads. If JVM binary compatibility matters, prefer adding new parameters at the end or providing a separate overload/builder that acceptsfilterswhile keeping existing overload signatures intact.
@Suppress("LongParameterList") // Needed to reflect parameters
@JvmOverloads
public fun Configuration(
repositories: List<Repository> = Configuration.DEFAULT_REPOSITORIES,
pluginRepositories: List<Repository> = Configuration.DEFAULT_PLUGIN_REPOSITORIES,
versionCatalogPaths: Iterable<Path> = listOf(Configuration.DEFAULT_CATALOG_PATH),
excludedKeys: Set<String> = emptySet(),
excludedLibraries: List<LibraryExclusion> = emptyList(),
excludedPlugins: List<PluginExclusion> = emptyList(),
filters: List<Filter> = emptyList(),
policies: Iterable<String> = listOf(StabilityLevelPolicy.name),
policyPluginsDir: Path? = null,
cacheDir: Path? = null,
cleanCache: Boolean = false,
debugHttpCalls: Boolean = false,
onlyCheckStaticVersions: Boolean = true,
gradleStabilityLevel: GradleStabilityLevel = GradleStabilityLevel.STABLE,
checkIgnored: Boolean = false,
githubToken: String? = null,
searchReleaseNote: Boolean = githubToken != null,
verifyExistence: Boolean = false,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
Add filter option in configuration to enable specific version filtering
Issue number, if applicable
Fixes #83
Checklist
./gradlew check.