feat: add support for moveCountLimit - #1147
Conversation
There was a problem hiding this comment.
Pull request overview
This PR propagates upstream OpenAPI contract changes into the school timetabling quickstart, adding the new moveCountLimit solver termination option to the generated OpenAPI specification and applying minor formatting cleanups in related Java sources.
Changes:
- Update OpenAPI schema for
SolverTerminationConfigto includemoveCountLimitand adjust related descriptions/constraints. - Normalize import grouping/formatting in
TimetableResource. - Reorder an import and remove trailing whitespace in
Timetable.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| getting-started/service/src/main/java/com/acme/schooltimetabling/rest/TimetableResource.java | Minor import formatting (group separation). |
| getting-started/service/src/main/java/com/acme/schooltimetabling/domain/Timetable.java | Import order cleanup and whitespace-only formatting fix. |
| getting-started/service/src/build/openapi.json | Adds moveCountLimit to SolverTerminationConfig and updates termination option descriptions accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@rsynek Do we really need to update quickstarts every time we add something to the API? IMO this crates more work than benefit. |
9c23dda to
fe26f1f
Compare
I agree we need to find a way to make this smoother. |
fe26f1f to
7879df2
Compare
7879df2 to
785013e
Compare
785013e to
13cb0f5
Compare
13cb0f5 to
1d2a065
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (4)
getting-started/service/src/build/openapi.json:2177
- The moveCountLimit property description says "Must be at least 1", but the OpenAPI schema does not include a numeric constraint ("minimum": 1). Adding it improves correctness and helps client-side validation.
"moveCountLimit" : {
"format" : "int64",
"description" : "Maximum number of moves evaluated by the solver. Must be at least 1. The solver will stop solving after a pre-determined amount of moves have been evaluated. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set, unimprovedSpentLimit must be empty. Can be combined with stepCountLimit: the solver stops as soon as either limit is reached. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.",
"type" : "integer",
"example" : 100000
use-cases/conference-scheduling/src/build/openapi.json:2723
- The schema description for moveCountLimit says "Must be at least 1", but the OpenAPI property definition does not include a corresponding numeric constraint ("minimum": 1). Adding it would make the schema self-descriptive and improve client-side validation.
"moveCountLimit" : {
"format" : "int64",
"description" : "Maximum number of moves evaluated by the solver. Must be at least 1. The solver will stop solving after a pre-determined amount of moves have been evaluated. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set, unimprovedSpentLimit must be empty. Can be combined with stepCountLimit: the solver stops as soon as either limit is reached. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.",
"type" : "integer",
"example" : 100000
use-cases/conference-scheduling/src/build/openapi.json:2717
- The schema now states stepCountLimit "Must be at least 1", but the OpenAPI property definition does not enforce this (no "minimum": 1). This makes the contract inconsistent with the description and may lead to clients sending invalid values without early validation.
This issue also appears on line 2719 of the same file.
"stepCountLimit" : {
"format" : "int32",
"description" : "Maximum solver step count. Must be at least 1. The solver will stop solving after a pre-determined amount of steps. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set, unimprovedSpentLimit must be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.",
"type" : "integer",
"example" : 1000
getting-started/service/src/build/openapi.json:2171
- The schema now states stepCountLimit "Must be at least 1", but the OpenAPI property definition does not enforce this constraint (no "minimum": 1). This makes the contract inconsistent with the description and may reduce usefulness for generated clients.
This issue also appears on line 2173 of the same file.
"stepCountLimit" : {
"format" : "int32",
"description" : "Maximum solver step count. Must be at least 1. The solver will stop solving after a pre-determined amount of steps. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set, unimprovedSpentLimit must be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.",
"type" : "integer",
"example" : 1000
1d2a065 to
c2e88e7
Compare
|
Ad API changes: that's the unfortunate side effect of having the backward compatibility check for diffs in the openapi.json. We don't need the file for anything else, although it's good for a model developer to see the resulting specs before merging a PR. Options: B) Make the diff checking optional via a maven profile and disable it for quickstarts (but does not solve the general problem). |
c2e88e7 to
1248fae
Compare
|
@cristianonicolai could you kindly reopen the PR from a feature branch in the blessed repo? |
|
Closed in favor of #1164. |
Propagate OpenAPI changes from TimefoldAI/timefold-solver#2570