Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/downstream_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ jobs:
permissions:
contents: read
concurrency:
group: downstream-${{ inputs.repository }}-${{ github.event_name }}-${{ inputs.head_ref }}
group: downstream-${{ inputs.repository }}-${{ github.event_name }}-${{ inputs.head_ref }}-${{ matrix.java-version }}
cancel-in-progress: true
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
java-version: [ 25, 27 ] # Current LTS and latest JDK; replace 27 on each JDK release.
timeout-minutes: 120
steps:
# Clone timefold-solver
Expand Down Expand Up @@ -89,10 +93,10 @@ jobs:
path: ./${{ inputs.repository }}
fetch-depth: 0

- name: Setup Temurin 25 and Maven
- name: Setup Temurin and Maven
uses: actions/setup-java@v6.0.1
with:
java-version: '25'
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
permissions:
contents: read
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest ]
java-version: [ 25 ] # Latest LTS if not Ubuntu
include:
java-version: [ 25, 27 ] # Current LTS and latest JDK; replace 27 on each JDK release.
include: # Compile target and minimum runtime; Linux only.
Comment thread
triceo marked this conversation as resolved.
- os: ubuntu-latest
java-version: 21
- os: ubuntu-24.04-arm
Expand Down Expand Up @@ -85,10 +86,11 @@ jobs:
permissions:
contents: read
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm ] # Windows doesn't work, Mac is not a deploy OS.
module: ["spring-integration", "quarkus-integration"]
java-version: [ 25 ] # We only test Quarkus with the latest native image.
java-version: [ 25 ] # GraalVM only available for LTS.
timeout-minutes: 120
steps:
- uses: actions/checkout@v7
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pull_request_quickstarts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ jobs:
permissions:
contents: read
concurrency:
group: downstream-quickstarts-${{ github.event_name }}-${{ github.head_ref }}
group: downstream-quickstarts-${{ github.event_name }}-${{ github.head_ref }}-${{ matrix.java-version }}
cancel-in-progress: true
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
java-version: [ 25, 27 ] # Current LTS and latest JDK; replace 27 on each JDK release.
Comment thread
triceo marked this conversation as resolved.
timeout-minutes: 120
steps:
# Clone timefold-solver
Expand Down Expand Up @@ -60,10 +64,10 @@ jobs:
fetch-depth: 0 # Otherwise merge will fail on account of not having history.

# Build and test
- name: Setup Temurin 25 and Maven
- name: Setup Temurin and Maven
uses: actions/setup-java@v6.0.1
with:
java-version: '25'
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'
- name: Quickly build timefold-solver
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/pull_request_secure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ jobs:
permissions:
contents: read
concurrency:
group: downstream-enterprise-${{ github.event_name }}-${{ github.head_ref }}
group: downstream-enterprise-${{ github.event_name }}-${{ github.head_ref }}-${{ matrix.java-version }}
cancel-in-progress: true
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
# Compile target, current LTS and latest JDK; replace 27 on each JDK release.
java-version: [ 21, 25, 27 ]
timeout-minutes: 120
steps:
# Clone timefold-solver
Expand Down Expand Up @@ -107,10 +112,10 @@ jobs:
fetch-depth: 0 # Otherwise merge will fail on account of not having history.

# Build and test
- name: Setup Temurin 21 and Maven
- name: Setup Temurin and Maven
uses: actions/setup-java@v6.0.1
with:
java-version: '21'
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'
- name: Quickly build timefold-solver
Expand Down Expand Up @@ -140,10 +145,11 @@ jobs:
permissions:
contents: read
strategy:
fail-fast: false # A broken JDK must not cancel the others.
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm ] # Windows doesn't work, Mac is not a deploy OS.
module: [ "spring-boot", "quarkus" ]
java-version: [ 25 ] # We only test Quarkus with the latest native image.
java-version: [ 25 ] # GraalVM only available for LTS.
timeout-minutes: 120
steps:
# Clone timefold-solver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ private static <Container_> void assertUnfairness(
LoadBalance<String> actualResult = collector.finisher().apply((Container_) container);
assertThat(actualResult.unfairness())
.as("Collector (" + collector + ") did not produce expected result.")
.isEqualTo(expectedValue);
.isEqualByComparingTo(expectedValue); // Scale-safe comparison.
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ private static <Container_> void assertUnfairness(
LoadBalance<String> actualResult = collector.finisher().apply((Container_) container);
assertThat(actualResult.unfairness())
.as("Collector (" + collector + ") did not produce expected result.")
.isEqualTo(expectedValue);
.isEqualByComparingTo(expectedValue); // Scale-safe comparison.
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ private static <Container_> void assertUnfairness(
LoadBalance<String> actualResult = collector.finisher().apply((Container_) container);
assertThat(actualResult.unfairness())
.as("Collector (" + collector + ") did not produce expected result.")
.isEqualTo(expectedValue);
.isEqualByComparingTo(expectedValue); // Scale-safe comparison.
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ private static <Container_> void assertUnfairness(
LoadBalance<String> actualResult = collector.finisher().apply((Container_) container);
assertThat(actualResult.unfairness())
.as("Collector (" + collector + ") did not produce expected result.")
.isEqualTo(expectedValue);
.isEqualByComparingTo(expectedValue); // Scale-safe comparison.
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[NOTE]
====
Our automatic migrations will not change the version of your frameworks.
NOTE: Our automatic migrations will not change the version of your frameworks.
If you run into compatibility issues, please consult the integration guides for xref:running-timefold-solver/library/spring-boot.adoc#integrationWithSpringBoot[Spring] or xref:running-timefold-solver/library/quarkus.adoc#integrationWithQuarkus[Quarkus].
====
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NOTE: The migration tool only works on JDK 25 or earlier, because OpenRewrite only supports LTS versions of Java.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ curl https://raw.githubusercontent.com/TimefoldAI/timefold-solver/refs/tags/v{ti

include::framework-version-warning.adoc[leveloffset=+1]

include::migration-jdk-warning.adoc[]

Having done that, you can check the local changes and commit them.

For the time being, Kotlin users need to follow the upgrade recipe and apply the steps manually.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ curl https://raw.githubusercontent.com/TimefoldAI/timefold-solver/refs/tags/v{ti

include::framework-version-warning.adoc[leveloffset=+1]

include::migration-jdk-warning.adoc[]

Having done that, you can check the local changes and commit them.

For the time being, Kotlin users need to follow the upgrade recipe and apply the steps manually.
Expand Down
1 change: 1 addition & 0 deletions tools/migration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<description>
Upgrade your code with a single command.
This migration replaces all your calls to deleted/deprecated methods of Timefold with their proper alternatives.
Only runs on JDK 25 or older, on account of OpenRewrite only supporting LTS Java versions.
</description>
<url>https://solver.timefold.ai</url>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ai.timefold.solver.migration;

import static org.junit.jupiter.api.Assumptions.assumeTrue;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.test.RewriteTest;

@Execution(ExecutionMode.CONCURRENT)
public abstract class AbstractRecipeTest implements RewriteTest {

@BeforeAll
static void skipOnUnsupportedJdk() {
// OpenRewrite supports only LTS JDKs.
assumeTrue(Runtime.version().feature() <= 25, "OpenRewrite does not support JDK > 25.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
import static org.openrewrite.maven.Assertions.pomXml;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

@Execution(ExecutionMode.CONCURRENT)
class ChangeVersionRecipeTest implements RewriteTest {
class ChangeVersionRecipeTest extends AbstractRecipeTest {

private final ChangeVersionRecipe recipe = new ChangeVersionRecipe();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@

import java.util.List;

import ai.timefold.solver.migration.AbstractRecipeTest;
import ai.timefold.solver.migration.NoWildCardImportStyle;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class NeighborhoodsMigrationRecipeTest implements RewriteTest {
class NeighborhoodsMigrationRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class AsConstraintRecipeTest implements RewriteTest {
class AsConstraintRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class ConstraintRefRecipeTest implements RewriteTest {
class ConstraintRefRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class NullableRecipeTest implements RewriteTest {
class NullableRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class RemoveConstraintPackageRecipeTest implements RewriteTest {
class RemoveConstraintPackageRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class ScoreGettersRecipeTest implements RewriteTest {
class ScoreGettersRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class ScoreManagerMethodsRecipeTest implements RewriteTest {
class ScoreManagerMethodsRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

import static org.openrewrite.java.Assertions.java;

import ai.timefold.solver.migration.AbstractRecipeTest;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
import org.openrewrite.test.TypeValidation;

@Execution(ExecutionMode.CONCURRENT)
class SingleConstraintAssertionRecipeTest implements RewriteTest {
class SingleConstraintAssertionRecipeTest extends AbstractRecipeTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down
Loading
Loading