Skip to content

test(app): pin that a PROW_JOBS value with a trailing newline runs its jobs and fails no repository - #662

Merged
jeefy merged 1 commit into
mainfrom
quality/test-app-jobs-trailing-newline
Nov 1, 2026
Merged

jeefy merged 1 commit into
mainfrom
quality/test-app-jobs-trailing-newline

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one case to __tests__/adapters/app/cron.test.ts (new describe('runScheduledJobs dispatching handleCronJobs')) that runs the real handleCronJobs under the App platform with inputs.jobs = 'lgtm\n' for one repository and asserts { repositories: 1, failed: [] } with no error log line.

Why. A local Stryker probe at a192ee1 over the hunks #640/#641 changed (cronJobs/{lgtm,sweep,handleCronJob}.ts, utils/{pullRequestOwners,pulls,octokit}.ts, the changed ranges of utils/{config,owners}.ts; 653 mutants, 597 killed, 20 timeouts, 36 survived) left src/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 through core.getInput, which trims before the split, so they cannot see the filter. The App does not trim: settingsFromEnv copies PROW_JOBS as the environment carries it, and charts/prow-github-app/templates/configmap.yaml renders .Values.prow.jobs with quote, so a block-scalar value ends in \n. Without the filter that value splits into ['lgtm', ''], the '' token reaches the please provide a list of space delimited commands / jobs to run arm, and platform().fail marks every scheduled repository failed after its jobs already ran. Under that mutant this case fails (failed: ['Codertocat/Hello-World']); on main the file's 11 tests pass, also under --sequence.shuffle.

This is the same shape as #661 (PROW_DRY_RUN untrimmed on the App path, labelSync.ts:41) at a different input; it lives in cron.test.ts rather than e2e.test.ts so it stays disjoint from that held PR.

The other 35 survivors are log/joiner text, { required: false } → {} (App inputs.get only throws when required), the recentlyUpdatedPulls seed array (a non-PR entry is filtered out by both updated_at comparisons), config.ts:312 kind: 'repo' (only === 'url' is ever tested), and the requestReviewersIfDue due-window comparisons already recorded by earlier quality findings; none is pinned here.

Related Issue

None — handleCronJob.ts is 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

…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>
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 1, 2026
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner November 1, 2026 12:19
@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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

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.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified end-to-end; looks correct to me.

  • Mechanism checks out against the tree: settingsFromEnv copies PROW_JOBS untrimmed (src/adapters/app/settings.ts:48-51), 'lgtm\n'.split(/\s+/) yields ['lgtm', ''], and without .filter(command => command !== '') at src/cronJobs/handleCronJob.ts:15 the '' token reaches the case '': 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 through core.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 with failed: ['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-27 helpers 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

@jeefy jeefy 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. needs-kind labels Nov 1, 2026
@jeefy
jeefy merged commit ed9a537 into main Nov 1, 2026
24 checks passed
@jeefy
jeefy deleted the quality/test-app-jobs-trailing-newline branch November 1, 2026 20:10
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant