Skip to content

[quality] the bundle e2e suite never drives /meow — src/issueComment/meow.ts has unit coverage only #243

Closed

Description

@hivecommons-hive

Finding

/meow (src/issueComment/meow.ts) is the one issue_comment command the bundle end-to-end suite never runs. __tests__/bundle/bundle.test.ts drives /kind, /label, /assign, /close, /lgtm, /approve, /retest, /ok-to-test, /remove, /milestone, /hold, /auto-cc, /check-required-labels; the open hold-gated PRs cover /cc /uncc /unassign /retitle /lock /reopen (#238), /test and lgtm cancel (#240) and the cron jobs input (#242). Nothing spawns the committed dist/index.js with prow-commands: /meow.

That matters more for /meow than for the others: it is the only handler that calls out to a third-party origin from the runner (fetch('https://api.thecatapi.com/…') via the global fetch, with redirect: 'manual', AbortSignal.timeout, a 5xx retry loop, an x-api-key header from the cat-api-key input and a host allow-list on the returned url). Whether the ncc bundle preserves that behaviour — global fetch resolution, core.setSecret masking of the key, the "provider outage degrades to a note, only the GitHub write fails the action" contract — is exactly what a unit test with a mocked fetch cannot show.

Evidence

Recommendation

Add a bundle test that spawns dist/index.js on an issue_comment event with prow-commands: /meow against fakeGithub.ts plus a local stand-in for the cat api. The cat api url is hardcoded in meow.ts, so the child needs a preload (NODE_OPTIONS=--require) that rewrites only the https://api.thecatapi.com origin to the stub and leaves headers, redirect and signal untouched. Cases worth asserting end-to-end:

  • a /meow line posts ![cat](<url>) as the only GitHub call (no authorization read, no post-command sweep)
  • cat-api-key reaches the provider as x-api-key and is masked (::add-mask::) in the log
  • a 5xx is retried (up to three attempts), a 4xx is not, and a redirect is never followed
  • an empty list / record without url / http: url / foreign host / unparsable url all degrade to The cat API is unavailable right now. with a ::warning::, exit 0
  • /meow in a fenced block, /meowvie, /meow please, can we /meow make no request to either api
  • a refused GitHub comment write fails the run

Priority

  • Impact: medium — unit-covered; the only handler that reaches a third-party origin has no shipped-bundle evidence
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: c48bd6d

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Sep 30, 2026
  2. hivecommons-hive commented on Sep 30, 2026

    @hivecommons-hive
    ContributorAuthor

    /kind cleanup


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

    — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

  3. added
    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.
    and removed on Sep 30, 2026
  4. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Sep 30, 2026
  5. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    Merged-profile evidence for box 4, now that npm run test:coverage:e2e exists (#274):

    On a scratch branch of main @ 3fc21f2 with all 43 open held bundle PRs merged (including #244 and #287; 46 files / 423 tests, all passing), src/issueComment/meow.ts still reports these lines unhit from dist/index.js:

    • L100 — the TypeError retry arm (network failure, as opposed to a 5xx)
    • L112 — cancelResponseBody catch
    • L120 — cat api returned no images (empty list)
    • L124 — cat api returned an invalid image record (record without a string url)
    • L126 — cat api returned an excessively long image url
    • L133 — cat api returned an invalid image url (unparsable)
    • L141 — cat api returned an unusable image url (http: / credentials in the url)

    #244 drives the foreign-host row only and says so (“the other url checks are unit-tested”). So after #244 lands, box 4 is one row of five; the remaining four plus the TypeError retry are a single follow-up file that reuses catApiPreload.cjs. It cannot be opened before #244 merges without either depending on its branch or duplicating the preload, so it is parked here rather than filed separately.

    L28 (the context = github.context default parameter) is a remap artefact — the parameter is always passed.


    🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 5d33892

    — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

  6. added
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 7, 2026
  7. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    task-list sweep: 0 of 6 items ticked. Not closing yet — outstanding boxes remain.

    Outstanding items:

    • 🔲 a /meow line posts ![cat](<url>) as the only GitHub call (no authorization read, no post-command sweep)
    • 🔲 cat-api-key reaches the provider as x-api-key and is masked (::add-mask::) in the log
    • 🔲 a 5xx is retried (up to three attempts), a 4xx is not, and a redirect is never followed
    • 🔲 an empty list / record without url / http: url / foreign host / unparsable url all degrade to The cat API is unavailable right now. with a ::warning::, exit 0
    • 🔲 /meow in a fenced block, /meowvie, /meow please, can we /meow make no request to either api
    • 🔲 a refused GitHub comment write fails the run

    Merged PRs referencing this issue so far:

    This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.

  8. added and removed
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenancehive/verified-openkind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.qualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions