Skip to content

refactor(infra): rename Cloudflare Queue to loopover-jobs with dual-consume drain - #5558

Merged
JSONbored merged 1 commit into
mainfrom
loopover/queue-rename
Jul 13, 2026
Merged

refactor(infra): rename Cloudflare Queue to loopover-jobs with dual-consume drain#5558
JSONbored merged 1 commit into
mainfrom
loopover/queue-rename

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Creates loopover-jobs and loopover-jobs-dlq (live, empty, verified via wrangler queues list), switches the JOBS producer binding to write there going forward, and keeps the old gittensory-jobs/-dlq queues wired as active consumers during the drain window so any message already in flight at cutover still gets processed.

The queue() handler in src/index.ts needed zero code changes — it's already queue-name-agnostic (dispatches by the -dlq suffix, not a brand-specific string match), confirmed by reading the dispatch logic directly. This is purely a wrangler.jsonc binding change.

Follow-up (not this PR): once wrangler queues info gittensory-jobs confirms it's drained to zero, remove the 2 old-queue consumer entries and retire gittensory-jobs/-dlq themselves.

Deliberately NOT touched: gittensory-webhooks/-dlq

Traced the code path: enqueueWebhookByEnv (the only writer of the WEBHOOKS binding) returns "review_unavailable" immediately via if (!isSelfHostedReviewRuntime(env)), before ever reaching env.WEBHOOKS.send() — this check is always false on the hosted Cloudflare Worker. src/env.d.ts's own comment confirms: "Cloudflare no longer binds this because hosted reviews are retired." The live gittensory-webhooks queue has a consumer bound to this Worker but 0 producers (confirmed via wrangler queues info gittensory-webhooks) — this strongly suggests it's leftover infrastructure from before direct-review-app webhook handling was retired in favor of the Orb broker's /v1/orb/webhook ingress. Renaming dead infrastructure under a new name didn't seem right, so this is flagged as a separate cleanup/deletion decision rather than migrated here.

Test plan

  • Full npm run test:ci gate green.
  • wrangler queues list confirms loopover-jobs/loopover-jobs-dlq exist, live, empty.
  • Confirmed via direct code reading that no test hardcodes the gittensory-jobs queue name (the dispatch logic being name-agnostic means zero test updates were needed).
  • cf-typegen:check confirms no drift.

Part of #4768.

…onsume drain

Creates loopover-jobs and loopover-jobs-dlq, switches the JOBS producer
binding to write there going forward, and keeps the old gittensory-jobs/-dlq
queues as active consumers during the drain window so any message already
in flight at cutover still gets processed. Remove the 2 old-queue consumer
entries once `wrangler queues info gittensory-jobs` confirms it's drained,
then retire the old queues themselves.

The queue() handler in src/index.ts needed zero code changes -- it's already
queue-name-agnostic (dispatches by the "-dlq" suffix, not a brand-specific
string), so this is purely a wrangler.jsonc binding change.

Deliberately NOT touched: gittensory-webhooks/-dlq. Investigation found the
WEBHOOKS Queue binding is only ever reached by enqueueWebhookByEnv's
self-host-only code path (gated behind isSelfHostedReviewRuntime, which is
always false on this hosted Worker -- direct-review-app webhook enqueue is
retired in favor of the Orb broker's /v1/orb/webhook ingress). The live
gittensory-webhooks queue has 0 producers, confirming its consumer binding
is leftover from before that retirement -- renaming dead infrastructure
under a new name didn't seem right, so it's flagged separately for a
cleanup/deletion decision rather than migrated here.

Part of #4768.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.91%. Comparing base (a5bec8a) to head (716403e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5558   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files         570      570           
  Lines       45351    45351           
  Branches    14675    14675           
=======================================
  Hits        43046    43046           
  Misses       1571     1571           
  Partials      734      734           
Flag Coverage Δ
shard-1 44.14% <ø> (-0.01%) ⬇️
shard-2 35.67% <ø> (-0.04%) ⬇️
shard-3 31.94% <ø> (-0.15%) ⬇️
shard-4 31.72% <ø> (+0.58%) ⬆️
shard-5 32.86% <ø> (-0.01%) ⬇️
shard-6 44.41% <ø> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 13, 2026
@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-13 05:11:40 UTC

1 file · 1 AI reviewer · 1 blocker · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This is a config-only wrangler.jsonc change that renames the producer binding from gittensory-jobs to loopover-jobs while keeping both old and new consumers active during a drain window, plus adding the loopover-jobs-dlq consumer. The queue() handler dispatch logic is confirmed to be queue-name-agnostic (dispatches on -dlq suffix), so no code changes are needed, and the diff structure (new producer, new main+dlq consumers, retained old main+dlq consumers with identical batch/retry settings) matches that intent. The PR description references a follow-up issue (#4768) for the drain-window cleanup, which is a reasonable pattern for a zero-downtime queue migration.

Nits — 5 non-blocking
  • The diff doesn't show a linked/eligible open issue number in the title beyond the inline comment reference to Rename the Cloudflare Queue #4768 — confirm this PR is tied to an actual open issue per repo convention.
  • wrangler.jsonc:298-330 duplicates the full consumer config (batch size, concurrency, retries, backoff) between the new and old queues; worth extracting a shared comment note if this pattern recurs for future queue migrations, but is inherent to the drain-window approach so not truly avoidable now.
  • The comment block correctly documents the gittensory-webhooks decision to not migrate dead infrastructure, which is good practice worth calling out as a positive.
  • Consider adding a tracking issue checklist item or TODO with a target date for removing the two old gittensory-jobs* consumer entries once wrangler queues info confirms drain, so this doesn't linger indefinitely.
  • Since this is JSON/JSONC-only, no src/** changes are covered by unit tests — confirm the test:ci gate includes any config-schema validation for wrangler.jsonc so a malformed consumer block would be caught.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 399 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 399 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed).
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 44 PR(s), 399 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 13, 2026
@JSONbored
JSONbored merged commit c390844 into main Jul 13, 2026
17 checks passed
@JSONbored
JSONbored deleted the loopover/queue-rename branch July 13, 2026 05:16
JSONbored added a commit that referenced this pull request Jul 13, 2026
The old gittensory-jobs/-dlq drain-window consumers (added in #5558) are
removed now that `wrangler queues info gittensory-jobs` confirms 0
producers and the queue fully drained -- the JOBS producer has been writing
exclusively to loopover-jobs since that PR merged. Completes the #4768
queue rename; the Cloudflare-side queue objects themselves are deleted
directly (not tracked in code) once this deploys and the consumer binding
that currently blocks deletion is released.

Closes #4768.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant