fix: refactor kotlin process collection to a shared core helper - #85
Merged
cdsap merged 1 commit intoAug 29, 2026
Merged
Conversation
cdsap
deleted the
issue/84-hermes-refactor-kotlin-process-collection-t-a1
branch
August 29, 2026 00:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
Kotlin process collection is duplicated across delivery paths: DevelocityWrapperConfiguration.kt creates jStat/jInfo providers and consolidates them in private methods at src/main/kotlin/io/github/cdsap/kotlinprocess/DevelocityWrapperConfiguration.kt:25-44, while InfoKotlinProcessBuildService.kt independently calls ConsolidateProcesses with the same TypeProcess.Kotlin wiring at src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessBuildService.kt:21-27. InfoKotlinProcessPlugin.kt also knows the process-name/provider details when registering the console service at src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessPlugin.kt:34-35.
Why this matters
The Develocity and console reporting adapters can drift if process selection or parser wiring changes. Keeping raw jstat/jinfo provider setup and consolidation scattered across Gradle integration classes makes the core behavior harder to unit test without exercising Gradle plugin infrastructure.
Proposed change
Introduce a small KotlinProcessCollector or KotlinProcessProviders helper in src/main/kotlin/io/github/cdsap/kotlinprocess that owns KOTLIN_PROCESS_NAME provider creation and consolidation into List. Update DevelocityWrapperConfiguration and InfoKotlinProcessBuildService to call that helper, preserving the existing output classes and Gradle registration flow.
Notes
Clean architecture lens: process discovery/consolidation is core application behavior, while Develocity build-scan values and console tables are output adapters. A tiny shared collector clarifies that boundary without changing the repository's current Gradle-plugin style.
Fixes #84
Changes
src/main/kotlin/io/github/cdsap/kotlinprocess/DevelocityWrapperConfiguration.ktsrc/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessPlugin.ktsrc/main/kotlin/io/github/cdsap/kotlinprocess/KotlinProcessCollector.ktsrc/test/kotlin/io/github/cdsap/kotlinprocess/KotlinProcessCollectorTest.ktVerification
./gradlew ktlintCheck./gradlew test