Skip to content

test(bundle): drive the lgtm cron's listing-500, closed-pr and evaluation-throw arms through dist/index.js - #335

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-cron-lgtm-failure-arms
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-cron-lgtm-failure-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one file, __tests__/bundle/cronLgtmFailureArms.test.ts (3 tests), which runs the shipped dist/index.js as the schedule jobs: lgtm job against the fake GitHub API for the arms of src/cronJobs/lgtm.ts that no bundle suite reached:

  1. GET …/pulls?state=open&page=1 → 500 → exit 1, error handling cron job: Error: could not get PRs: HttpError: Internal Server Error, no call after the listing (cronLgtm L72)
  2. page 1 holds a state: closed pull request (TESTING - Pull request comments #3) next to an open lgtm one (#2) → TESTING - Pull request comments #3 is logged as processed but never read and its base's tree is not probed; #2 squash-merges; exit 0 (L88)
  3. the listed pull request's re-read GET …/pulls/2 → 500 → exit 1, error handling cron job: TypeError: error processing pr: HttpError: Internal Server Error, no PUT, paging stops before page 2 (L101, L108)

Each case asserts the exit status, the ::error:: text and the exact request sequence after the configuration reads.

Cluster: src/cronJobs/lgtm.ts cronLgtm / tryMergePr failure and skip arms. Disjoint from the open hold-gated bundle PRs: #242 (cron dispatcher jobs input, no lgtm run), #310 (handlePullReq jobs: lgtm on a pull_request event), #318 (lgtmBinding / labels/lgtm.ts), #322 (tide evaluateInQueue skip arms), #328 (schedule lgtm on a fork whose merge is refused 403 → tide.ts/comments.ts) — none drives a failing listing, a closed listed pull request or a throwing evaluation.

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3):

  • unit (npx vitest run --coverage): src/cronJobs/lgtm.ts already 100 %
  • e2e (npm run test:coverage:e2e): src/cronJobs/lgtm.ts 4/40 statements unreached (L72, 88, 101, 108) → 100 % statements / branches / functions / lines; bundle suite 142 → 145 tests, 6 files green
  • npx eslint __tests__/bundle/cronLgtmFailureArms.test.ts and npx tsc --noEmit clean

Related Issue

Closes #334


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

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

…tion-throw arms through dist/index.js

Adds __tests__/bundle/cronLgtmFailureArms.test.ts, which runs the shipped
bundle as the schedule lgtm job against the fake GitHub API for the three
arms of src/cronJobs/lgtm.ts that no bundle suite reached: the open pull
request listing answering 500 (could not get PRs), a closed pull request
in the page skipped without a read while its open sibling merges, and a
pull request re-read answering 500 (error processing pr).

npm run test:coverage:e2e: src/cronJobs/lgtm.ts 4/40 statements unreached
(lines 72, 88, 101, 108) -> 100 %; bundle suite 142 -> 145 tests.

Closes #334

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 21:58
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 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 on 34f2aa5 is red for the shared cause tracked in #294, not for this diff:

This PR only touches __tests__/bundle/; the durable fix is #287. Deferring until #294 closes; no re-run or push for this failure.


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

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

@jeefy

jeefy commented Oct 7, 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 7, 2026
@jeefy jeefy closed this Oct 7, 2026
@jeefy jeefy reopened this Oct 7, 2026
@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

@github-actions
github-actions Bot merged commit e2657e2 into main Oct 7, 2026
13 of 16 checks passed
jeefy added a commit that referenced this pull request Oct 8, 2026
…ation fails (#375)

The lgtm cron's doc comment and docs/automatic-merging.md say every
eligible pull request is attempted and the run fails at the end listing
the failures. That held for merges GitHub refused, but an evaluation that
threw (for example a 500 re-reading one pull request) made the page throw
`error processing pr: ...`, so the remaining pages were never evaluated.

A throwing evaluation is now logged with core.error as
`could not evaluate pr #<n>: <error>` and collected with the refused
merges; the job goes on with the remaining pull requests and pages and
fails at the end with the existing summary, e.g.
`1 pull request(s) could not be merged: #7 (could not evaluate: HttpError: ...)`.
A listing of the open pull requests that cannot be read still stops the
job (`could not get PRs`).

Tests: the unit case and the bundle case (#335) that pinned the
fail-fast behaviour now assert that a later pull request (same page, and
the next page) is still evaluated and merged and that the run fails
naming the broken one. docs/cron-jobs.md and docs/automatic-merging.md
describe the evaluation-failure arm.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@mrbobbytables
mrbobbytables deleted the quality/test-cron-lgtm-failure-arms branch October 9, 2026 17:33
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] cronJobs/lgtm.ts listing-500, closed-pr and evaluation-throw arms have no end-to-end coverage

1 participant