Skip to content

fix(orb): degrade issue-side new-account label to a default instead of a non-null assertion (#8687) - #8714

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-issue-new-account-label-8687
Jul 26, 2026
Merged

fix(orb): degrade issue-side new-account label to a default instead of a non-null assertion (#8687)#8714
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-issue-new-account-label-8687

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Problem

Closes #8687.

RepositorySettings.newAccountLabel is optional. The two PR-side call sites (src/queue/processors.ts:2765,3123) resolve it defensively — settings.newAccountLabel ?? "new-account" — but the issue-side site (:6742) used a bare non-null assertion, issueSettings.newAccountLabel!, despite its own comment claiming "same contract as the PR maintenance path".

A settings source that omits the field (a manifest overlay, or a future source) would label the issue with undefined on the issue path while the PR path silently falls back to "new-account". It's masked today only because resolveRepositorySettings's DB defaults always populate the field.

Fix

Use the same ?? "new-account" fallback as the already-correct PR-side twins. The PR-side sites are unchanged.

Tests

A new test in test/unit/queue-3.test.ts (mirroring the existing account-age issue-path tests) strips newAccountLabel from the resolved settings via the one settings-resolution seam, fires an issues opened webhook for a below-account-age-threshold author, and asserts the applied label is "new-account" — previously undefined. Reverting the source change makes it fail. The existing "configured newAccountLabel" and default-label tests still pass (both ?? branches covered). git diff --check clean.

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 26, 2026 00:24
@superagent-security

Copy link
Copy Markdown
Contributor

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

…ad of a non-null assertion

The two PR-side new-account-label call sites (processors.ts:2765,3123) resolve the optional
RepositorySettings.newAccountLabel defensively (`?? "new-account"`), but the issue-side site
(6742) used a bare non-null assertion (`issueSettings.newAccountLabel!`) despite its own comment
claiming "same contract as the PR maintenance path". A settings source that omits the field (a
manifest overlay, or a future source) would label the issue with `undefined` on the issue path
while the PR path silently falls back to "new-account".

Use the same `?? "new-account"` fallback as the PR-side twins. A new test strips newAccountLabel
from the resolved settings, fires an issues-opened webhook for a below-account-age-threshold author,
and asserts the label applied is "new-account" (previously `undefined`).
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.19%. Comparing base (9e6e57d) to head (82de114).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8714      +/-   ##
==========================================
- Coverage   93.79%   91.19%   -2.60%     
==========================================
  Files         797       97     -700     
  Lines       79474    25673   -53801     
  Branches    24075     5015   -19060     
==========================================
- Hits        74539    23412   -51127     
+ Misses       3563     1993    -1570     
+ Partials     1372      268    -1104     
Flag Coverage Δ
backend 95.66% <100.00%> (+0.59%) ⬆️

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

Files with missing lines Coverage Δ
src/queue/processors.ts 95.66% <100.00%> (+<0.01%) ⬆️

... and 700 files with indirect coverage changes

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

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 00:31:23 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a straightforward one-line defensive fix: the issue-side call site now uses `?? "new-account"` instead of a bare non-null assertion, matching the two already-correct PR-side twins noted in the description. The change is minimal, low-risk, and accompanied by a targeted test that strips `newAccountLabel` at the settings-resolution seam and verifies the fallback label is applied on the issue path (previously would have been `undefined`). The fix is correctly traced to the actual defect (the bare `!` at processors.ts:6742) rather than patched at a symptom layer.

Nits — 3 non-blocking

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8687
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: 329 registered-repo PR(s), 137 merged, 37 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 329 PR(s), 37 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff changes the issue-side call site to `issueSettings.newAccountLabel ?? "new-account"`, matching the PR-side twins exactly as requested, and leaves those PR-side sites untouched.

Review context
  • Author: RealDiligent
  • 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: 329 PR(s), 37 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.
🧪 Chat with LoopOver

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

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

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

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

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

@loopover-orb
loopover-orb Bot merged commit 4217721 into JSONbored:main Jul 26, 2026
8 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.

fix(orb): issue-side new-account labeling uses a non-null assertion where the PR-side twin defensively falls back

1 participant