Repository navigation
test(bundle): drive the config input's explicit source and the loader's tier read failures through dist/index.js - #314
Conversation
…'s tier read failures through dist/index.js Adds __tests__/bundle/explicitConfigSource.test.ts: /kind with the config input pointing at owner/repo:path[@ref] (read with github-token, the organization repos skipped, the repository tier still layered on top), the not-found, failed-read, not-a-file, http:// and malformed-source refusals, and a failing organization-tier and repository-tier probe. npm run test:coverage:e2e: src/utils/config.ts 69.12 % -> 72.19 % lines; newly reached L206, 225, 247, 256, 259, 278, 282. Signed-off-by: quality <quality@hive.kubestellar.io>
|
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 Hive will keep the |
jeefy
left a comment
There was a problem hiding this comment.
Six of the ten cases add coverage. bundle.test.ts:2157 and :2178 already set the config input.
- Drop
explicitConfigSource.test.ts:56and:70. bundle.test.ts:2157 already runsconfig: 'Codertocat/shared-config:labels/prow.yaml@v1'. - Drop
:121(the http:// row) and:103. bundle.test.ts:2178 covers the http:// rejection, and:103's lines are already reached by L111 and L131/L140.
…xplicit-config-source
…uns and the http:// row Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: dropped the two owner/repo:path happy-path cases (bundle.test.ts:2157 runs that input), the failed-read case and the http:// row. The layering case now expects #376's 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in 95da151: dropped the two cases bundle.test.ts:2157 already runs, the http:// row, and the case whose lines L111/L131/L140 already reach. CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
jeefy
left a comment
There was a problem hiding this comment.
All four drops are done. On current main one more case adds nothing:
- Drop
explicitConfigSource.test.ts:48–59(the repository tier layering over the explicit source). The explicit-source read (config.ts:283–308) is reached by bundle.test.ts:2148, and theno allowed value inrefusal (prefixed.ts:251) by prefixedRemoveArms.test.ts:44, which merged in #341 after the first review.
…on main Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed in 6885c00: dropped the repository-tier layering case ( 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
|
/kind cleanup |
Test Improvement
Adds
__tests__/bundle/explicitConfigSource.test.ts(new file only; importscomment,configReads,helpersFor,repo,tokenfrom./helpers) — ten/kind cleanupruns through the committeddist/index.jsagainstfakeGithub, the first bundle tests to set theconfigaction input or to make a configuration read fail. Arms ofsrc/utils/config.tsreached:loadExplicitTier(L236–266):cncf/prow-config:prow.yamlis read withgithub-token(GET /repos/cncf/prow-config/contents/prow.yaml) and neither.projectnor.githuborg repo is probed;@v1.2arrives as?ref=v1.2; the repository's own.github/prow.yamlstill layers over it (itskind: [bug]replaces the explicit list, socleanupis refused withkind: command args missing from body); a 404 →could not load prow config from cncf/prow-config:prow.yaml: not found; a 500 →… HttpError: boom;http://…→config: http:// sources are not allowed, use https://;just-a-file.yaml→config: expected owner/repo:path[@ref] or an https:// url, got 'just-a-file.yaml'. The two refusals make no read of the explicit source.fetchRepoFile(L278–282): a directory listing forcncf/prow-config:configs→TypeError: configs is not a file.loadOrgTier/loadRepoTier(L206, L225): a 500 on.project/contents/prow.yamlfails withcould not load organization prow config from Codertocat/.project:prow.yaml: HttpError: boomand never probes.github; a 500 on.github/prow.yamlfails withcould not load prow config from Codertocat/Hello-World:.github/prow.yaml: HttpError: boomand never probes the next path.Every failure case asserts exit 1, the
could not get labels from yaml: Error: <cause>error annotation and no write to the API.Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:src/utils/config.tse2e lines 69.12 % → 72.19 % (newly reached L206, 225, 247, 256, 259, 278, 282); all files 77.9 % → 78.32 % lines. Unit run unchanged: 81 files / 1649 tests pass;npx eslintandtsc --noEmitclean on the new file.Not covered here, on purpose:
fetchUrl(L290–301, thehttps://source) needs a TLS server the fake GitHub does not provide and stays unit-only. Disjoint from #293, which reachesconfig.ts353/365/519–527/592–612 (the normalizers).Related Issue
Closes #313
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88