Re-roll one patch against a release
reroll_patchRe-roll one composer patch that check_patches reported conflicts: a 3-way merge of the patch onto the installed release, returned as a new diff. Call check_patches first for the whole list. Call this once per patch that came back conflicts.
Input: project, version, patch, title, base. patch is the diff text; this service downloads nothing, so fetch a URL patch yourself and send what came back. base is the release the site had before the upgrade. One patch per call. A hand-made patch without index lines is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used.
reroll.verified true: the service already ran the check. reroll.verified_by: the command, the -p level and the tag. Write reroll.patch to the patch file and move on. Do not run git apply --check or patch --dry-run. Do not diff against a copy of the release. composer install is the test.
After a conflicts result, send the same project, version and patch again with resolutions, one per region of reroll.conflicts[].hunks. A resolution is {file, region, choice: release|patch}, {file, region, text}, or {file, region, delete: true}. The service re-merges with your decisions and apply-checks the diff. What comes back is the finished patch file: write it and run composer install. Do not read the release files, edit the patch by hand, or dry-run it.
reroll.status clean: every file merged and the diff apply-checked against the release, reroll.verified true. Write reroll.patch as the new patch file; no re-test needed. An empty reroll.patch with reroll.note means the release already has the change; suggested is merged.
reroll.status conflicts: reroll.patch holds the hunks that merged cleanly, apply-checked when reroll.verified is true. Each file in reroll.conflicts has hunks with the three sides of every region. release: what the release has. base: what the patch was written against. patch: what the patch wants. release_line and release_context: the release file's numbered lines around the region. Write the missing hunks from those and append them to reroll.patch. No download, file read or dry-run is needed.
reroll.syntax_errors: files that do not parse after the merge, with the parser's line. reroll.verified is false then, though the diff applies. Fix the text of the resolutions on those files and call again.
reroll.status unavailable: no release takes the patch, or it was made from a commit in no release; reroll.error says which. Re-roll by hand from hunks_failed.
reroll.patch paths are relative to the repository root. Contrib patches apply at -p1. Core patches start with core/ and apply at -p2 from web/core. patch_truncated: the diff was cut to the result budget; POST /v1/patch/check on api.tresbien.tech with reroll: true returns it whole.
A patch that still applies (applies_at set) or is already in the release (merged) returns its verdict with reroll null.
core_references: as on check_patches, read from the re-rolled diff when the merge was clean. Removed or moved core classes, and calls whose argument count no longer fits the target signature, at target_core.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Optional. The release the site had before the upgrade. Its commit sha from composer.lock (source.reference), or its composer version: 6.1.0 when version is 6.2.0. A patch without index lines is merged from it when it applies there, before the newest tags are tried. | |
| patch | Yes | Unified diff text. This service downloads nothing, so fetch a URL patch yourself and send what came back. With the index lines git diff writes, it is merged onto the release. Without them (hand-made), it is merged from base when it applies there, else from the newest tag it applies to. reroll.base is the tag used. | |
| title | No | Optional, echoed back. | |
| project | Yes | drupal.org machine name (webform) or composer name (drupal/webform); drupal or core for Drupal core. | |
| version | Yes | The composer version installed, e.g. 1.13.0 or 11.4.5. | |
| resolutions | No | Decisions for the conflicted regions of a previous call on the same project, version and patch, one entry per region. region: the index in that file's conflicts[].hunks. {file, region, choice}: choice is release or patch. {file, region, text}: your own text for the region. {file, region, delete: true}: empty the region. The service re-runs the merge with them and apply-checks the result. Regions you leave out keep the release side and come back in reroll.resolutions_missing. | |
| target_core | No | The core version the added code is checked against (11.4.5). Defaults to version for a core patch. |