Skip to content

PDX-000: fix(ci): make npm publish idempotent and wait for registry propagation#166

Merged
mrdailey99 merged 1 commit into
mainfrom
fix/mcp-registry-publish-idempotent
May 12, 2026
Merged

PDX-000: fix(ci): make npm publish idempotent and wait for registry propagation#166
mrdailey99 merged 1 commit into
mainfrom
fix/mcp-registry-publish-idempotent

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

Summary

  • Skip npm publish if the version is already on npm (idempotent re-runs)
  • Poll npm registry for up to 3 minutes before running mcp-publisher publish to avoid the 404 race condition

Root cause

mcp-publisher publish validates the npm package exists before publishing to the MCP registry. The step ran immediately after npm publish, but npm's CDN hadn't indexed the new version yet, causing a 404.

Test plan

  • Re-trigger the "Publish to NPM and MCP Registry" workflow manually for v1.5.0 — npm publish should be skipped, wait step should confirm the package is available, MCP registry publish should succeed

🤖 Generated with Claude Code

…ropagation before MCP publish

RCA: MCP registry publish failed with 404 because npm package was not yet indexed when mcp-publisher ran immediately after npm publish.
Fix: Skip npm publish if version already exists on npm, and poll npm registry for up to 3 minutes before running mcp-publisher publish.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 12, 2026 21:48
@mrdailey99 mrdailey99 merged commit be0320f into main May 12, 2026
2 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the manual deploy GitHub Actions workflow to make publishing more robust by avoiding duplicate npm publish attempts and reducing the race where downstream publishing runs before npm’s registry/CDN has indexed the new version.

Changes:

  • Skip npm publish when the current package.json version already exists on the npm registry.
  • Add a polling step (up to ~3 minutes) to wait for the new version to become available on npm before running mcp-publisher publish.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +42
VERSION=$(node -p "require('./package.json').version")
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://registry.npmjs.org/%40provartesting%2Fprovardx-cli/${VERSION}")
if [ "$STATUS" = "200" ]; then
echo "Version ${VERSION} already published on npm, skipping."
else
npm publish --tag "$TAG" --access public
echo "Attempt ${i}/18: npm returned ${STATUS}, retrying in 10s..."
sleep 10
done
echo "Package not available after 3 minutes; proceeding anyway."
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.

2 participants