Certify pm CLI 2026.9.23 and adopt the guarded pm-ops merge-driver launcher - #119
Conversation
…uncher - Pins @unbrained/pm-cli 2026.9.21 -> 2026.9.23, pm-ops 2026.9.18 -> 2026.9.23, pm-changelog 2026.9.18 -> 2026.9.23 exactly (package.json and package-lock.json). - scripts/prepare-merge-driver.ts is now the launcher template pm-ops ships, copied unchanged: it imports nothing from pm-ops, so `npm ci --omit=dev` in a clone skips with one notice instead of failing, while a stale or broken pm-ops still fails. A test keeps it byte-identical to the pinned template and proves it registers the drivers. pm items: pm-context-h04z. Companion epic pm-cli-website-5s6z. release:check exits 0.
Reviewer's GuideThis PR upgrades the pinned pm toolchain to 2026.9.23 and adopts its guarded merge-driver launcher, which avoids hard failure when pm-ops is omitted from production installs while still failing for stale or broken installations. Documentation, changelog/project-management records, exact lockfile pins, and tests are updated; the tests enforce byte-for-byte template parity and verify merge-driver registration. Sequence diagram for guarded merge-driver installationsequenceDiagram
participant NPM as npm prepare
participant Launcher as prepare-merge-driver.ts
participant Resolver as Node module resolver
participant PMOps as pm-ops installer
participant Git as Git config
NPM->>Launcher: execute
Launcher->>Resolver: resolve pm-ops/merge-driver/prepare
alt pm-ops is absent
Resolver-->>Launcher: MODULE_NOT_FOUND
Launcher->>Resolver: resolve pm-ops/package.json
Resolver-->>Launcher: MODULE_NOT_FOUND
Launcher-->>NPM: print skip notice
else pm-ops is installed
Resolver-->>Launcher: installer path
Launcher->>PMOps: spawn installer
PMOps->>Git: register merge drivers
Git-->>PMOps: drivers registered
PMOps-->>NPM: success or installer failure
end
Flow diagram for merge-driver launcher failure guardingflowchart TD
A[Run prepare-merge-driver.ts] --> B[Resolve pm-ops merge-driver entry]
B -->|Entry found| C[Spawn pm-ops installer]
C --> D[Register Git merge drivers]
B -->|Entry missing| E[Resolve pm-ops package]
E -->|Package absent| F[Print one skip notice]
E -->|Package present| G[Re-throw resolution error]
C -->|Installer fails| H[Fail npm install]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="test/prepare-merge-driver.test.ts" line_range="24-27" />
<code_context>
+});
+
+test("the prepare launcher registers pm's merge drivers in this checkout", () => {
+ const run = spawnSync(process.execPath, [launcher], { cwd: root, encoding: "utf8" });
+ assert.equal(run.status, 0, run.stderr);
+ const drivers = spawnSync("git", ["config", "--get-regexp", "^merge\\.pm"], { cwd: root, encoding: "utf8" });
+ assert.match(drivers.stdout, /^merge\.pm/m);
+});
</code_context>
<issue_to_address>
**issue (testing):** The test only checks whether any `merge.pm` configuration exists after the launcher exits successfully; it does not verify that this invocation registered the expected drivers. A pre-existing local Git configuration therefore lets the test pass even if the launcher becomes a no-op or registers no drivers.
**Triggers:** When the repository already has merge.pm entries, as it does after a prior `npm install`/`prepare` run.
**Suggested fix:** Run the launcher against an isolated Git config or assert the complete expected driver definitions, including their names and commands.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: test/prepare-merge-driver.test.ts:27
|
…d driver Review round 1 (Sourcery, Greptile): the first test could pass on merge drivers this repository's own npm ci had already registered, and it accepted any single driver. Each case now runs the launcher as npm's prepare hook would, inside a fresh git-init checkout with this repository's .gitattributes and tracker settings, and asserts the exact driver set .gitattributes declares. It also covers the omit-dev skip, a stale pm-ops, and failing and signal-killed installers. pm item: pm-context-h04z.
Review round 1 (Greptile): the README still described the old PATH-only guard. The prepare hook hands over to pm-ops's installer, which runs pm merge install when pm is on PATH; the launcher skips with one notice when pm-ops is absent (npm ci --omit=dev in a clone) and fails on a stale or broken pm-ops. pm item: pm-context-h04z.
|
Review round complete before merge. All 2 inline bot threads were answered in-thread, and each was either fixed in this PR or tracked on the companion hub (launcher template: pm-cli-website-dqg7; release-workflow verifier: pm-cli-website-mxrp). Greptile's latest review covers the current head 7b89e71 with Confidence Score: 5/5. Sourcery skipped this head (its weekly diff allowance), so its earlier findings on this PR are the last it gave, and all were answered. CodeRabbit posted only its free-plan notice: this repository has fewer than 10 stars, so it doesn't review automatically, and its one-review-per-hour allowance is kept for PRs that need it. Every required check is green on 7b89e71. |
Summary
Fleet wave of 2026-09-25 (companion epic
pm-cli-website-5s6z), applied by the fleet's deterministic wave script and verified by this repository's own gates.pm-cli-website-xy19):scripts/prepare-merge-driver.tsis now the template pm-ops 2026.9.23 ships, copied unchanged (it replaces the static-import launcher). It imports nothing from pm-ops, so a production install of a clone (npm ci --omit=dev) skips with one notice instead of dying onERR_MODULE_NOT_FOUND, while a stale or broken pm-ops still fails the install.prepare-merge-driver.test.tscompares the file byte-for-byte withnode_modules/pm-ops/templates/prepare-merge-driver.ts(pm-ops covers every branch of that template with real fixtures) and runs it to prove the drivers register.pm items
Verification
git config --get-regexp '^merge\.pm'afternpm cipm health ... --require-merge-drivers), executed from ci.ymlnpm run release:checkok - the flag changes the heading: '## 2026.1.2-2 - 2026-01-02' with it, '## 2026.1.2-2' w)changelog:fullthenchangelog:checkSummary by Sourcery
Certify the pm toolchain at 2026.9.23 and harden merge-driver setup for production installs.
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores:
Summary by cubic
Pins the pm toolchain to 2026.9.23 and replaces the static-import merge-driver launcher with the guarded template pm-ops ships.
npm ci --omit=devin a clone now skips with one notice instead of failing on a missingpm-opsimport, while a stale or brokenpm-opsstill fails the install.@unbrained/pm-clito 2026.9.23 andpm-opsandpm-changelogto 2026.9.23 inpackage.jsonandpackage-lock.json.scripts/prepare-merge-driver.tsbyte-for-byte from the pm-ops template; a test keeps it identical and runs it in fresh git-init checkouts to confirm each.gitattributesdriver registers, covering the omit-dev skip, stalepm-ops, and failing and killed installers.Written for commit 7b89e71. Summary will update on new commits.