Skip to content

fix: refactor process collection to a shared kotlin process collector - #89

Merged
cdsap merged 1 commit into
mainfrom
issue/88-hermes-refactor-process-collection-to-a-sha-a1
Sep 1, 2026
Merged

fix: refactor process collection to a shared kotlin process collector#89
cdsap merged 1 commit into
mainfrom
issue/88-hermes-refactor-process-collection-to-a-sha-a1

Conversation

@cdsap

@cdsap cdsap commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Problem

Kotlin process discovery is duplicated in two infrastructure paths: src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessBuildService.kt:21-27 consolidates jstat/jinfo provider output for console reporting, while src/main/kotlin/io/github/cdsap/kotlinprocess/DevelocityWrapperConfiguration.kt:33-38 repeats the same ConsolidateProcesses().consolidate(..., TypeProcess.Kotlin) call for Build Scan reporting.

Why this matters

The core behavior of turning jstat/jinfo output into Kotlin process data is coupled to both Gradle BuildService lifecycle code and Develocity integration code. Any future change to process parsing, filtering, or error handling must be made in multiple places and is harder to test without exercising Gradle or Develocity wiring.

Proposed change

Introduce a small core helper, for example KotlinProcessCollector, that accepts jstat and jinfo strings and returns List<Process> using the existing ConsolidateProcesses call. Update InfoKotlinProcessBuildService and DevelocityWrapperConfiguration to resolve their providers as they do today, then delegate only the consolidation step to this helper.

Notes

From a clean architecture lens, this extracts the small domain operation, collecting Kotlin process facts from raw tool output, away from Gradle BuildService and Develocity adapter code while preserving the repository's current simple class-based style.

Fixes #88

Changes

  • src/main/kotlin/io/github/cdsap/kotlinprocess/DevelocityWrapperConfiguration.kt
  • src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessBuildService.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 561007a into main Sep 1, 2026
23 checks passed
@cdsap
cdsap deleted the issue/88-hermes-refactor-process-collection-to-a-sha-a1 branch September 1, 2026 21:12
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 process collection to a shared Kotlin process collector

1 participant