Skip to content

test(miner-ui): chat-portfolio-queue-resolve's bare-integer identifier branch has zero test coverage #8671

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

apps/loopover-miner-ui/src/lib/chat-portfolio-queue-resolve.ts:31's IDENTIFIER_RE has three
alternation groups for recognizing an issue/PR identifier in free-form chat text. The third group,
(?<![A-Za-z0-9._/-])(\d+)(?![A-Za-z0-9._/-]) (a bare positive integer with no #/issue: prefix),
is never exercised by any test in chat-portfolio-queue-actions.test.tsx:97-129 — every
identifier-bearing test case there uses #7 or issue:12. Manually tracing the code confirms
resolvePortfolioQueueChatAction("release acme/widgets 12") does correctly resolve
identifier: "issue:12" via this branch today — so this is not a currently-broken bug, but a real,
reachable branch with zero regression-test coverage.

Requirements

  • Add direct test coverage for the bare-integer identifier branch of IDENTIFIER_RE, for both the
    release and requeue chat actions.

Deliverables

  • A new test asserts resolvePortfolioQueueChatAction("release acme/widgets 12") resolves
    target.identifier === "issue:12".
  • A new test does the same for the requeue action.
  • A negative test confirms a bare trailing digit that's part of a differently-shaped sentence
    (e.g. one where the digit isn't intended as an identifier) is not misread as an identifier —
    pick a concrete, realistic example and assert the expected non-match or fallback behavior.

All three Deliverables are required in the same PR.

Test Coverage Requirements

apps/** is excluded from codecov/patch gating, but apps/loopover-miner-ui's own local vitest
coverage thresholds (85% branches/statements/lines, enforced in CI) apply — this branch is currently
real but completely unexercised by any test.

Expected Outcome

The bare-integer identifier branch of chat-portfolio-queue-resolve.ts's parsing logic has direct
regression-test coverage, protecting it from an undetected future regression.

Links & Resources

  • apps/loopover-miner-ui/src/lib/chat-portfolio-queue-resolve.ts:31 (IDENTIFIER_RE)
  • apps/loopover-miner-ui/src/lib/chat-portfolio-queue-actions.test.tsx:97-129 (existing test file
    to extend)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions