Skip to content

test(signals): cover panelSummary's gateHeld-no-summary fallback - #5475

Merged
JSONbored merged 1 commit into
mainfrom
test/engine-panel-summary-coverage
Jul 12, 2026
Merged

test(signals): cover panelSummary's gateHeld-no-summary fallback#5475
JSONbored merged 1 commit into
mainfrom
test/engine-panel-summary-coverage

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Follow-up to the now-merged #5468 (check-run/PR-comment brand rename). That PR's codecov/patch check flagged src/signals/engine.ts's panelSummary ternary as only partially covered on the line it happened to rename — a pre-existing gap surfaced by touching the line, not a regression introduced by it, but worth closing regardless since it turned out no test at all exercised this fallback string.

Root cause: "action_required" makes gate evaluation BOTH gateBlocking and gateHeld true, and the ternary checks gateBlocking first — so the one existing action_required test in this file only ever reached the gateBlocking branch, never gateHeld's own "... is holding this PR for maintainer review." literal fallback. That fallback only renders when args.gate is entirely absent (not just missing a summary, since the type requires summary: string), which requires repo: null so gateConclusion resolves to "neutral" via fallbackGateConclusion's !args.repo arm instead. Same pattern as an existing adjacent test for the sibling buildPublicPrPanelSignalRows function (test/unit/signals-coverage.test.ts:816-818).

No production code changes — test-only.

Test plan

  • npm run typecheck clean
  • npm run test:ci green (786/788 test files, 2 pre-existing skips)
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Verified via unsharded npm run test:coverage that src/signals/engine.ts is now at 99.26%/98.06% (stmt/branch), with the target lines no longer in the uncovered list

codecov/patch flagged src/signals/engine.ts's panelSummary line as
partially covered after the brand rename touched it: "action_required"
is BOTH gateBlocking and gateHeld, so the existing test exercising it
only ever reached the gateBlocking branch of the ternary, never the
gateHeld branch's own "LoopOver is holding this PR for maintainer
review." literal fallback (args.gate?.summary is only ever undefined
when no gate object is passed at all, which requires repo: null to
resolve gateConclusion to "neutral" via fallbackGateConclusion instead).
A pre-existing gap, not introduced by the rename, but surfaced by it.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 12, 2026
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.72%. Comparing base (29c18f2) to head (ddcc8dd).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5475   +/-   ##
=======================================
  Coverage   94.72%   94.72%           
=======================================
  Files         559      559           
  Lines       44664    44664           
  Branches    14664    14664           
=======================================
  Hits        42308    42308           
  Misses       1621     1621           
  Partials      735      735           
Flag Coverage Δ
shard-1 43.79% <ø> (-0.25%) ⬇️
shard-2 35.20% <ø> (-0.01%) ⬇️
shard-3 32.16% <ø> (+0.15%) ⬆️
shard-4 31.47% <ø> (-0.58%) ⬇️
shard-5 33.18% <ø> (+0.51%) ⬆️
shard-6 43.88% <ø> (+0.17%) ⬆️

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.

@JSONbored
JSONbored merged commit 22ec1e5 into main Jul 12, 2026
17 checks passed
@JSONbored
JSONbored deleted the test/engine-panel-summary-coverage branch July 12, 2026 22:20
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
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.

1 participant