Skip to content

test(bundle): drive handlePullReq's unsupported-job and failed-lgtm-read arms through dist/index.js - #310

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-pullreq-jobs-arms
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-pullreq-jobs-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/pullReqJobsArms.test.ts (new file; nothing else touched), driving the jobs-input arms of src/pullReq/handlePullReq.ts through the committed dist/index.js against the fake GitHub API:

  • a pull_request synchronize run with jobs: frobnicate fails with TypeError: error handling pull request: Error: could not execute frobnicate… after owners-label and approve's probe have run (lines 62-66 default, 75-80)
  • jobs: lgtm whose GET /issues/1 answers 500 fails with could not get labels from issue and sends no DELETE (onPrLgtm.ts line 30, handlePullReq.ts 61-63 catch)
  • jobs: lgtm frobnicate: the lgtm job removes the label, the unsupported job still fails the run

Measured with npm run test:coverage:e2e on main @ 3fc21f2: handlePullReq.ts 80.76 → 96.15 % lines (only the unreachable line 46 remains), onPrLgtm.ts 83.33 → 91.66 % (only the unreachable line 19 remains). Unit coverage of both files is already 100 %.

Cluster: handlePullReq jobs input / onPrLgtm failure — disjoint from the held bundle PRs (#242 cron jobs, #283–#308 issue_comment commands and plugins).

Related Issue

Closes #309


Filed by quality agent (hold-gated mode). Human review required.

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

…ead arms through dist/index.js

Adds __tests__/bundle/pullReqJobsArms.test.ts: a pull_request synchronize run
with an unsupported `jobs` entry, one whose lgtm job's labels read answers
500, and one mixing a working lgtm job with an unsupported job. Covers
src/pullReq/handlePullReq.ts lines 62-66 and 75-80 and
src/pullReq/onPrLgtm.ts line 30 end-to-end (npm run test:coverage:e2e:
handlePullReq.ts 80.76 -> 96.15 % lines, onPrLgtm.ts 83.33 -> 91.66 %).

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 4, 2026 20:55
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

build-test is red here for a baseline cause this PR's diff does not touch: all 81 test files pass, and the job exits 1 on a single vitest Unhandled Error — assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID") originating in __tests__/issueCommentTest/meow.test.ts (runs 37234002533, 37233899279 on 709cb6c). This PR only changes __tests__/bundle/pullReqJobsArms.test.ts.

Tracked as shared incident #294; fix is #287. Deferring — no re-runs or pushes to this branch until that lands.


🐝 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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • pullReqJobsArms.test.ts:40 and :63: use a fragment, e.g. toContain('could not execute frobnicate'), instead of comparing the whole TypeError: error handling pull request: … string with toEqual.
  • Drop :56–65. It reaches the same lines as :36, and removing the lgtm label is already covered at bundle.test.ts:941.
  • At :42, :53 and :64, use calls() from helpersFor (routeOwners already comes from it) instead of the inline gh.requests.map(...).

quality added 2 commits October 7, 2026 21:50
…) and drop the two-jobs case

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed all three: the unsupported-job error is toHaveLength(1) + toContain('could not execute frobnicate'), the two-jobs case is dropped, and the request lists use calls() from helpersFor. Merged main too (it brings #287's meow network fix, which is what build-test was failing on).


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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 043a586: fragment checks (toContain('could not execute frobnicate')), the two-jobs case is dropped, and request lists come from calls() via helpersFor.

CI is green on the new head.


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

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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@github-actions github-actions Bot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-kind labels Oct 9, 2026
@github-actions
github-actions Bot merged commit 351ec73 into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-pullreq-jobs-arms branch October 9, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] handlePullReq's jobs-input error arms are never exercised end-to-end through dist/index.js

1 participant