Fail build when timefold.application.version is missing#2429
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
Validate the resolved application version in the Quarkus build-time processor and fail fast with a clear, actionable error naming the missing timefold.application.version property, instead of letting a null/blank version fall through to a vague runtime error. Fixes TimefoldAI#2393
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
Fixes #2393. The Timefold service currently builds successfully even when the mandatory
timefold.application.versionproperty is not provided. The resolved version silently falls through to a null/blank value at thedescriptor.setVersion(...)call site in the Quarkus build-time processor, and the missing value only surfaces later as a vague runtime error.This change adds a static
validateApplicationVersion(String)check inTimefoldModelDescriptorProcessor, mirroring the existingvalidateModelId(String). The resolved version is now validated insidegenerateModelDescriptorbefore it is set on the descriptor, so the build fails fast with a clear, actionable message naming the missingtimefold.application.versionproperty.Why this matters
It aligns with the project Constitution's "Fail Fast" and "Understandable Error Messages" principles, and matches the maintainer's note on the issue that validation should be improved so a missing mandatory property does not slip through to runtime. The scope is intentionally limited to the named
timefold.application.versionproperty rather than the open-ended set of other properties mentioned in passing on the issue.Testing
Added
ApplicationVersionValidationTest, mirroringModelNameValidationTestand using AssertJ assertions per the Constitution. It covers the happy path (non-blank version passes) and the null, empty, and blank/whitespace cases (each throwsIllegalArgumentExceptionwhose message namestimefold.application.version). Run locally:All 4 tests pass.
Fixes #2393