Skip to content

Fail release metadata resolution on non-E404 npm view errors - #130

Open
nakasyou wants to merge 2 commits into
mainfrom
devin/1790237708-npm-view-error-handling
Open

nakasyou wants to merge 2 commits into
mainfrom
devin/1790237708-npm-view-error-handling

Conversation

@nakasyou

Copy link
Copy Markdown
Member

Summary

fetchPublishedVersions in scripts/release/resolve-release-metadata.ts caught every npm view failure and returned []. That fallback is only right for an unpublished package; a registry 5xx / timeout / auth error made resolveVersionPlan treat an established package as unpublished and compute a from-scratch version (e.g. 0.0.1).

Now only E404 in npm's stderr maps to []; anything else throws with the stderr attached so the release fails loudly:

} catch (error) {
  if (isNpmNotFoundError(error)) return []   // /\bE404\b/.test(stderr)
  throw new Error(`Failed to fetch published versions for ${packageName}: ...`, { cause: error })
}

Verified against the live registry: an unknown package yields npm error code E404 (→ empty), while an unreachable registry yields no E404 (→ throws).

Remediates code scan finding sfind-c138261349c14d908bd99dcb300704a1.

Link to Devin session: https://app.devin.ai/sessions/30e809fe92844dd387188578fc56a4e4
Open in Devin Desktop: https://app.devin.ai/desktop/session/30e809fe92844dd387188578fc56a4e4?variant=devin
Requested by: @nakasyou

Co-Authored-By: Shotaro Nakamura <syoutarou1103@outlook.jp>
Copilot AI lite review requested due to automatic review settings September 24, 2026 08:15
@nakasyou nakasyou self-assigned this Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Website preview: https://pr-130-eclipsa.xiarenda61.workers.dev

Commit: 6c9d18d

Co-Authored-By: Shotaro Nakamura <syoutarou1103@outlook.jp>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants