Skip to content

fix: false positive warnings for new properties - #2617

Merged
winklerm merged 2 commits into
TimefoldAI:mainfrom
winklerm:fix/false-positive-warnings-on-properties
Aug 26, 2026
Merged

fix: false positive warnings for new properties#2617
winklerm merged 2 commits into
TimefoldAI:mainfrom
winklerm:fix/false-positive-warnings-on-properties

Conversation

@winklerm

Copy link
Copy Markdown
Contributor

The warning must only be logged when a legacy value is actually chosen over the new one, not merely because the requested name happens to have a known legacy counterpart (which may itself be unset).

Closes #2616.

The warning must only be logged when a legacy value is actually chosen over
the new one, not merely because the requested name happens to have a known
legacy counterpart (which may itself be unset).

Closes TimefoldAI#2616.
@winklerm winklerm added the component/service Issues related to timefold-solver-service components label Aug 25, 2026

@greyhairredbear greyhairredbear left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests about the logging!

Q: Would it maybe make sense to have that parameterized (with the other new/legacy property names), or do you think this would basically just be duplicating the implementation i.e. the mapping from new name to legacy name?
(IMO, it could make sense in this instance, thus the suggestion)

@winklerm

Copy link
Copy Markdown
Contributor Author

Nice tests about the logging!

Q: Would it maybe make sense to have that parameterized (with the other new/legacy property names), or do you think this would basically just be duplicating the implementation i.e. the mapping from new name to legacy name? (IMO, it could make sense in this instance, thus the suggestion)

@greyhairredbear Do you mean having the tests parameterized with all mapped properties in general, or just the logging tests?

@greyhairredbear

greyhairredbear commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@greyhairredbear Do you mean having the tests parameterized with all mapped properties in general, or just the logging tests?

I just thought about the logging here, but you've got a point, might as well extend it to the other tests 🤔, not really that much of a difference. But then, we might also descope it from this PR.

@winklerm

Copy link
Copy Markdown
Contributor Author

@greyhairredbear Do you mean having the tests parameterized with all mapped properties in general, or just the logging tests?

I just thought about the logging here, but you've got a point, might as well extend it to the other tests 🤔, not really that much of a difference. But then, we might also descope it from this PR.

Got it, updated the logging tests. The remaining tests seem to already cover different mapping types, if I have noticed correctly, so we should be good there.

@winklerm
winklerm marked this pull request as ready for review August 25, 2026 22:52
@winklerm
winklerm requested review from rsynek and triceo as code owners August 25, 2026 22:52
Copilot AI lite review requested due to automatic review settings August 25, 2026 22:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Quarkus config fallback interceptor so deprecation warnings are only logged when a legacy (deprecated) configuration key actually wins during resolution, eliminating false-positive warnings described in #2616.

Changes:

  • Move warning emission to the point where a legacy value is actually selected over the new key’s value.
  • Consolidate legacy-key resolution logic into a shared resolver method for exact, prefix, and multi-legacy mappings.
  • Add parameterized tests to verify warnings are logged only when legacy keys are used, and not when only the new key is set.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
service/quarkus/runtime/src/main/java/ai/timefold/solver/service/quarkus/deployment/config/TimefoldRenamedPropertiesFallbackInterceptor.java Updates legacy-name resolution so WARN is emitted only when a legacy ConfigValue is actually selected.
service/quarkus/runtime/src/test/java/ai/timefold/solver/service/quarkus/deployment/config/TimefoldRenamedPropertiesFallbackInterceptorTest.java Adds parameterized coverage asserting warning/no-warning behavior across mapping types.
Suppressed comments (1)

service/quarkus/runtime/src/main/java/ai/timefold/solver/service/quarkus/deployment/config/TimefoldRenamedPropertiesFallbackInterceptor.java:96

  • When multiple legacy keys are defined for the same new key, resolveWithLegacyNames() can emit multiple WARN logs even though only the highest-precedence legacy value ends up being used.
    private static ConfigValue resolveWithLegacyNames(ConfigSourceInterceptorContext context, String name,
            List<String> legacyNames) {
        ConfigValue value = context.proceed(name);
        for (String legacyName : legacyNames) {
            ConfigValue legacyValue = context.proceed(legacyName);
            if (legacyValue != null && (value == null || CONFIG_SOURCE_COMPARATOR.compare(legacyValue, value) > 0)) {
                logWarningForResolvedKey(name, legacyName);
                value = legacyValue.withName(name);
            }
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 25, 2026 22:57
@winklerm
winklerm force-pushed the fix/false-positive-warnings-on-properties branch from a32e316 to 28ad0d7 Compare August 25, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@winklerm

Copy link
Copy Markdown
Contributor Author

Tested with FSR locally, looks good.

@greyhairredbear greyhairredbear left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks for cleaning this up!

@triceo triceo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving in Radek's absence. Was validated with models.

@triceo triceo modified the milestone: v2.6.0 Aug 26, 2026
@winklerm
winklerm merged commit 9d8a59c into TimefoldAI:main Aug 26, 2026
30 of 33 checks passed
triceo pushed a commit that referenced this pull request Aug 26, 2026
The warning must only be logged when a legacy value is actually chosen
over the new one, not merely because the requested name happens to have
a known legacy counterpart (which may itself be unset).

Closes #2616.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/service Issues related to timefold-solver-service components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive warnings for new property names

4 participants