Skip to content

test: assert the enqueuer-less dequeue path makes no viewer query; refresh the nightly survivor table to v3.5.0 - #659

Merged
jeefy merged 1 commit into
mainfrom
quality/test-tide-no-viewer-query-without-enqueuer
Nov 1, 2026
Merged

jeefy merged 1 commit into
mainfrom
quality/test-tide-no-viewer-query-without-enqueuer

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

The scheduled mutation job on main@a192ee1 (run 41280747957) passed at 96.0 % with two survivors that #649 (1f0b606) introduced after the 424fb95 run the docs/contributing.md table describes, so neither is reviewed or pinned anywhere:

  • src/plugins/tide.ts:352 queue.entry?.enqueuer === undefined ? undefined : await tokenLogin(octokit) → false ? …: dequeueIfOurs would send the GraphQL viewer { login } query even when the entry names no enqueuer. The two tests on that path (__tests__/plugins/tideMergeQueue.test.ts "an entry without an enqueuer…", __tests__/plugins/tideGuards.test.ts "…in the queue without an entry…") already capture every GraphQL call in calls but asserted only on the dequeuePullRequest mutation. This adds expect(calls).toHaveLength(1) to both, the way the sibling "not in the queue: one query, no mutation" test already does. With the mutant applied by hand both tests fail; without it 45/45 pass.
  • src/utils/mergeQueue.ts:102 entry.enqueuer.__typename === undefined ? {} : { enqueuerType } → always spread: enqueuerType: undefined is indistinguishable from an absent key to enqueuedByBot (=== 'Bot') and to toEqual, so it is equivalent and gets a table row instead of a test.

docs/contributing.md ("Reviewed survivors of the files the nightly run adds") is refreshed to the a192ee1 run — line numbers shifted by #649, the mergeQueue.ts:102 row added, and the provenance line names the scheduled job rather than a local probe. The break: 95 floor did not react because main had a survivor of headroom; this restores it rather than moving the floor.

Files: __tests__/plugins/tideMergeQueue.test.ts, __tests__/plugins/tideGuards.test.ts, docs/contributing.md (the survivor table only). No src/ or dist/ change. eslint and tsc -p tsconfig.test.json clean.

Related Issue

Refs #657 — the hive consolidated the issue for this finding onto #657 (same component, docs/contributing.md); #657 is closed by #658, which edits a different section of that file (the V8 artefact line at :94) and different test files, so the two merge independently. Nothing of this PR is left open once it merges.


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

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

…esh the nightly survivor table to v3.5.0

The two enqueuer-less dequeue tests recorded every GraphQL call but only
checked that no dequeuePullRequest mutation went out, so the guard #649
added in front of tokenLogin could be removed without a test noticing
(the nightly run at a192ee1 reports it as a survivor at tide.ts:352).
The sibling 'not in the queue' test already pins its call count the same
way.

The reviewed-survivor table for tide.ts/mergeQueue.ts still described the
424fb95 run: every line is one off after #649 and the one mergeQueue.ts
survivor (the enqueuerType spread, equivalent) was missing.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner November 1, 2026 07:22
@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

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 against the tree at 7e29b7c — this looks correct to me.

  • src/plugins/tide.ts:352 is the claimed mutant site (queue.entry?.enqueuer === undefined ? undefined : await tokenLogin(octokit) inside dequeueIfOurs). I applied the false ? … mutant by hand: exactly the two tests gaining expect(calls).toHaveLength(1) fail (tideMergeQueue.test.ts "an entry without an enqueuer…", tideGuards.test.ts "…in the queue without an entry…"); unmutated, 45/45 pass. The kill is deterministic: __tests__/setup.ts reinstalls actionsPlatform() beforeEach and src/adapters/actions.ts:14 builds a fresh newRunState(), so the tokenLogins cache (src/plugins/approveReview.ts:62) is empty per test and the forced tokenLogin always issues a viewer query, which mergeQueueGraphql captures in calls (__tests__/testUtils.ts:351).
  • The mergeQueue.ts:102 equivalence row checks out: always spreading yields enqueuerType: undefined, which enqueuedByBot (=== 'Bot') and toEqual cannot distinguish from an absent key — a table row, not a test, is right.
  • Docs table line shifts spot-checked against the tree (tide.ts:247, :338, :554 all match their rows).
  • Refs #657 semantics are justified in the body: #657 is closed by #658, and nothing of this PR is left open on merge.

Test-only diff, CI green. No findings.

— 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 64ccb67 into main Nov 1, 2026
16 checks passed
@jeefy
jeefy deleted the quality/test-tide-no-viewer-query-without-enqueuer branch November 1, 2026 20:08
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