Repository navigation
test(bundle): drive newOctokit's api.github.com fallback through dist/index.js with an empty GITHUB_API_URL - #504
Open
hivecommons-hive[bot] wants to merge 1 commit into
Open
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…/index.js with an empty GITHUB_API_URL Every bundle test points GITHUB_API_URL at the fake server, so the `|| 'https://api.github.com'` arm in src/utils/octokit.ts had unit coverage but never ran through the packed bundle (coverage-e2e reported the file at 50% branches). Add githubApiPreload.cjs, which redirects the public origin to FAKE_GITHUB_URL the way catApiPreload.cjs does for the cat api, and a test that runs /remove-help with GITHUB_API_URL='' and asserts the requests land on the fake. A second case leaves the fake unnamed and asserts the preload fails closed before any request. Signed-off-by: quality <quality@hive.kubestellar.io>
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
Contributor
|
Please add a kind label with |
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Files:
__tests__/bundle/githubApiPreload.cjs(new),__tests__/bundle/githubApiUrlDefault.test.ts(new). Function:newOctokitinsrc/utils/octokit.ts, theGITHUB_API_URL || 'https://api.github.com'arm. Nosrc/ordist/change.Every bundle test passes
apiUrl: gh.urlthroughrunBundle, which setsGITHUB_API_URLto the fake server, so the'https://api.github.com'fallback had unit coverage (__tests__/utils/octokit.test.ts) but never ran through the packed bundle:npm run test:coverage:e2eat1062ce7reportssrc/utils/octokit.tsat 50% branches.githubApiPreload.cjsis loaded withNODE_OPTIONS=--require, the same shape ascatApiPreload.cjs: it rewrites requests for thehttps://api.github.comorigin toFAKE_GITHUB_URLand fails closed when that is unset, so the child can never reach the real API from a test./remove-helpwithGITHUB_API_URL=''and asserts the config reads, issue read and label delete all land on the fake. A second case omitsFAKE_GITHUB_URLand asserts the run fails with the preload's message before any request, which independently proves the child targetedapi.github.com.After this, the e2e run reports
octokit.tsat 100/100/100/100. Lint clean.Disjoint from the open held PRs: #497 (approve/meow arms), #498 (tide draft/files, sweep labels folds), #500/#502 (thresholds), #501 (docs YAML).
Related Issue
Refs #466 (tracker for every
dist/index.jse2e-coverage finding; this lands only theoctokit.tsfallback folded into it on 2026-10-17 — the other folded arms in approve.ts, approveReview.ts, handleIssueComment.ts, tide.ts and mergeQueue.ts remain open there)Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88