Skip to content

Fail build when timefold.application.version is missing#2429

Open
mvanhorn wants to merge 1 commit into
TimefoldAI:mainfrom
mvanhorn:fix/2393-validate-application-version
Open

Fail build when timefold.application.version is missing#2429
mvanhorn wants to merge 1 commit into
TimefoldAI:mainfrom
mvanhorn:fix/2393-validate-application-version

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Fixes #2393. The Timefold service currently builds successfully even when the mandatory timefold.application.version property is not provided. The resolved version silently falls through to a null/blank value at the descriptor.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 in TimefoldModelDescriptorProcessor, mirroring the existing validateModelId(String). The resolved version is now validated inside generateModelDescriptor before it is set on the descriptor, so the build fails fast with a clear, actionable message naming the missing timefold.application.version property.

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.version property rather than the open-ended set of other properties mentioned in passing on the issue.

Testing

Added ApplicationVersionValidationTest, mirroring ModelNameValidationTest and using AssertJ assertions per the Constitution. It covers the happy path (non-blank version passes) and the null, empty, and blank/whitespace cases (each throws IllegalArgumentException whose message names timefold.application.version). Run locally:

./mvnw -pl service/quarkus/deployment -am -Dtest=ApplicationVersionValidationTest test

All 4 tests pass.

Fixes #2393

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
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.

Service: Should fail build when mandatory information is missing.

1 participant