Skip to content

codemod iterations - #2386

Merged
KKonstantinov merged 7 commits into
mainfrom
feature/codemod-iterations-4
Jun 29, 2026
Merged

KKonstantinov merged 7 commits into
mainfrom
feature/codemod-iterations-4

Merge branch 'main' into feature/codemod-iterations-4

a864a71
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 29, 2026 in 13m 43s

Code review found 3 potential issues

Found 5 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit packages/codemod/src/runner.ts:147-152 Missing changeset for user-facing shebang-preservation fix
🟡 Nit packages/codemod/src/bin/batchTest.ts:364-371 parseNpmViewVersion .at(-1) is not the semver-highest match
🟡 Nit packages/codemod/batch-test/README.md:12-13 README step 4 still claims codemod always runs via programmatic API

Annotations

Check warning on line 152 in packages/codemod/src/runner.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Missing changeset for user-facing shebang-preservation fix

The shebang capture/restore in runner.ts is a user-facing bugfix to the published `@modelcontextprotocol/codemod` package, but the PR ships no `.changeset/*.md` entry, so the fix won't produce a version bump or reach npm consumers. Adding a patch changeset for `@modelcontextprotocol/codemod` (as #2383 did for the previous codemod fix) would let this ship; the batch-test harness changes are dev-only and don't need one.

Check warning on line 371 in packages/codemod/src/bin/batchTest.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

parseNpmViewVersion .at(-1) is not the semver-highest match

`parseNpmViewVersion` returns `parsed.at(-1)` with the comment "highest match for a range", but `npm view <pkg>@<range> version --json` returns matching versions in publish order, not semver order — so this picks the most-recently-published match, which is lower than the highest whenever a backport is published after a newer matching release. The mis-resolved version would flow into the results-dir label, `summary.json`, and the pinned versions when `--sdk-version` is a range; a small semver sor

Check warning on line 13 in packages/codemod/batch-test/README.md

See this annotation in the file changed.

@claude claude / Claude Code Review

README step 4 still claims codemod always runs via programmatic API

Step 4 of the "How it works" list still unconditionally says the codemod "runs ... using the programmatic API", but with the new `--codemod=published` mode it is instead executed by shelling out to the published CLI via `npx` (`runCodemod()` in `batchTest.ts`). Consider qualifying step 4 the same way step 5 was qualified for the `--sdk` split, e.g. "using the programmatic API (`--codemod=local`, the default) or the published CLI via `npx` (`--codemod=published`)".