Skip to content

Add version filtering in configuration - #85

Merged
bishiboosh merged 4 commits into
mainfrom
filters
Apr 6, 2026
Merged

Add version filtering in configuration#85
bishiboosh merged 4 commits into
mainfrom
filters

Conversation

@bishiboosh

Copy link
Copy Markdown
Collaborator

What does this PR do?

Add filter option in configuration to enable specific version filtering

Issue number, if applicable

Fixes #83

Checklist

  • I have read the contributing guidelines.
  • I have documented my code if it is included in the public API.
  • I have added tests for my code and ran them via ./gradlew check.

@bishiboosh bishiboosh self-assigned this Apr 6, 2026
@bishiboosh bishiboosh added the enhancement New feature or request label Apr 6, 2026
@bishiboosh
bishiboosh requested a review from Copilot April 6, 2026 15:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 core Configuration, plus an internal FilterPolicy applied 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 build job sets commit status using steps.comment-branch.outputs.head_sha, but there is no comment-branch step in this workflow. This will fail at runtime; either add the PR-branch lookup step (like in build_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.

Comment thread gradle-plugin/README.md Outdated
Comment thread core/src/commonMain/kotlin/com/deezer/caupain/model/Configuration.kt Outdated
Comment thread .github/workflows/check.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread cli/src/commonMain/kotlin/com/deezer/caupain/cli/serialization/Configuration.kt Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 @JvmOverloads factory function Configuration(...) 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 accepts filters while 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.

Comment thread .github/workflows/check.yml
@bishiboosh
bishiboosh merged commit 6c118fe into main Apr 6, 2026
12 checks passed
@bishiboosh
bishiboosh deleted the filters branch April 6, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a filter for specific dependencies

2 participants