Skip to content

fix: refactor versions yaml generation to isolate rendering from file ou - #469

Merged
cdsap merged 1 commit into
mainfrom
issue/468-hermes-refactor-versions-yaml-generation-to-a1
Sep 15, 2026
Merged

cdsap merged 1 commit into
mainfrom
issue/468-hermes-refactor-versions-yaml-generation-to-a1

Conversation

@cdsap

@cdsap cdsap commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Problem

GenerateVersionsYaml combines pure YAML rendering with hardcoded filesystem and console side effects in generate(), always writing versions.yaml relative to the process working directory. This makes the CLI boundary implicit and limits direct testing of file-output behavior.

Why this matters

Separating rendering from output makes the core behavior deterministic, clarifies the CLI infrastructure boundary, and enables tests to verify output paths without changing the working directory.

Proposed change

Extract the pure YAML rendering responsibility into a focused renderer or make the output destination an explicit dependency, while keeping GenerateYaml responsible for writing the default versions.yaml file and reporting success.

Notes

From a domain-driven and clean-architecture perspective, YAML rendering is a deterministic application concern, while file creation and console reporting are CLI infrastructure concerns. Making that boundary explicit improves testability without changing behavior.

Fixes #468

Changes

  • cli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/GenerateVersionsYaml.kt
  • cli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/Main.kt
  • cli/src/test/kotlin/io/github/cdsap/projectgenerator/cli/GenerateVersionsYamlTest.kt

Verification

  • ./gradlew :project-generator:unitTest
  • ./gradlew :cli:test
  • ./gradlew ktlintCheck

@cdsap
cdsap merged commit e7a4755 into main Sep 15, 2026
14 checks passed
@cdsap
cdsap deleted the issue/468-hermes-refactor-versions-yaml-generation-to-a1 branch September 15, 2026 23:36
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 versions YAML generation to isolate rendering from file output

1 participant