Skip to content

v1: deprecate each release on npm in the publish job - #2953

Closed
cliffhall wants to merge 2 commits into
v1/mainfrom
v1/chore/2104-auto-deprecate-on-publish
Closed

cliffhall wants to merge 2 commits into
v1/mainfrom
v1/chore/2104-auto-deprecate-on-publish

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2104

What changed

A Deprecate the published v1 packages step in .github/workflows/main.yml's publish job, right after npm run publish-all. It runs npm deprecate on the exact version just published (read from the root package.json, which check-version already holds in lockstep with the three workspaces) for all four names: inspector, inspector-cli, inspector-client, inspector-server.

npm deprecate is a point-in-time write, not a standing rule, so until now every v1 release shipped un-deprecated unless someone remembered the manual step (1.0.2 didn't get it).

Acceptance criteria

  • Release ends deprecated, no manual step. Four npm deprecate calls at @${VERSION}.
  • Nothing outside the published version is touched. It's the exact version, not a range. <2.0.0 would also match 2.0.0-rc.*. As a further guard, the step refuses any version that doesn't start with 1..
  • An empty message fails instead of lifting deprecation. It's an explicit check, and set -u also catches an unset MSG.
  • Credential decision. ⚠️ This needs a maintainer to act before it can do anything. See below.

The message is byte-identical to the one already on 1.0.4 (checked with npm view @modelcontextprotocol/[email protected] deprecated). The runtime banners from #1827 say the same thing in different words, so the comment asks for their intent to stay in sync, not for an exact match.

⚠️ Prerequisite: NPM_DEPRECATE_TOKEN on the release environment

OIDC trusted publishing covers npm publish only. npm deprecate needs a real token, so this is the repo's first long-lived npm credential. Merging this PR is what makes that decision. Before the next v1 release:

  • Create a granular access token with read/write on the four @modelcontextprotocol/inspector* packages only, and give it an expiry.
  • Store it as an environment secret on release, not repo-wide, so it sits behind the existing required reviewers.

Without the secret, the step fails the job with an error saying the version was published but NOT deprecated. It doesn't skip silently. The publish itself has already succeeded by then.

Verification

  • [email protected] --check and actionlint (which includes shellcheck) both pass on the workflow.
  • I extracted the run: block from the YAML and ran it with npm shimmed to log its calls:
Case Exit npm calls
Normal (1.0.4, token set) 0 4 × deprecate @modelcontextprotocol/<pkg>@1.0.4
Token unset 1 0
MSG="" 1 0
package.json version 2.0.0-rc.4 1 0

🤖 Generated with Claude Code

npm deprecate is a point-in-time write, so every v1 release landed
un-deprecated unless someone remembered to run it by hand. Add a step
after publish-all that deprecates the exact version just published on
all four package names, refusing an empty message, a non-v1 version,
or a missing NPM_DEPRECATE_TOKEN.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Retrying a failed deprecation step reruns publication of already-published package versions, causing npm to reject the retry before deprecation can complete.

1 open issue
What changed in this PR

Automates npm deprecation notices for v1 releases, complementing the existing runtime notices and removing the routine manual registry update described in #2104.

Changes:

  • Deprecates the exact published version of all four Inspector packages.
  • Rejects non-v1 versions, empty messages, and missing credentials.
  • Uses NPM_DEPRECATE_TOKEN, which maintainers must provision on the release environment.
File Description
.github/​workflows/​main.yml Adds post-publication deprecation calls, safety checks, and credential documentation.

Review effort: Balanced

Comment thread .github/workflows/main.yml Resolved
Address review: as a step after publish-all, re-running the failed job
re-ran the publish, which npm rejects for an existing version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1 summary:

  • Separate deprecation from publishing (inline): fixed in f98fdb5. It's now a deprecate-npm job depending on publish, so it can be retried on its own. Note that release reviewers now approve it as a second job.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Introducing the repository’s first long-lived npm write credential requires maintainer acceptance and verification of package scope, expiry, 2FA compatibility, and release-environment reviewer protections that the diff does not establish.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 2 was clean (no inline or suppressed findings, and round 1's finding is resolved). Its headline only restates the credential decision, which is the maintainer prerequisite in the PR body: provision a granular, scoped, expiring NPM_DEPRECATE_TOKEN on the release environment before the next v1 release.

@cliffhall

Copy link
Copy Markdown
Member Author

Closing unmerged: maintainers decided not to add a long-lived npm token to the repo, which this step would need, so npm deprecation stays a manual step. #2104 is closed as not planned. A follow-up issue will add the deprecate step to the release skill's v1 flow.

@cliffhall cliffhall closed this Nov 11, 2026
@cliffhall
cliffhall deleted the v1/chore/2104-auto-deprecate-on-publish branch November 11, 2026 19:50
@cliffhall

Copy link
Copy Markdown
Member Author

Not going to create another token to manage. Maybe in the future but not now. Instead, we will add a step to the v1 flow of the release skill that steps the maintainer through the process of deprecating each package of the v1 inspector manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1: automate npm deprecate in the main.yml publish job so v1 releases ship deprecated

2 participants