refactor(queue): extract job-dispatch.ts from processors.ts - #4971
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4971 +/- ##
==========================================
+ Coverage 94.27% 94.29% +0.01%
==========================================
Files 451 452 +1
Lines 38900 38900
Branches 14172 14172
==========================================
+ Hits 36674 36679 +5
+ Misses 1574 1572 -2
+ Partials 652 649 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 06:14:36 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
46841ff to
9e8336d
Compare
Final step of #4013. Moves the top-level processJob dispatcher (a pure switch over JobMessage["type"]) into its own file. This is the most interdependent piece of the split -- job-dispatch.ts imports most of its handlers back from processors.ts (which stays large; nothing else in processors.ts functions (and processGitHubWebhook) are exported for this one-directional import-back. processors.ts re-exports processJob for src/index.ts, src/server.ts, and the test suite. Also removes ~28 imports in processors.ts that were orphaned once processJob (their only remaining caller) moved out, and adds two regression tests for job-dispatch branches that were untested even in the original file (retry-orb-relay dispatch; a notify-evaluate payload with neither the events array nor the legacy singular event field).
9e8336d to
abc7474
Compare
Summary
siblings in the same sequence, so the tracking issue is left open here and will be closed manually once
every PR in the sequence has merged.
processJobdispatcher (a pure switch overJobMessage["type"]) intosrc/queue/job-dispatch.ts. This is the most interdependent piece of the split: job-dispatch.ts importsmost of its handlers back from
processors.ts, which stays large (nothing in refactor(queue): split processors.ts into cohesive modules #4013's deliverables callsfor removing it, only slimming it).
processors.tsfunctions (plusprocessGitHubWebhook) are exported for thisone-directional import-back.
processors.tsre-exportsprocessJobforsrc/index.ts,src/server.ts,and the ~22 test files that import it directly.
processors.tsthat became orphaned onceprocessJob(their only remainingcaller) moved out.
the code surfaced them, same pattern as prior steps in this sequence): the
retry-orb-relaydispatch case,and a
notify-evaluatepayload with neither theeventsarray nor the legacy singulareventfield.Test plan
npx tsc --noEmit -p .cleannpm run test:coverage: 703 files / 13935 tests passed, 0 failedsrc/queue/job-dispatch.ts: 100% statements/branches/functions/linesnpm run docs:drift-check,manifest:drift-check,engine-parity:drift-checkall passnpm audit --audit-level=moderate: 0 vulnerabilities