From a225049b1497838cd1268c7e0e23437d018b570d Mon Sep 17 00:00:00 2001 From: Mike Cumings Date: Wed, 21 Jan 2026 13:07:20 -0800 Subject: [PATCH 1/3] Restructure configuration check This restructuring allows the Kotlin compiler to be satisfied that all branches are required, rather than having one version of the compiler throw an error and the other not be able to suppress it. Also ensures all pre-merge checks run to completion when one fails in order to gain better insights. --- .github/workflows/precommit.yml | 1 + .../ebay/plugins/graph/analytics/GraphAnalyticsPlugin.kt | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 01d91b3..d7197d7 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -5,6 +5,7 @@ jobs: gradle: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # 8.11 = oldest supported version # wrapper = supposed to be the oldest supported version but actually runs current diff --git a/src/main/kotlin/com/ebay/plugins/graph/analytics/GraphAnalyticsPlugin.kt b/src/main/kotlin/com/ebay/plugins/graph/analytics/GraphAnalyticsPlugin.kt index 920a57b..abaef55 100644 --- a/src/main/kotlin/com/ebay/plugins/graph/analytics/GraphAnalyticsPlugin.kt +++ b/src/main/kotlin/com/ebay/plugins/graph/analytics/GraphAnalyticsPlugin.kt @@ -231,8 +231,6 @@ internal class GraphAnalyticsPlugin : Plugin { val classifier = graphExtension.configurationClassifier.convention(ConfigurationClassifierDefault()).get() project.configurations.configureEach { config -> val configClass = classifier.classify(config) - if (configClass == ConfigurationClass.OTHER) return@configureEach - val (dependenciesConfig, taskProvider) = when(configClass) { ConfigurationClass.PRODUCTION -> { Pair(prodDependencies, gatherProdDependenciesTaskProvider) @@ -240,9 +238,9 @@ internal class GraphAnalyticsPlugin : Plugin { ConfigurationClass.TEST -> { Pair(testDependencies, gatherTestDependenciesTaskProvider) } - else -> { - // Should never happen - throw(GradleException("Unsupported config class: $configClass")) + ConfigurationClass.OTHER -> { + // We only care about prod and test dependencies + return@configureEach } } From 010f5bebbb848e36c0a8b5b2e06463da3eed0109 Mon Sep 17 00:00:00 2001 From: Mike Cumings Date: Wed, 21 Jan 2026 13:14:52 -0800 Subject: [PATCH 2/3] Declare cache strategy on abstract base classes --- .../com/ebay/plugins/graph/analytics/BaseGraphInputTask.kt | 2 ++ .../ebay/plugins/graph/analytics/BaseGraphPersistenceTask.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphInputTask.kt b/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphInputTask.kt index 0f49fb2..2d8d3c2 100644 --- a/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphInputTask.kt +++ b/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphInputTask.kt @@ -1,6 +1,7 @@ package com.ebay.plugins.graph.analytics import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity @@ -11,6 +12,7 @@ import org.jgrapht.graph.DefaultDirectedGraph * Base class which can be used by tasks which need to read the graph file as * an input (only). */ +@CacheableTask abstract class BaseGraphInputTask : BaseGraphPersistenceTask() { /** * The graph input to analyze. diff --git a/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphPersistenceTask.kt b/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphPersistenceTask.kt index 2de5151..8c255cc 100644 --- a/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphPersistenceTask.kt +++ b/src/main/kotlin/com/ebay/plugins/graph/analytics/BaseGraphPersistenceTask.kt @@ -2,12 +2,14 @@ package com.ebay.plugins.graph.analytics import org.gradle.api.DefaultTask import org.gradle.api.provider.Property +import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal /** * Base class used for tasks which need to read and write the graph file. */ +@CacheableTask abstract class BaseGraphPersistenceTask : DefaultTask() { // Pass the graph format in so that version changes invalidate the cache @get:Input From 76196d76b3c86a17b8e69da22a6d900a0c5b4a8d Mon Sep 17 00:00:00 2001 From: Mike Cumings Date: Wed, 21 Jan 2026 13:15:14 -0800 Subject: [PATCH 3/3] Declare normalization strategy on DirectComparisonTask --- .../com/ebay/plugins/graph/analytics/DirectComparisonTask.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/com/ebay/plugins/graph/analytics/DirectComparisonTask.kt b/src/main/kotlin/com/ebay/plugins/graph/analytics/DirectComparisonTask.kt index 283a73c..4f741a8 100644 --- a/src/main/kotlin/com/ebay/plugins/graph/analytics/DirectComparisonTask.kt +++ b/src/main/kotlin/com/ebay/plugins/graph/analytics/DirectComparisonTask.kt @@ -8,6 +8,8 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.Optional import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option import org.gradle.work.DisableCachingByDefault @@ -23,6 +25,7 @@ internal abstract class DirectComparisonTask : BaseGraphPersistenceTask() { internal abstract val projectLayout: ProjectLayout @get:InputFile + @get:PathSensitive(PathSensitivity.NONE) internal abstract val defaultAnalysisFile: RegularFileProperty /**