Skip to content

refactor(source-control): simplify pull-request scripts (2 of 2) - #15278

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14948-42969219918-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14948

Summary

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

Simplified 7 of the 10 listed pull-request scripts without changing what they do: same flags, messages, exit codes and output. push-branch.sh puts each skip-and-return guard on one line (the form read-review-venue.sh already uses) and builds the lane-push.sh call from one argument array. resolve-remote.sh replaces if-blocks with || fallbacks. verify-gate.sh, ready-skip-comment.sh and read-review-comments.sh each read their flags in one case branch. read-pre-ready.sh drops a copy of PRE_READY_STEPS, and read-review-venue.sh resolves the repository-level value directly instead of through two flag variables. read-pr.sh, review-venue.sh and siblings-line.sh are unchanged: I found no change in them that kept behavior identical and made them shorter or clearer.

Not verified

  • The script test suites (push-branch.test.sh, resolve-remote.test.sh, verify-gate.test.sh, read-pre-ready.test.sh, read-review-comments.test.sh, ready-flip.test.sh and others) were not run here, because the lane allows no interpreter. They are left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI
  • tidy: the code passes found nothing to edit. On the changelog fragment, the write-for-humans and AI-tell passes changed nothing, because the issue sets its text word for word. The AI-tell check read the text but did not run its detect.sh detector, which this lane does not allow.

Fix

  • plugins/source-control/skills/pull-request/scripts/push-branch.sh: each || { sync_skip ...; return 0; } and local_default guard on one line; the two lane-push.sh exec calls merged into one call with a --branch or --pr argument array
  • plugins/source-control/skills/pull-request/scripts/resolve-remote.sh: if-blocks for the branch default and the pushDefault and branch.<name>.remote fallbacks replaced with \[\[ -n \]\] || assignments
  • plugins/source-control/skills/pull-request/scripts/verify-gate.sh: --head and --result parsed in one case branch (same error text through $1); the temporary common variable dropped
  • plugins/source-control/skills/pull-request/scripts/read-pre-ready.sh: STEPS, a copy of PRE_READY_STEPS, removed; PRE_READY_STEPS used directly
  • plugins/source-control/skills/pull-request/scripts/read-review-comments.sh: --prs and --repo parsed in one case branch instead of two case statements in a row
  • plugins/source-control/skills/pull-request/scripts/read-review-venue.sh: read_repo calls resolve itself when the file sets review_venue, which removes the repo_value and repo_set globals
  • plugins/source-control/skills/pull-request/scripts/ready-skip-comment.sh: the if/elif/else flag assignment changed to a case statement
  • .changes/source-control/work-resolve-issue-issue-14948-42969219918-1-1a244305.md: patch fragment, ### Changed / Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against c4b4a82:

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

The run reports:

  • check-changelog-fragments: all 8 fragments valid
  • check-changed-skills: pull-request PASS, 0 errors, 4 warnings, all in SKILL.md and reference/ready-for-review.md, which this change does not touch
  • check-affected: 13 passed, 6 skipped over 8 changed files
  • fresh-context review subagent over the whole diff: no change in behavior during normal runs. It found one edge case: read-review-comments.sh writing rows straight to stdout would exit 0 instead of 1 when a stdout write fails with something other than a broken pipe. I restored the original temp-file…
  • grep of plugins/source-control tests: no *.test.sh checks the script text this diff changes (STEPS, LANE_PUSH, repo_set, out.jsonl)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42969219918

Left out: the items under Not verified.

Related

#14948

Merge-Risk: max=MEDIUM demote=false head=c4b4a82ef0e79cc5b3fb091abcb554da7087a1e2 rubric=8.4.1 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15278, head c4b4a82

No security issues found.

I read every hunk of all 8 changed files. None of them match a trusted path, and none changes a trust control: the trusted-trigger check, the lane token, the kill switch, the token broker's signer and the merge holds are all untouched. No plugin manifest changes either. The PR is a bash refactor of the pull-request skill scripts plus one changelog fragment. I checked each hunk to see whether it still behaves the same, since a refactor could quietly change a security-relevant path:

  • push-branch.sh: The two exec bash lane-push.sh calls are merged into one call. A quoted TARGET array picks --pr or --branch, with --pr winning when $PR is set, as before. The lane-push path is the same, all arguments are still quoted, and the array is never empty under set -u. The sync_skip/local_default guards were folded onto one line each with the same return 0 behavior. Each !-negated MERGE_HEAD check keeps its meaning.
  • read-review-venue.sh: resolve now runs inside read_repo instead of through the repo_value/repo_set globals. resolve always calls exit 0, so the repository level still wins once it is read. The fail-closed early returns (missing base, base other than the default branch, failed read) are unchanged. The script runs set -uo pipefail without -e, so the function returning non-zero when BASE_FILE_HAS is 0 does not exit the script. The fall-through to userConfig and then the default is the same.
  • read-pre-ready.sh: The STEPS copy was dropped in favor of PRE_READY_STEPS, and no other use of STEPS remains. The unknown-step fail_closed check is unchanged in substance.
  • verify-gate.sh: Combining --head/--result into one branch keeps the same values and error text. Building dir from --git-common-dir keeps the die 2 fail path, and /ready-verify is appended only after that call succeeds.
  • read-review-comments.sh, ready-skip-comment.sh, resolve-remote.sh: These only merge case branches or turn if-blocks into || assignments. Flag parsing, the remote precedence (pushRemote > pushDefault > branch.remote) and the error paths are the same.
  • Changelog fragment: Prose only.

The PR context file holds no embedded directives aimed at this lane. Prior findings: none, and this is not a blocking-only review.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15278, refactor(source-control): simplify pull-request scripts (2 of 2)

No findings. I read all 8 changed files in full and checked each rewrite to see whether behaviour changed. None did.

  • push-branch.sh
    • The two exec lane-push.sh calls are now one call that takes a TARGET array. It holds --branch by default and --pr when $PR is set. The arguments and their order are the same as before. The array always has two elements, so set -u cannot trip on it.
    • The guards are now one-line { sync_skip …; return 0; } groups, and so are the local_default and case branches. They do the same thing as the multi-line versions.
  • resolve-remote.sh: the if blocks are now [[ -n ]] || fallbacks.
    • The script runs with set -uo pipefail and no -e, so a failing assignment exits the same way it did before.
    • The fallback order is unchanged: branch.<name>.pushRemote, then remote.pushDefault, then branch.<name>.remote.
  • verify-gate.sh
    • The merged --head | --result branch prints the same error text through $1.
    • Dropping common is safe: nothing else in the file reads it, and dir+=/ready-verify builds the same path.
  • read-review-comments.sh, ready-skip-comment.sh
    • The flags are now read in a single case branch. The shift counts and the values assigned are unchanged.
    • Help and unknown-argument handling are unchanged.
  • read-pre-ready.sh: STEPS is gone. I searched plugins/source-control and found no other reader of STEPS, so using PRE_READY_STEPS directly is equivalent.
  • read-review-venue.sh
    • read_repo now calls resolve itself, and resolve always runs exit 0, so the output is the same as before.
    • When the file doesn't set the key, ((BASE_FILE_HAS)) && … makes the function return 1. That can't end the script, because it runs under set -uo pipefail with no -e. Resolution then continues to the userConfig level as before.
  • Changelog fragment: it uses bump: patch with the body ### Changed / "Internal simplification, no behavior change.", which is the text the issue sets.

Closing issue #14948, acceptance criteria

  • Behaviour unchanged: met, based on the line-by-line check above. Per the PR, the existing suites (push-branch.test.sh, resolve-remote.test.sh, verify-gate.test.sh, read-pre-ready.test.sh, read-review-comments.test.sh and others) cover these scripts. I did not run them; that is left to the PR's CI.
  • Diff edits only the listed files plus a fragment: met.
  • At most 400 changed lines and 15 files: met. The diff is about 100 lines over 7 scripts and 1 fragment.
  • ci-status green: CI hasn't reported yet, so this criterion is still open.
  • Fragment present with the required body: met.

The test runs and CI results in the PR body are the author's claims; I have not checked them.

No plugin manifest changed. Nothing in the PR context tries to give the review instructions.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for c4b4a82

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-15278-c4b4a82ef0e79cc5b3fb091abcb554da7087a1e2, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit d303e43 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14948-42969219918-1 branch November 11, 2026 07:11
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 the pull-request source-control plugin code (2 of 2)

0 participants