Repository navigation
feat: the plugin keeps its own record of runs, and the runner port narrows - #213
Merged
SearheiParkhamchuk merged 2 commits intoOct 27, 2026
Conversation
…arrows
The plugin no longer asks the runner what it holds. A new collection,
`translator-runs`, carries one row per (handle, targetLng) and is the source of
truth for every status, cancel and run-now route. Pruning a row whose
`settledAt` is empty strands work the queue still holds, so such a row must be
left alone.
`TaskRunner` drops from five required members to one. `enqueue` is required;
`stop` and `run` are capabilities a provider declares, and a route whose
capability is absent is never registered — so a host never draws a control that
would answer 404. `assertTaskRunnerContract` asserts that a declared capability
is really implemented.
The Payload job row becomes a pointer: `{ handle, locales }` on the workflow and
`{ handle, target_lng }` on the task. Everything else is read back from the
record by the plugin's own handler, so a runner never learns which collection it
is translating. A job queued before the upgrade is adopted on first encounter
rather than read in parallel, which keeps the compatibility in one folder that a
single step can delete.
One run per document at a time: a second request over a document with any
unsettled run is refused rather than merged, decided by a pure rule in
`core/domain/runs`. "No rights" and "busy" are separate fields of the answer.
Rows are written before the job is queued, because a cron that picked the job up
first would find no record and leave the document blocked for good.
Closes #200
SearheiParkhamchuk
requested review from
ChiefCreator and
dogfrogfog
as code owners
October 27, 2026 23:35
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
SearheiParkhamchuk
added a commit
that referenced
this pull request
Oct 27, 2026
The merge of #213 ran the release workflow, found three commits since 1.0.0-next.6 and still reported no relevant changes, so the runner-port step has no prerelease under the `next` dist-tag. This empty commit exists to tell the two causes apart: if it releases, the fault lies in the shape of that merge; if it does not, the fault is in the release configuration.
|
🎉 This PR is included in version 1.0.0-next.7 🎉 The release is available on npm package (@next dist-tag) Your semantic-release bot 📦🚀 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #200. Part of #192.
What changes
The plugin stops asking the runner what it holds. A new collection,
translator-runs, carries one row per(handle, targetLng)and is the source of truth for every status, cancel and run-now route.TaskRunnerdrops from five required members to one:stopandrunare capabilities a provider declares. A route whose capability is absent is never registered, and the control that would call it is not drawn — so a host never sees a button that answers 404.assertTaskRunnerContract, the published conformance suite, asserts that a declared capability is really implemented.The Payload job row becomes a pointer —
{ handle, locales }on the workflow,{ handle, target_lng }on the task. Everything else is read back from the record by the plugin's own handler, so a runner never learns which collection it is translating.Decisions worth reviewing
core/domain/runs, with two callers.payload-jobs-runner/legacy/; deleting that folder and its two call sites drops it entirely.Host-facing consequences
payload migrate:create+payload migrate; dev push in development). MongoDB infers it.settledAtis empty must not be pruned. The queue now holds only a pointer, so deleting such a row strands work that cannot be run. Pruning settled rows stays the host's job.runs.slugexists only to resolve a collision with a collection the host already owns.Deliberately not done
staleJobTimeoutMs, and two unrelated numbers would contradict each other on one row.Verification
From
packages/payload-plugin-translator:bunx vitest runbun run check-typesbunx oxlint .From the root:
bunx turbo run build(realtscdeclaration build) andbunx turbo run check-types(9/9) both clean.Integration, from
apps/dev, every adapter and both queue modes:enableConcurrencyControlThe skips are deliberate: the transaction cases run only on PostgreSQL, two cases need an adapter without transactions, and MongoDB builds the unique index in the background after the first write.
Design record
packages/payload-plugin-translator/docs/plans/2026-10-26-the-plugin-keeps-its-own-record.design.md, with six step contracts beside it.