Skip to content

test(selfhost): cover jobCoalesceKey missing-field fallbacks for 6 job types - #5862

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:test-jobcoalescekey-fallbacks
Jul 14, 2026
Merged

test(selfhost): cover jobCoalesceKey missing-field fallbacks for 6 job types#5862
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:test-jobcoalescekey-fallbacks

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Fixes #5850.

jobCoalesceKey (src/selfhost/queue-common.ts) maps a job payload to a coalesce key. For several job types it fills a missing optional field with a literal fallback token (normalizedX(...) ?? "<fallback>") so the job still coalesces to a stable slot instead of null-ing (and duplicating). Those fallback arms had no direct coverage.

Test-only (no production change): adds one case asserting the exact fallback key when the optional fields are absent, for six job types:

  • backfill-registered-repos…:all:default:0
  • backfill-repo-segment…:unknown:unknown:default:0:start
  • backfill-pr-details…:unknown:default:start
  • generate-review-recap…:all
  • refresh-contributor-activity…:unknown:all
  • rollup-product-usage…:latest:default

All 85 tests in the file pass; typecheck clean.

…b types

Fixes JSONbored#5850.

jobCoalesceKey's '?? "<fallback>"' arms — taken when a payload omits an
optional field so the job still coalesces to a stable key instead of null —
were untested for the backfill/refresh/rollup job types. Adds a case asserting
the exact fallback key for backfill-registered-repos, backfill-repo-segment,
backfill-pr-details, generate-review-recap, refresh-contributor-activity, and
rollup-product-usage when their optional fields are absent.
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-14 20:23:33 UTC

1 file · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a test-only addition that adds one test case covering the missing-field fallback token for six job types in jobCoalesceKey, verified against the actual switch-statement logic in queue-common.ts. Each expected key string was traced against the corresponding case (repo??fallback, mode??fallback, cursor??fallback, boolFlag(undefined)==='0') and all six assertions match the real fallback chain exactly, with no production code changed. This closes the coverage gap named in issue #5850.

Nits — 2 non-blocking
  • The single test bundles six unrelated job types into one `it` block; a failure in one assertion aborts the rest, so splitting into per-type cases (or `it.each`) would give clearer failure isolation.
  • test/unit/selfhost-queue-common.test.ts:932 — consider `it.each` over the six job types to get independent pass/fail reporting per type.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5850
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 75 registered-repo PR(s), 36 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 75 PR(s), 4 issue(s).
Gate result ✅ Passing No configured 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). LLM value judgment: minor — A narrow, correct test-only patch that closes a specific coverage gap tied to issue #5850 without touching production logic.
Linked issue satisfaction

Partially addressed
The PR adds a single consolidated test asserting missing-field fallback keys for backfill-repo-segment, backfill-pr-details, generate-review-recap, refresh-contributor-activity, and rollup-product-usage, but omits generate-weekly-value-report entirely and does not cover generate-signal-snapshots/build-burden-forecasts as alternates, nor does it test the backfill-pr-details happy path or the separa

Review context
  • Author: jaytbarimbao-collab
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 75 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit b5f97e4 into JSONbored:main Jul 14, 2026
14 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(selfhost): jobCoalesceKey's missing-field fallback branches are untested for 6 job types

1 participant