Repository navigation
test(app): pin that a PROW_JOBS value with a trailing newline runs its jobs and fails no repository - #662
Conversation
…s jobs and fails no repository The App passes PROW_JOBS through settingsFromEnv untrimmed, and a Helm block scalar ends in a newline, so handleCronJobs sees an empty token after the split. Nothing asserted that the filter dropping it is what keeps the 'please provide a list of ... jobs' arm from failing every repository: the Actions-side cases go through core.getInput, which trims first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 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 |
There was a problem hiding this comment.
Verified end-to-end; looks correct to me.
- Mechanism checks out against the tree:
settingsFromEnvcopiesPROW_JOBSuntrimmed (src/adapters/app/settings.ts:48-51),'lgtm\n'.split(/\s+/)yields['lgtm', ''], and without.filter(command => command !== '')atsrc/cronJobs/handleCronJob.ts:15the''token reaches thecase '':error arm (handleCronJob.ts:42-45), whose Error is rethrown as a TypeError after the jobs already ran — so the repository is marked failed despite successful work. The Actions-side tests go throughcore.getInput(which trims), so only this App-path case can see the filter, exactly as the body argues. - Ran it both ways at head
a808033:npx vitest run __tests__/adapters/app/cron.test.ts→ 11/11 pass; with the filter removed, the new case fails withfailed: ['Codertocat/Hello-World']while the other 10 still pass. The test kills the mutant it claims to pin and nothing else depends on it. - The new describe block mirrors the file's existing msw/server/platform-scope setup (
cron.test.ts:15-27helpers reused), test-only, one file, no scope creep.
No findings. This is hold-gated for a maintainer; the hold is the only thing standing between it and merge.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Test Improvement
Adds one case to
__tests__/adapters/app/cron.test.ts(newdescribe('runScheduledJobs dispatching handleCronJobs')) that runs the realhandleCronJobsunder the App platform withinputs.jobs = 'lgtm\n'for one repository and asserts{ repositories: 1, failed: [] }with noerrorlog line.Why. A local Stryker probe at
a192ee1over the hunks #640/#641 changed (cronJobs/{lgtm,sweep,handleCronJob}.ts,utils/{pullRequestOwners,pulls,octokit}.ts, the changed ranges ofutils/{config,owners}.ts; 653 mutants, 597 killed, 20 timeouts, 36 survived) leftsrc/cronJobs/handleCronJob.ts:15.filter(command => command !== '')removable with all 42 covering tests still green. The Actions-side cases (cronJobTest/handleCronJob.test.ts, including'lgtm\n'and'lgtm pr-labeler\n') go throughcore.getInput, which trims before the split, so they cannot see the filter. The App does not trim:settingsFromEnvcopiesPROW_JOBSas the environment carries it, andcharts/prow-github-app/templates/configmap.yamlrenders.Values.prow.jobswithquote, so a block-scalar value ends in\n. Without the filter that value splits into['lgtm', ''], the''token reaches theplease provide a list of space delimited commands / jobs to runarm, andplatform().failmarks every scheduled repository failed after its jobs already ran. Under that mutant this case fails (failed: ['Codertocat/Hello-World']); onmainthe file's 11 tests pass, also under--sequence.shuffle.This is the same shape as #661 (
PROW_DRY_RUNuntrimmed on the App path,labelSync.ts:41) at a different input; it lives incron.test.tsrather thane2e.test.tsso it stays disjoint from that held PR.The other 35 survivors are log/joiner text,
{ required: false }→{}(Appinputs.getonly throws whenrequired), therecentlyUpdatedPullsseed array (a non-PR entry is filtered out by bothupdated_atcomparisons),config.ts:312kind: 'repo'(only=== 'url'is ever tested), and therequestReviewersIfDuedue-window comparisons already recorded by earlier quality findings; none is pinned here.Related Issue
None —
handleCronJob.tsis outside the nightly Stryker set the maintainers bounded in #635, so this ships as a test-only PR without a tracking issue.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88