Repository navigation
test(bundle): cover non-Error rejection paths including auth - #528
Conversation
… normalizeError and label-sync's write through dist/index.js A preload hands the bundle one Response whose status getter throws a plain string, the one read @octokit/request makes outside its try/catch, so the string rejects the client call unwrapped. Three runs pin that the step still fails once naming the string: pull_request synchronize (events.ts:50), /milestone (handleIssueComment.ts:217) and the label-sync job (labelSync.ts:107). Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
Exercise getErrorDetails through /retitle, asserting the warning and denied write while keeping the action green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
Reviewed the shared one-shot preload and four bundle scenarios. The added auth case reaches auth.ts:24, reports the exact primitive warning and denies the title write. Local full e2e coverage passed with 100% lines and 99.03% branches; no auth ignore or production change is needed.
Verified successful build-test, e2e-coverage and DCO results on head f0e2394. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
… sweep, trigger and approveReview through dist/index.js (#548) test(bundle): drive the non-Error String(e) arms of tide, mergeQueue, sweep, trigger and approveReview through dist/index.js The new scenarios cover distinct tide, mergeQueue, sweep, trigger and approveReview outcomes, including status-less failure behavior and no unintended writes. The preload is identical to #528 and is shared rather than duplicated at runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…overage work landed (#556) Measured npm run test:coverage:e2e on main@e3119ad with #528, #537, #544, #548 and #549 merged: 100 / 99.46 / 100 / 100 (1686/1695 branches). The 97 floor set at 1062ce7 (97.96 measured) now sits 2.46 pp under main; 98 keeps the same just-under-main convention. 99 was considered and not taken: it would leave 8 branches of slack, two of which are already consumed by the negative-count await artifacts at approve.ts:504 and auth.ts:220 that no test can recover. Closes #551 Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Description
Adds controlled non-Error rejection scenarios through
dist/index.jsusing a one-shotNODE_OPTIONS=--requirepreload. A proxied fetch response throws a string from itsstatusgetter, after Octokit's fetch catch, while still recording the request against the fake GitHub API.The four scenarios exercise:
runEventHandlerson a rejected pull-request read.normalizeErroron a rejected milestone listing.getErrorDetailsthrough/retitle's collaborator check: one warning withstatus=unknownand the exact primitive message, a successful action exit, no unhandled rejection, and no issue update.Fixes #507
The auth scenario supersedes the coverage-ignore approach in #510 once this PR merges: auth.ts now reaches 100% bundle line coverage without adding an ignore or removing its defensive fallback. Other findings formerly folded into #507 have their own canonical PRs; the upstream V8 report is preserved in #550.
Related: #548 adds distinct plugin scenarios using the byte-identical preload. It can remain a separate PR; neither scenario set should be discarded. Truly wrapped/unreachable arms are separately owned by #537, #544 and #549.
Testing
npx vitest run __tests__/bundle/nonErrorRejectionArms.test.ts— passed: 4 tests.npx eslint __tests__/bundle/nonErrorRejectionArms.test.ts __tests__/bundle/nonErrorRejectionPreload.cjs— passed.npm run test:coverage:e2e— passed; 100% statements, lines and functions; 99.03% branches (1640/1656).src/utils/auth.tshas 100% lines without an ignore annotation.Checklist
npm run allto lint and build my code — used the focused lint/tests and full e2e coverage command above instead.npm run packand committeddist/— not needed: this PR changes only bundle tests and their preload; committed production source/bundle are unchanged.