chore: 2.0 migration docs and final API cleanup#2178
chore: 2.0 migration docs and final API cleanup#2178triceo merged 18 commits intoTimefoldAI:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds/reshapes the Timefold Solver 2.0 migration documentation and aligns parts of the migration tooling + PhaseCommandContext API to the 2.0 breaking changes.
Changes:
- Replaces the “upgrade to latest” doc with a new “upgrade from v1 to 2.0.0” guide and adds dedicated migration guides (chained variables, variable listeners).
- Extends the OpenRewrite migration recipe (and test stubs) to remove additional removed APIs (e.g. ConstraintFactory default constraint package, tabu-related config methods).
- Updates
PhaseCommandContext/DefaultPhaseCommandContextAPI to split temporary execution vs temporary execution with fresh score computation.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/migration/src/test/java/ai/timefold/solver/migration/v2/GeneralMethodDeleteInvocationMigrationRecipeTest.java | Adds stubs and a new rewrite test covering removal of getDefaultConstraintPackage(). |
| tools/migration/src/main/java/ai/timefold/solver/migration/v2/GeneralMethodDeleteInvocationMigrationRecipe.java | Adds additional method-removal recipes (tabu + ConstraintFactory). |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc | Removes the previous “upgrade to latest” page. |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc | Introduces a comprehensive 1.x → 2.0.0 upgrade recipe. |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/migration-guides/variable-listeners-to-custom-shadow-variables.adoc | New migration guide for replacing variable listeners with custom shadow variables. |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/migration-guides/chained-variables-to-planning-list-variable.adoc | New migration guide for replacing chained variables with planning list variables. |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/migration-guides/.migration-guides.adoc | Adds an include aggregator for migration guides. |
| docs/src/modules/ROOT/pages/upgrading-timefold-solver/.upgrading-timefold-solver.adoc | Switches the included upgrade guide to the new v1→v2 page. |
| docs/src/modules/ROOT/pages/optimization-algorithms/overview.adoc | Updates PhaseCommand guidance to include new execute/temporary variants and score freshness notes. |
| docs/src/modules/ROOT/nav.adoc | Updates navigation to include the new upgrade guide and migration guides. |
| docs/TODO.md | Removes the 2.0 TODO checklist file. |
| core/src/main/java/ai/timefold/solver/core/impl/phase/custom/DefaultPhaseCommandContext.java | Adjusts temporary execution API and adds executeTemporarilyAndCalculateScore. |
| core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java | Updates API docs and adds new temporary execution method variants. |
core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java
Outdated
Show resolved
Hide resolved
.../main/java/ai/timefold/solver/migration/v2/GeneralMethodDeleteInvocationMigrationRecipe.java
Outdated
Show resolved
Hide resolved
...pgrading-timefold-solver/migration-guides/variable-listeners-to-custom-shadow-variables.adoc
Outdated
Show resolved
Hide resolved
...pgrading-timefold-solver/migration-guides/variable-listeners-to-custom-shadow-variables.adoc
Outdated
Show resolved
Hide resolved
...pgrading-timefold-solver/migration-guides/variable-listeners-to-custom-shadow-variables.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java:7
- The import of DefaultPlanningSolutionMetaModel is unused (and also creates an API-to-impl dependency), which will fail compilation; remove the import and keep PhaseCommandContext limited to public API types.
import ai.timefold.solver.core.preview.api.domain.metamodel.PlanningSolutionMetaModel;
...pgrading-timefold-solver/migration-guides/variable-listeners-to-custom-shadow-variables.adoc
Outdated
Show resolved
Hide resolved
.../main/java/ai/timefold/solver/migration/v2/GeneralMethodDeleteInvocationMigrationRecipe.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/impl/phase/custom/DefaultPhaseCommandContext.java
Outdated
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/impl/phase/custom/DefaultPhaseCommandContext.java
Show resolved
Hide resolved
...igration/src/main/java/ai/timefold/solver/migration/v2/GeneralTypeChangeMigrationRecipe.java
Show resolved
Hide resolved
.../upgrading-timefold-solver/migration-guides/chained-variables-to-planning-list-variable.adoc
Outdated
Show resolved
Hide resolved
.../upgrading-timefold-solver/migration-guides/chained-variables-to-planning-list-variable.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-from-v1.adoc
Outdated
Show resolved
Hide resolved
zepfred
left a comment
There was a problem hiding this comment.
The documentation is very detailed. LGTM!
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 23 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
core/src/main/java/ai/timefold/solver/core/impl/move/MoveDirector.java:353
- MoveDirector.executeTemporary(..., guaranteeFreshScore=false) undoes variable changes but leaves the solution's score field set to the temporary score, so either restore the original score via SolutionDescriptor.setScore(...) after close() or document that the score becomes stale unless guaranteeFreshScore is true.
public @Nullable <Result_> Result_ executeTemporary(Move<Solution_> move,
Function<Solution_, @Nullable Result_> postprocessor,
boolean guaranteeFreshScore) {
var ephemeralMoveDirector = ephemeral();
ephemeralMoveDirector.execute(move, true);
var result = postprocessor.apply(backingScoreDirector.getWorkingSolution());
ephemeralMoveDirector.close(); // This undoes the move.
if (guaranteeFreshScore) {
backingScoreDirector.calculateScore();
}
core/src/main/java/ai/timefold/solver/core/api/solver/phase/PhaseCommandContext.java
Show resolved
Hide resolved
|


No description provided.