Skip to content

refactor(upstream-apply-changelog): simplify upstream-apply-changelog.mjs - #14278

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14144

Summary

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

Simplified .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs without changing what it does. A rawLines helper replaces three copies of the raw-diff split-and-filter, and a pullsFor helper replaces the two copies of the pull-request lookup by head branch in push and publish. The gate loop now breaks on the first release that is not done and logs the rest, with the same output, and the inner commit variable in push that shadowed the outer one is renamed tipCommit. Exports, flags, messages, outputs and API call order are unchanged, and the file is 5 lines shorter (34 added, 39 removed).

Not verified

  • upstream-apply-changelog.test.mjs and credential-legs.test.mjs not run: this lane cannot start node; left to the PR's CI
  • tidy skipped: the change sits under .github/, a listed shared path
  • Review noted one edge case: when GITHUB_REPOSITORY is unset, publish now fails at its first pull-request lookup instead of right after reading the plan. GitHub Actions always sets that variable and no test runs publish, so no run can hit this.
  • Review suggested a refFor helper for the git ref lookup that push and publish both make. Left out to keep this diff small.

Fix

  • .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs: added non-exported rawLines (used by checkRawLog, changesHoldPath, readNetChanges) and pullsFor (used by push and publish), dropped publish's local owner variable, inverted the gate candidate loop's condition, and renamed push's…

Verification

The runner ran each check from the base copy against 26d39a3:

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

The run reports:

Left out: the items under Not verified.

Related

#14144

Merge-Risk: unrated reason=no-rating

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 26d39a3195cda3db68efc2997c9442e40f4757f2: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14278 (head 26d39a3)

I found no security issues. I read every hunk of the one changed file, .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs. It is not on the trusted-path list, though the workflow that runs it (upstream-apply-changelog.yml) is. Because the script feeds the plugin-scope check and the hold-path check that workflow relies on, I checked each change for any difference in what those checks let through.

  • checkRawLog: it now gets its lines from the new rawLines helper, which does the same split on newlines and keeps the same lines starting with :. The regular-file mode allowlist (000000 / 100644 / 100755), the plugins/<plugin>/ and .changes/<plugin>/ prefix check and the .. segment rejection are unchanged. Both sides of a rename are still checked. It lets through nothing the old version stopped.
  • changesHoldPath: the same rename-aware match against the hold-path globs, over the same lines, so the hold-path detection is not narrowed.
  • readNetChanges: the same parsing of mode and destination blob. git cat-file is still called through execFileSync with an argument array, so no shell is involved.
  • gate release loop: flipping the condition gives the same result. The first release without the done marker is selected, and each already-processed one is logged.
  • pullsFor: it builds the same REST URL as the two copies it replaces, with the branch still passed through encodeURIComponent and the owner still taken from GITHUB_REPOSITORY. Its module-level const runs at load, before push or publish can call it, so it cannot fail because it is not yet defined.
  • commit → tipCommit rename: this only removes the shadowing; the tree comparison that decides whether an existing branch counts is unchanged.

Nothing in the diff widens a token's scope, who is trusted, what untrusted text reaches a lane, or a merge hold, and none of it can bill anyone. The PR description contains no embedded instructions aimed at the review. No earlier findings from this lane needed handling: there were none, and this is a full review, not a blocking-only one.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

This PR is a refactor of .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs with no change in behavior. I read every hunk of the one changed file, plus the full gate, push and publish functions at head, and checked each edit against the base code:

  • rawLines helper (L327): it does the same split("\n").filter(startsWith(":")) the three call sites did (checkRawLog, changesHoldPath, readNetChanges). The line numbering n + 1 in checkRawLog still counts the filtered lines, so error messages don't change. The helper is a module-level const and is only called at runtime, after the module has loaded, so it can't hit a temporal-dead-zone error.
  • pullsFor helper (L189): it builds the same URL that push and publish built before (repo.split("/")[0] stands in for the old owner). Nothing else in publish used owner, so removing it is safe.
  • Gate loop (L491-L501): with the condition inverted it is equivalent. The first candidate not yet processed is picked, the processed ones before it are logged in the same order, and the API calls are the same.
  • commit → tipCommit rename in push: this only removes the shadowing of the outer commit, and the later uses of the outer commit (readNetChanges(..., commit)) still resolve to the synthetic commit as before.
  • Edge case the author noted: if GITHUB_REPOSITORY is unset, publish used to throw right after reading the plan. Now it throws at its first pull-request lookup, or, when the plan has no branches, goes on to fileReleaseHandoffs with repo undefined. GitHub Actions always sets this variable, so no real run can hit this, and I'm not counting it as a finding.

Closing issue #14144:

  • Behavior unchanged, exports and flags unchanged: met, from reading the code above. upstream-apply-changelog.test.mjs already covers the exported checkRawLog, changesHoldPath and readNetChanges, so a regression in rawLines could fail those tests. The author did not run the tests (the PR's "Not verified" section says so), and I did not run them either.
  • Diff touches only the listed file: met.
  • Within 400 lines and 15 files: met (34 added, 39 removed, 1 file).
  • ci-status green: left to CI. I can't check it from here.

Paved paths: the standards index has no paved-path row, so there's nothing to report. Path-scoped rules: no rule under .claude/rules/ matches the changed file. No plugin manifest changed. The changed file isn't on the trusted-path list. I found no embedded instructions in the PR context. This was a full review (blocking only: no).

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@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 80981dd Nov 8, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14144-42530613791-1 branch November 8, 2026 23:40
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 80981dd605f061d8e6fd279c94cb9f90c081f17b; 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: upstream-apply-changelog.mjs

0 participants