Skip to content

fix: give a from-patch dataset the name and the tags of config.run - #2837

Open
larsbeck wants to merge 2 commits into
TimefoldAI:mainfrom
larsbeck:fix/from-patch-run-configuration
Open

larsbeck wants to merge 2 commits into
TimefoldAI:mainfrom
larsbeck:fix/from-patch-run-configuration

Conversation

@larsbeck

Copy link
Copy Markdown
Contributor

Fixes #2835.

Cause

AbstractModelAPIResource.fromPatch gave only the name query parameter to SolverWorkerFacade.patchDataset, and patchDataset had no parameter for the tags. So from-patch ignored config.run.name and config.run.tags: the new dataset got a generated name and no tags, but its configuration had the run of the request.

Change

  • fromPatch reads the name and the tags from config.run, as fromInput does: the name query parameter wins over config.run.name. Both endpoints use the same two private helpers now (runName, runTags).
  • SolverWorkerFacade.patchDataset and patchAndSolveDataset get Set<String> tags, as createDataset has. DefaultSolverWorkerFacade puts the tags on the metadata of the new dataset. DefaultSolverWorkerFacade is the only implementation, and AbstractModelAPIResource is the only caller, also in timefold-solver-enterprise.

POST /{resource} uses the opposite order: there config.run.name wins over the name query parameter. This PR does not change that.

Tests

  • EmployeeScheduleResourceTest.fromPatchTakesTheNameAndTagsOfTheRunConfiguration (REST, two cases: without and with the name query parameter): fails without the fix (a generated name, no tags), passes with it.
  • AbstractModelAPIResourceTest (new, in the rest module): calls fromPatch and fromInput with a recording SolverWorkerFacade (a java.lang.reflect.Proxy; the module has no Mockito). It is in the main build, so SonarCloud counts its coverage.
  • DefaultSolverWorkerFacadeTest: the patch tests give tags and check them on the new dataset.

./mvnw clean install -pl service/definition,service/rest,service/worker -amd and ./mvnw verify --file service/test-model/pom.xml pass. I ran both with -Dquarkus.http.test-port=0, because another process used port 8081 on my machine.

#2834 (the model-request of the same dataset) is a separate fix in #2836. Both change DefaultSolverWorkerFacade.createPatchedDataset, in different lines.

A second-model review (Codex, 2 rounds) found no defects.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UUczJWM11RcvAp1qAfp4p4

from-patch took the name of the new dataset only from the name query
parameter, and ignored config.run.name and config.run.tags. So the
dataset got a generated name and no tags, but its configuration had the
run of the request. Read them as from-input does: the name query
parameter wins over config.run.name. SolverWorkerFacade.patchDataset and
patchAndSolveDataset get the tags, as createDataset does.

Fixes TimefoldAI#2835

Claude-Session: https://claude.ai/code/session_01UUczJWM11RcvAp1qAfp4p4
The test model tests from-patch over REST, but CI builds it outside the
main build, so its coverage does not count. AbstractModelAPIResourceTest
calls fromPatch and fromInput with a recording SolverWorkerFacade.

Claude-Session: https://claude.ai/code/session_01UUczJWM11RcvAp1qAfp4p4
@larsbeck
larsbeck requested review from a team and a balanced review from Copilot November 17, 2026 13:56

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@triceo
triceo removed their request for review November 17, 2026 14:56

This branch was successfully deployed

1 active deployment
internal — b11d1c78 Deployed Nov 17, 2026 by larsbeck via approval_required #1311
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 SDK: from-patch ignores config.run.name and config.run.tags

2 participants