Skip to content

[quality] the bundle e2e suite never drives ok-to-test on pull_request or in the sweep, nor the sweep's listing pagination and failure arms #259

Description

@hivecommons-hive

Finding

The bundle e2e suite (__tests__/bundle/bundle.test.ts, spawning the committed dist/index.js against fakeGithub.ts) never exercises the two non-comment entry points of the ok-to-test trust marker, nor the listing arms of the sweep cron job:

  • okToTestOnPullRequest (src/issueComment/trigger.ts:173) — the pull_request handler registered in pullRequestHandlers (src/pullReq/handlePullReq.ts:18) that approves the runs waiting on a new head on synchronize/reopened. The only bundle routes for GET …/actions/runs and POST …/actions/runs/<id>/approve are in the issue_comment /retest and /ok-to-test cases (bundle.test.ts:743-800); no pull_request case routes them.
  • approveIfTrusted (src/cronJobs/sweep.ts:140) — the ok-to-test step of sweepPullRequest, including its 403 (cannot approve workflow runs: grant \actions: write` to the workflow`) and listing-failure arms being collected per pull request.
  • recentlyUpdatedPulls (src/cronJobs/sweep.ts:172) — the page-2 read when a full page is still inside the window, the stale-tail stop, the zero-candidate run, and the could not list the open pull requests failure. The existing schedule sweep job block (bundle.test.ts:1816) answers only page=1.

Evidence

Recommendation

Add a new bundle file __tests__/bundle/sweepOkToTest.test.ts driving dist/index.js through:

  • schedule jobs: sweep — fork pr carrying ok-to-test with a pending run (approve + merge path), with nothing pending, without the label (no runs read), approve 403 collected as the step's failure while tide still runs, a 500 on one pr's runs listing not stopping the next, zero candidates, a full first page followed by page 2 with a stale tail, and a refused listing failing the run before any pr read
  • pull_request synchronize / reopened with ok-to-test approving run on the head (tide skipping synchronize; reopened also running require_matching_label and tide), opened and label-less synchronize reading no runs, approve 403 failing the run

Disjoint from every open bundle PR: #238 (/cc …/reopen), #240 (/test, lgtm cancel), #242 (cron jobs input arms), #244 (/meow), #246 (fixed/prefixed labels), #248 (label-sync inputs), #250 (/assign, /milestone), #252 (dispatcher arms, /hold aliases). Disjoint from the unit-level #225 (trigger/tide residual fallbacks) and #219 (evaluateMerge).

Priority

  • Impact: medium — the sweep is the only write path for fork pull requests; its ok-to-test step and listing pagination are what a busy repository hits first, and neither is ever run end to end
  • 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

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/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationneeds-kindqualityCreated 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