Skip to content

refactor(hub): delete the worker coordinator, rotation and code review feed - #641

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-11525-delete-the-worker-coordinator-and-code-review-feed
Oct 26, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-11525-delete-the-worker-coordinator-and-code-review-feed

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Part of CL-11525. Second of five stacked PRs that remove the old pr-triage path. Since the first PR, every pull request goes through the listener, so the hub code that ran the old path has nothing left to do. This PR deletes it.

Why

The worker queue, deployment rotation and heal, and the standalone code review feed only served the old path. Keeping them around means keeping code that can never run.

What changed

  • Removed the job coordinator, worker spawning and the orphaned-worker release at boot.

  • Removed deployment rotation and heal, and their tenant-config record.

  • Disconnecting a host now releases that host's listener and its managers through the stock cancel. A Bitbucket Data Center disconnect does it right away. Removing the GitHub App credential does it on the next reconcile pass, because the stock credential route does not notify the hub.

  • Removed the code review feed and the head-carry check that only the feed used.

  • Moved the pull request reader and the review request builder (reviewRequestOf, diffHash, cutDiff) into pull-request-reader.ts.

  • Moved the TriageJob type into triage-queue.ts and dropped its unused workflow and source fields.

  • Removed the GitHub token "ensure before a worker deploys" step. The renewal loop still renews tokens.

  • Bitbucket host check: it used to run before a worker was spawned. It now runs before any mail goes to a Bitbucket listener or manager (checkedBitbucketDelivery). A host that is no longer allowed gets no mail.

  • Upgrade now also cancels every live deployment of the workflows the listener replaced: pr-triage, pr-triage-historical, the standalone code review and the PR workflow variants.

  • The portal no longer deploys workflows on load or after saving a key. It deployed only the workflows Upgrade cancels. Removed with it:

    • ensureWorkflows and the registry sync;
    • the release of those workflows when a model key is removed. Removing a model key now releases nothing.

    Upgrade now sets the tenant's deployment lifetime itself.

  • After a credential is replaced, the portal restarts that host's listener: it deploys the newest listener again from the same asset commit, without republishing, then cancels the older ones the way Upgrade does. The workflow-versions route now reports each source deployment's asset and commit (source) so the portal can do this. Managers and judges launch with the current value, so nothing else restarts.

  • Removed the per-repository code review switch from the repository page, since nothing reads the setting any more. The page now shows only Code review needs an isolated place to run when there is no place to run. Slice 4 removes the hub route and the record's codeReview field.

  • A backlog for a repository with no open pull request that is not a draft is accepted with nothing to do. Before, it answered as if Triage were stopped.

  • When a gate read fails partway through a mail, the pull requests recorded before it still go to the listener.

  • Dropped the portal's unread prWorkflowSources.

  • Nothing deploys a listener on its own: not when a host is connected after the last upgrade, not when a decision model is saved from Settings, and not when someone who cannot upgrade finishes onboarding. Settings then says Triage is stopped until it is upgraded and shows the button. The manual's upgrade section says so.

  • ARCHITECTURE.md, IMPLEMENTATION.md, BITBUCKET_DATACENTER.md and the user manual are updated. The code review sections now say code review runs with triage when the policy file turns it on, or on Review again.

Verified

  • bun run check, bun run lint and the policy check pass.
  • Hub and portal tests for the bridge, Bitbucket hooks, code review and its runs, deployment, installation token, tenant patch, source workflow, the pull request reader, manager intake, audit log, coalescer, pause gate, reconciler, Triage again, held Dos, interleave, server and the upgrade pass: 224 tests. One server test timed out under load and passed when re-run on its own.
  • The upgrade test asserts:
    • the replaced workflows are cancelled;
    • a manager and the other host's deployments are left running;
    • the deployment lifetime is set;
    • a restart deploys the newest listener from its own source and stops the older ones, leaving managers and the other host alone.
  • New tests:
    • Disconnecting one host releases its listener and managers and leaves the other host's running.
    • A Bitbucket mail to a refused host never reaches the listener, while a GitHub mail does.
    • A backlog with only drafts is taken with nothing mailed.
    • A gate read failing partway through a mail still mails the heads recorded before it.
  • Full hub, triage-manager and triage-contracts suites: 748 pass. Portal tests: 275 pass, plus 7 DOM tests.
  • There is no portal test that a reload deploys nothing. The code that deployed on load is deleted, so such a test would only check for something that no longer exists.
  • Not verified live: a listener restart after a credential is replaced.

@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown

CL-11525

@TheGreatAxios
TheGreatAxios force-pushed the cl-11525-route-every-pull-request-through-the-listener branch from 35b9d04 to c3aeee0 Compare October 26, 2026 19:22
@TheGreatAxios
TheGreatAxios force-pushed the cl-11525-delete-the-worker-coordinator-and-code-review-feed branch from bf59171 to b0e5488 Compare October 26, 2026 19:22
@TheGreatAxios
TheGreatAxios force-pushed the cl-11525-delete-the-worker-coordinator-and-code-review-feed branch from b0e5488 to e4db003 Compare October 26, 2026 19:39
@TheGreatAxios
TheGreatAxios changed the base branch from cl-11525-route-every-pull-request-through-the-listener to main October 26, 2026 20:13
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 26, 2026 20:13
@TheGreatAxios
TheGreatAxios merged commit c150ec2 into main Oct 26, 2026
4 checks passed
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.

1 participant