Add InputValidator utility for score range checks - #57
Merged
Merged
Conversation
The 1-5 score range was checked separately in three places across the create and update commands. Both commands now share InputValidator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (PR #57):
Findings:
Summary: a behavior-preserving consolidation of the score range check, with CI and the local suite green. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
util/InputValidatorutility class is added withisValidScore(int)andareValidScores(Integer...)(null entries, i.e. options not given, are ignored), plusMIN_SCORE/MAX_SCOREconstants.CreateProjectCommand, and the privateisOutOfRangehelper inUpdateProjectCommand(removed).Closes #8
Note on "w/ Jakarta" in the issue title: the issue body asks for an
InputValidatorutility class that ensures all score inputs are between 1-5, which this PR delivers. Jakarta Bean Validation was not adopted, because it would add aspring-boot-starter-validationdependency tobuild.gradle(a do-not-auto-merge path) and the shell commands already validate their arguments before reaching the service layer. If annotation-based validation is still wanted, the issue can be reopened or a follow-up filed.Test plan
./gradlew teston JDK 21: 141 tests executed, 0 failures, 0 errors, 0 skipped (counted frombuild/test-results/test/*.xml)InputValidatorTest(5 tests): in-range, out-of-range includingInteger.MIN_VALUE/MAX_VALUE, mixed batches and null handlingCreateProjectCommandTestandUpdateProjectCommandTestrange-rejection tests still pass unchangedDeferred issues
app.projects.fileinapplication.yaml, a do-not-auto-merge path; left for a cycle that can hand off for human review.build.gradleand a substantial new surface; too large for this cycle.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson