Skip to content

fix: refactor kotlin process collection to a shared core helper - #85

Merged
cdsap merged 1 commit into
mainfrom
issue/84-hermes-refactor-kotlin-process-collection-t-a1
Aug 29, 2026
Merged

fix: refactor kotlin process collection to a shared core helper#85
cdsap merged 1 commit into
mainfrom
issue/84-hermes-refactor-kotlin-process-collection-t-a1

Conversation

@cdsap

@cdsap cdsap commented Aug 28, 2026

Copy link
Copy Markdown
Owner

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.kt
  • src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessPlugin.kt
  • src/main/kotlin/io/github/cdsap/kotlinprocess/KotlinProcessCollector.kt
  • src/test/kotlin/io/github/cdsap/kotlinprocess/KotlinProcessCollectorTest.kt

Verification

  • ./gradlew ktlintCheck
  • ./gradlew test

@cdsap
cdsap merged commit 9164af7 into main Aug 29, 2026
23 checks passed
@cdsap
cdsap deleted the issue/84-hermes-refactor-kotlin-process-collection-t-a1 branch August 29, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Kotlin process collection to a shared core helper

1 participant