fix(selfhost): expose queue snapshots on bindings - #1973
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-01 06:17:06 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1973 +/- ##
=======================================
Coverage 95.57% 95.57%
=======================================
Files 218 218
Lines 24257 24257
Branches 8795 8795
=======================================
Hits 23184 23184
Misses 436 436
Partials 637 637
🚀 New features to boost your workflow:
|
Motivation
snapshot()fromenv.JOBS, but the actual self-hostJOBSbinding only exposedsend()/sendBatch(), so backlog introspection always returned empty and regate backpressure never applied.Description
snapshot()to the SQLite and Postgres queuebindingobjects so productionenv.JOBSexposes introspection directly (src/selfhost/sqlite-queue.ts,src/selfhost/pg-queue.ts).snapshot()implementation (snapshot: binding.snapshot) so wrapper and binding behavior are identical.snapshot()method while keeping the externalQueuesurface compatible.queueSnapshotFromBinding(q.binding)returns the same snapshot as the durable wrapper: tests updated intest/unit/selfhost-sqlite-queue.test.tsandtest/unit/selfhost-pg-queue.test.ts.Testing
npx vitest run test/unit/selfhost-sqlite-queue.test.ts test/unit/selfhost-pg-queue.test.ts test/unit/selfhost-queue-common.test.ts, and all ran green (3 files, 118 tests passed).npm run typecheckand the TypeScript build passed with no errors.git diff --check && npm run test:ci, but the run was blocked by environment/network related issues:actionlintsetup could not reach GitHub (DNS/EAI_AGAIN) and the WASM fallback flagged runner labels, so the full CI sequence did not complete locally.npm audit --audit-level=moderatefailed due to registry access (403 Forbidden) andnpm run test:coveragewas started but did not complete in this environment; both are environment-blocked rather than regressions in the change.Codex Task