Skip to content

fix: Share the vendor-update helpers of the playbooks and playwright update scripts - #15541

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15534-43152206752-1
Nov 12, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15534-43152206752-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15534

Summary

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

Moved the five helpers the three vendor update scripts duplicated (log, err, section, replace_metadata_field, main) into a new sourced library lib/vendor-update.sh. Each update.sh now sources its generated copy beside it and keeps its own check_prereqs, print_help, run_check, run_apply, the playbooks-only sha256/local_metadata_field/file_sha, and its source guard. The moved function bodies are byte-for-byte the originals, so flags, output, exit codes and error text are unchanged. Design choices: the source line sits right after the TMPDIR_RUN trap and ends in || exit 2 (the scripts' prerequisite-missing code) so a missing copy fails loudly instead of later with 127; shellcheck SC2154 is disabled per function in the library because FRONTMATTER_FILE and TMPDIR_RUN are the caller's globals.

Not verified

  • The three update.test.sh suites were not executed: this lane runs no test runner. Left to the PR's CI.
  • ci-status green is a PR CI check; left to the PR's CI.
  • Tidy skipped: the change touches the shared paths lib/ and scripts/ named in the tidy cutoffs (and spans more than one area).
  • Build/lint of touched files beyond check-affected's shellcheck was not run separately; check-affected covered shellcheck for all seven .sh files.
  • Review nit not taken: the canonical's 'Edit this file and rerun the script.' line is copied into the generated copies; kept because every other lib/ canonical (e.g. lib/state-key.sh) uses the same wording.

Fix

  • lib/vendor-update.sh: new sourced bash library (# shellcheck shell=bash) holding log, err, section, replace_metadata_field and main, with the caller contract in its header
  • scripts/shared-copies.txt: registered the three generated copies
  • plugins/playbooks/skills/boris/scripts/update.sh: sources vendor-update.sh; removed the duplicated log/err/section, replace_metadata_field and main
  • plugins/playbooks/skills/skill-authoring/scripts/update.sh: same as boris
  • plugins/playwright/skills/playwright/scripts/update.sh: same as boris
  • plugins/playbooks/skills/boris/scripts/vendor-update.sh: generated copy (scripts/sync-shared-copies.sh)
  • plugins/playbooks/skills/skill-authoring/scripts/vendor-update.sh: generated copy
  • plugins/playwright/skills/playwright/scripts/vendor-update.sh: generated copy
  • .changes/playbooks/work-resolve-issue-issue-15534-43152206752-1-a29959e8.md: patch fragment, ### Changed, Internal restructuring, no behavior change.
  • .changes/playwright/work-resolve-issue-issue-15534-43152206752-1-d05c9d24.md: patch fragment, ### Changed, Internal restructuring, no behavior change.

Verification

The runner ran each check from the base copy against 42a09c4:

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

The run reports:

  • sync-shared-copies (generate): generated the three vendor-update.sh copies, exit 0
  • sync-shared-copies --check: All 807 registered copies match their canonical sources, exit 0
  • check-changelog-fragments: All 14 changelog fragment(s) under .changes/ are valid
  • check-changed-skills: boris, skill-authoring and playwright PASS with 0 errors (pre-existing warnings only)
  • check-affected: first run failed shellcheck SC2154 (FRONTMATTER_FILE/TMPDIR_RUN referenced but not assigned in the library); added per-function disables, regenerated copies, rerun: 13 passed, 6 skipped, 0 failed over 10 changed files
  • fresh-context review subagent over the whole diff: no correctness bugs; confirmed moved bodies match the originals, definition order, direct-run and sourced-test paths, generated-copy bytes and shellcheck directive placement
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43152206752

Left out: the items under Not verified.

Related

#15534

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

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 42a09c4db465bde7c241212e4a8d2ff63205bd40. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15541 (head e27f4f7)

No security issues found. I read every hunk of all 10 changed files. The two .changes/ fragments are identical, so I read the first and skipped its copy. None of the changed files matches a trusted-path glob. The diff touches no trust controls and no plugin manifests (plugin.json or marketplace.json).

What changed. The PR is a refactor. Three update scripts had the same five shell helpers copied into each of them: log, err, section, replace_metadata_field and main. The PR moves them into one new shared file, lib/vendor-update.sh. A generated copy of it now sits beside each of these scripts:

  • plugins/playbooks/skills/boris/scripts/update.sh
  • plugins/playbooks/skills/skill-authoring/scripts/update.sh
  • plugins/playwright/skills/playwright/scripts/update.sh

The three copies are registered in scripts/shared-copies.txt.

What I checked:

  • Moved code is unchanged. The moved function bodies match the deleted originals line for line. That includes the escaping in replace_metadata_field, which stops special characters in an upstream version string from corrupting the file through sed. Nothing there got weaker.
  • Where the shared file is loaded from. Each script loads it with source "${SCRIPT_DIR}/vendor-update.sh" || exit 2. SCRIPT_DIR is built from the script's own location ($(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)), not from the current directory or an environment variable. See boris update.sh#L28, skill-authoring update.sh#L29 and playwright update.sh#L31. So nobody can point it at a different file by changing directory or setting a variable. If the file is missing, the script stops with exit code 2.
  • Loading the file has no side effects. It only defines functions; nothing runs until a script calls main. Each script still runs main only when executed directly, not when sourced by its tests.
  • The new copies match the original. All three generated vendor-update.sh copies are the canonical file plus the "GENERATED" header. They share one blob id, and I read each copy's hunk anyway.
  • PR description. It contains no embedded instructions aimed at the review.

Nothing in this diff spends extra credits or can cause a charge.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: #15541, share the vendor-update helpers

No findings. I read every hunk in the 10 changed files. The two .changes/ fragments are identical, so I read the first one and counted the second as its copy.

What the change does. Five helpers were copied in three update scripts: log, err, section, replace_metadata_field and main. They now live once, in the new library lib/vendor-update.sh. A generated copy of it sits beside each update.sh:

  • plugins/playbooks/skills/boris/scripts/
  • plugins/playbooks/skills/skill-authoring/scripts/
  • plugins/playwright/skills/playwright/scripts/

The three copies are registered in scripts/shared-copies.txt.

What I checked:

  • Function bodies are unchanged. The moved bodies match the removed originals line for line. The only additions are the # shellcheck disable=SC2154 comments.
  • Each script finds its copy. Every update.sh sets SCRIPT_DIR from BASH_SOURCE[0] before the source "${SCRIPT_DIR}/vendor-update.sh" || exit 2 line (boris L28/L37, skill-authoring L29/L38, playwright L31/L41). The path resolves to the script's own directory whether it is run directly or sourced by update.test.sh.
  • The helpers are defined before use. log and err are defined before any caller function runs. main only looks up check_prereqs, print_help, run_check and run_apply when it is called, after the whole script has loaded. Each script still ends with its source guard ([[ "${BASH_SOURCE[0]}" == "${0}" ]]), so sourcing a script does not run main.
  • The tests still reach the moved code. The update.test.sh suites source update.sh in place and call replace_metadata_field, which reads the global FRONTMATTER_FILE the tests set. They also run bash "$SCRIPT" --bogus-flag, which goes through the shared main. Those tests would fail if the copy were missing or main broke.
  • Every copy matches its source. All three copies carry the same blob 0c074e28: the canonical file plus the generator's two-line header.

Closing issue #15534, acceptance criteria:

  • Met in the diff:
    • Each of the five functions is defined once, in the library, and all three scripts use its copies.
    • Only the listed files are edited.
    • The change is well under 400 hand-edited lines and 15 files.
    • Each changed plugin gets a patch fragment with the specified text.
  • Not confirmed by me: "Behavior is unchanged" is supported by the identical bodies and the existing tests, but I did not run anything. The author reports sync-shared-copies.sh --check passing; I have not checked that. The three update.test.sh suites and ci-status have not run yet. I have no shell, so all of these are left to CI.

Manifests: no plugin.json or marketplace.json changes. Both fragments use bump: patch, which fits an internal refactor.

Embedded text: none found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for e27f4f7

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-15541-e27f4f7ba4dd1bfa58103544f2302c6c8258d1e1, expires on 2026-12-12.

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 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 1b67c3d Nov 12, 2026
67 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15534-43152206752-1 branch November 12, 2026 15:39
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 1b67c3d6aebaa262f7d0bcafaf7cfa16da2c5e1a; 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.

Share the vendor-update helpers of the playbooks and playwright update scripts

1 participant