Skip to content

fix: refactor kotlin process collection to isolate process parsing - #87

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

fix: refactor kotlin process collection to isolate process parsing#87
cdsap merged 1 commit into
mainfrom
issue/86-hermes-refactor-kotlin-process-collection-t-a1

Conversation

@cdsap

@cdsap cdsap commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

Problem

Both src/main/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessBuildService.kt and src/main/kotlin/io/github/cdsap/kotlinprocess/DevelocityWrapperConfiguration.kt directly construct ConsolidateProcesses and pass TypeProcess.Kotlin. That duplicates the core rule for turning jstat/jinfo output into Kotlin process data across the console and Develocity infrastructure paths.

Why this matters

The plugin has two reporting adapters, but the domain behavior of collecting Kotlin process data is embedded in both. Any future change to parser usage, process type selection, empty-output handling, or test doubles has to be coordinated in multiple Gradle-facing classes.

Proposed change

Introduce a small Kotlin-process collector, for example KotlinProcessCollector, that accepts the jstat and jinfo strings and returns List<Process>. Use it from InfoKotlinProcessBuildService.close() and DevelocityWrapperConfiguration.processes(...), preserving the existing providers, reporting behavior, and output formatting.

Notes

Clean architecture lens: this separates the core use case of deriving Kotlin process records from infrastructure adapters that decide where the records are reported.

Fixes #86

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

Verification

  • ./gradlew ktlintCheck
  • ./gradlew test

@cdsap

cdsap commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

@cdsap PR Judge blocked this PR for manual review.

State: BLOCKED_DANGEROUS_DIFF
Reason: test removals: src/test/kotlin/io/github/cdsap/kotlinprocess/InfoKotlinProcessPluginTest.kt, src/test/kotlin/io/github/cdsap/kotlinprocess/KotlinProcessCollectorTest.kt

The judge will not auto-merge this PR until the risky diff is reviewed manually.

@cdsap
cdsap merged commit 14a70b9 into main Aug 30, 2026
23 checks passed
@cdsap
cdsap deleted the issue/86-hermes-refactor-kotlin-process-collection-t-a1 branch August 30, 2026 17: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 Kotlin process collection to isolate process parsing

1 participant