Skip to content

test(bundle): drive the https:// config source (config.ts fetchUrl) through dist/index.js - #359

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-https-config-source
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-https-config-source

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/httpsConfigSource.test.ts (new file only; imports comment, configReads, helpersFor, repo, token from ./helpers; runBundle.ts, fakeGithub.ts, helpers.ts, source and dist/ untouched). It is the first bundle test to reach fetchUrl in src/utils/config.ts (L290–301), the arm that loads an https:// config input with fetch rather than the api — the one config.ts cluster #314 left out ("needs a TLS server the fake GitHub does not provide").

How: beforeAll mints a throwaway self-signed certificate with openssl into a temp dir (/CN=localhost, SAN IP:127.0.0.1, 1 day), starts an in-process https.createServer on it, and runBundle's env hands the cert to the child as NODE_EXTRA_CA_CERTS, so the bundled fetch completes a real TLS handshake without touching the network or a real CA. Three /kind cleanup runs on issue #1:

TLS server's answer expected
200 labels: { kind: [cleanup] } exit 0, POST …/issues/1/labels {labels:['kind/cleanup']}; exactly one GET /prow.yaml on the TLS server; no .project/.github org probe; the repository tier's eight reads and GET …/labels still happen (L290–291 + L301)
500 exit 1, could not get labels from yaml: Error: could not load prow config from https://127.0.0.1:<port>/prow.yaml: HTTP 500, no write (L297–298)
server closed exit 1, … could not load prow config from https://127.0.0.1:<port>/prow.yaml: TypeError: fetch failed, no request reaches the live server, no write (L293–294)

Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/utils/config.ts e2e lines 68.78 % → 72.19 % (L290–301 all reached); all files 77.9 % → 78.28 %. npx vitest run __tests__/bundle/httpsConfigSource.test.ts → 3 pass against the committed dist/index.js; npx eslint and tsc --noEmit clean.

Disjoint from #314 (owner/repo:path[@ref] sources and api read failures, L236–282) and #339 (parseProwConfig rejections); neither routes an https:// source.

Related Issue

Closes #358


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

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

…hrough dist/index.js

Adds __tests__/bundle/httpsConfigSource.test.ts: an in-process TLS server
with a throwaway self-signed certificate (minted with openssl at beforeAll)
stands in for the host of an https:// `config` input, and the child trusts
it through NODE_EXTRA_CA_CERTS. Three /kind cleanup runs cover fetchUrl's
success, non-2xx and unreachable arms, which no bundle test reached.

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 7, 2026 01:16
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 7, 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.

@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. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 7, 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 7, 2026
@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

@github-actions
github-actions Bot merged commit 607e89f into main Oct 7, 2026
10 of 12 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-https-config-source branch October 9, 2026 17:32
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] config.ts fetchUrl — the https:// config source — is never driven through dist/index.js

1 participant