fix: refactor versions yaml generation to isolate rendering from file ou - #469
Merged
cdsap merged 1 commit intoSep 15, 2026
Merged
Conversation
cdsap
deleted the
issue/468-hermes-refactor-versions-yaml-generation-to-a1
branch
September 15, 2026 23:36
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
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.ktcli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/Main.ktcli/src/test/kotlin/io/github/cdsap/projectgenerator/cli/GenerateVersionsYamlTest.ktVerification
./gradlew :project-generator:unitTest./gradlew :cli:test./gradlew ktlintCheck