Skip to content

refactor(pr-merge): simplify gate-check, head-ref-map and the gh download fixture - #14166

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14124-42496261302-1
Nov 8, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14124-42496261302-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14124

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified four of the five listed pr-merge files without changing their behavior. In gate-check's render, the two non-success title branches now share one fallback expression, and the blocker summary lines are built in one ternary. In head-ref-map write mode, the no-listing carry path returns early instead of a mutable refs plus a second ternary. The GH -download fixture's duplicated request helper and bin/gh writer are now in one fakeGh helper, and it generates byte-identical scripts. In lane-records, a stray comment paragraph is folded into the write paragraph it belongs to. last-report.mjs was reviewed and left as it was: it is already a single short main with nothing to reuse, simplify or reshape inside the file.

Not verified

  • Tidy not run: every changed file is under .github/, a listed shared path for the tidy cutoffs.
  • The pr-merge node test suites (gate-check.test.mjs, head-ref-map.test.mjs, lane-records.test.mjs, last-report.test.mjs, rotation.test.mjs) were not run directly here. This lane can't run node; check-affected ran what it selects and the PR's CI runs the suites.
  • ci-status green on the PR is left to the PR's CI.
  • last-report.mjs left unchanged; review found no in-file simplification worth making.

Fix

  • .github/scripts/pr-merge/gate-check.mjs: render() combines the ready-not-report-only and not-ready title branches into one flat(...) || (row.ready ? ... : 'not ready') expression, and builds the blocker section with one conditional spread. Titles and summaries are unchanged.
  • .github/scripts/pr-merge/GH -download.fixture.mjs: hoists the request() echo helper to module scope and moves the shared mkdir/write/chmod and GH -calls header into a private fakeGh(dir, body). fakeGhDownload and fakeGhArchive pass only their bodies, and the generated scripts are byte-identical.
  • .github/scripts/pr-merge/head-ref-map.mjs: write mode returns early on the no-listing carry path, so the refs variable is const and the log line has no ternary. Files written and messages printed are unchanged.
  • .github/scripts/pr-merge/lane-records.mjs: header comment only. The detached 'A listing file that exists but cannot be parsed...' paragraph is merged into the write paragraph.

Verification

The runner ran each check from the base copy against 18dbe59:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: passed (All 1 changelog fragment(s) under .changes/ are valid). No fragment is needed because no plugin changed.
  • check-changed-skills: passed (no changed skills under plugins/*/skills/).
  • check-affected: 8 passed, 8 skipped over the 4 changed files; the rest are CI-only.
  • Fresh-context review subagent compared the diff with the HEAD versions of each file: no behavior difference for any realistic input, and gate-check titles and summaries match across the null, empty, reportOnly and ready edge cases. The fixture's generated script text is byte-identical. The only…
  • git-read diff --numstat HEAD: 4 files, 41 added and 42 removed, within the 400-line and 15-file limits.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42496261302

Left out: the items under Not verified.

Related

#14124

Merge-Risk: max=MEDIUM demote=false head=18dbe59080fb928a81a79d2ba7a30ec5cc884df1 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 18dbe59080fb928a81a79d2ba7a30ec5cc884df1: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14166 (head 18dbe590)

I found no security issues. I read every hunk of all 4 changed files.

gate-check.mjs, head-ref-map.mjs and lane-records.mjs are trusted paths, so I read their whole changes and checked what each one gates. None of them changes behavior, and none touches a trust control:

  • .github/scripts/pr-merge/gate-check.mjs: I compared the old and new render() across every branch:
    • merged or enqueued: untouched.
    • ready with reportOnly === true: same fixed title.
    • ready otherwise: same flat(...) || "ready, not enqueued this run".
    • not ready: before, the code was flat(reason ?? blockers[0] ?? "not ready") || "not ready". Now it is flat(reason ?? blockers[0] ?? "") || "not ready". Both give "not ready" when there is no reason and no blocker.
    • The blocker section has the same lines in the same order. The check's conclusion logic is untouched, and the summary still says the check is informational and not part of ci-status. No merge hold is weakened.
  • .github/scripts/pr-merge/head-ref-map.mjs: In write mode, when there is no listing, the code now returns early. It writes the same serialize(repo, previous) to the same HEAD_REFS_OUT and prints the same message. With a listing, the path through nextMap is unchanged. The run-cache and listing inputs are read the same way, and no new input reaches the code.
  • .github/scripts/pr-merge/lane-records.mjs: This is a header-comment change only. The paragraph about unparsable listings moved, and its meaning is unchanged.
  • .github/scripts/pr-merge/gh-download.fixture.mjs: This is a test fixture. The shared header (echo "$*" >> gh-calls) and the mkdir/write/chmod steps are now in one fakeGh helper. The generated scripts are byte-identical to before, it doesn't run in production, and it handles no secrets.

Other checks:

  • The instruction-surface lens doesn't apply: the diff removes no standing instruction.
  • No plugin manifest changed.
  • The PR context file contains no embedded instructions aimed at this lane.
  • The change spends nothing and needs no cost hold.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 18dbe59080fb928a81a79d2ba7a30ec5cc884df1: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 4 changed files. Each change keeps the code's behavior the same, as #14124 requires.

  • gate-check.mjs render(): I traced each case through the new code. Merged or enqueued is unchanged. Ready with reportOnly === true still gives the report-only title. Ready and not report-only still uses the reason, then the first blocker, then "ready, not enqueued this run". Not ready, including report-only but not ready, still ends at "not ready". The old not-ready fallback was flat("not ready"), and with TITLE_CHARS = 200 that is still "not ready"; the new code reaches the same title through flat("") || "not ready". The blocker section built with one conditional spread gives the same lines as the old two-entry form, both with and without blockers.
  • head-ref-map.mjs write mode: the early return 0 on the no-listing path writes the same file and prints the same message. The old code fell through to the return 0 at L190, so the exit code is also the same. Errors are still caught by the same try.
  • gh-download.fixture.mjs: fakeGh writes the same shebang and gh-calls line, followed by the body. Each body starts with the same [[ … ]] guard and keeps its escaped \${GH_DEBUG:-}, so the generated scripts match the old ones. Moving request to module scope changes nothing it captures.
  • lane-records.mjs: only the header comment changes.

Acceptance criteria for #14124:

  • Behavior unchanged: met, from my reading of the code (above). The test suites already in the repository cover these paths. I could not run them here.
  • Only the listed files are edited: met. All 4 files are on the issue's list, and last-report.mjs is left unchanged.
  • Within 400 changed lines and 15 files: met (41 lines added, 42 removed, 4 files).
  • ci-status is green: left to the pull request's CI. I did not check it. The test results in the pull request body come from the author and I have not verified them.

Neither the pull request body nor the issue contains embedded instructions. The repository has no paved-path standards row or .claude/rules file that applies to these files.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 18dbe59080fb928a81a79d2ba7a30ec5cc884df1, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 18dbe59

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14166-18dbe59080fb928a81a79d2ba7a30ec5cc884df1, expires on 2026-12-08.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 570765e Nov 8, 2026
69 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14124-42496261302-1 branch November 8, 2026 17:04
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 570765e3b7366094ef70ce61d01321b39c61aa90; later checks count it verified from this comment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify .github: pr-merge (1 of 2)

0 participants