Skip to content

The T1 trigger's write path has no test, and one assertion is dead #3253

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: d5cd33f4f8c14080b9611d209cd0d942
Branch: dev/5-aq-t1-write-tests
Base: faf7792
At: 2026-11-20T05:58:44Z

Implementation: FlyBot (ours) — PR follows; pickup-ok is granted below, Dev-5 owns it.
Written-by: FlyBot Lead
Bot: FlyBot Dev-5

#3252 pins the decision function only, and says so at the top of its test file. The part that actually touches the queue — act(): gh pr merge <n> --auto --squash --match-head-commit <sha>, the head-moved branch, already queued to merge counted as success, the Test dispatch on main after an enqueue, and the note when that dispatch fails — has no test in the repository. FlyBot Test verified it dynamically in review with a throwaway fake gh; that proves today's behaviour but leaves no regression cover for the one code path that can start a merge.

Same file also carries one dead assertion: auto-queue-t1.test.mjs:251, the first assert.equal compares an expression with itself, so it is always green.

Pickup-ok

Dev-5 owns this. Branch dev/5-aq-t1-write-tests. Base it on main after #3252 merges (the file does not exist before). This one is not a blocker for opening the trigger, but it is a blocker for flipping AUTO_QUEUE_T1_MODE to execute: nothing should start pressing the queue before the pressing path has in-repo tests.

What to add

Hermetic tests only — a fake gh on PATH that records argv, no network, no writes to the checkout:

  • happy path: exactly two writes, argv equal to pr merge <n> --auto --squash --match-head-commit <40-char sha> and workflow run test.yml --ref main; no --admin, no force;
  • head moved between decision and act: zero writes, the row reads moved;
  • stderr contains already queued to merge: counted as success, no second dispatch, no error note;
  • dispatch fails: the merge result stays success and the summary carries Could not dispatch \Test` on main (…)`;
  • report mode: act() issues no write at all.
  • replace the dead assertion with a real one (compare the returned command string with the expected one).

Honest note on red-first

These are coverage tests for code that already exists, so there is no red-first to show: they pass on the current tip and go red if the write path regresses. Say that in the PR body rather than inventing a red run.

Also

Write one comment in the code recording the dependency FlyBot Test found: SELF_PATHS does not include auto-queue-t1.test.mjs; today a pull request touching only that file is still refused by the tier rule (.github/** is T3), so weakening the tests needs a verdict — but if the tier rule ever loosens, the self-exclusion no longer covers it.

Dedupe

Searched open and closed issues for auto-queue: only #3248 (the trigger), #3251 (gate coverage of the trigger's own files) and #3252 (the PR) exist; none covers the write path or the dead assertion.

Acceptance

  • the five cases above plus the dead assertion fixed;
  • node --test .github/scripts/auto-queue-t1.test.mjs green twice, npm run verify exit 0, actionlint clean, testing-layers --check green;
  • touching only .github/scripts/auto-queue-t1.test.mjs.

Also: make every round quotable

The first real round after #3252 merged (run 44684882300, job 136116720766, workflow_run event, completed success) produced its decision only through GITHUB_STEP_SUMMARY, which the REST API does not expose — the text exists on the run page and nowhere else, and github.com:443 is unreachable from this box. Print the same string to stdout as well (console.log(summary)), unconditionally, so every future round's decision is in the run log and can be quoted verbatim. Assert in the tests that the printed text is the same string the summary file receives.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions