fix(publish): normalize repository field#826
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds repository field normalization to the publish manifest: string-form ChangesRepository field normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR normalizes
Confidence Score: 5/5Safe to merge — the change is scoped to manifest JSON shaping with no effect on auth, tarball generation, or network logic. The normalization runs on a local serde_json::Value copy before the publish body is assembled, so a malformed or missing repository field simply falls through without modifying anything. All known npm shorthand forms are handled, existing object-shaped values are untouched, and the four new unit tests exercise every branching path in the new helpers. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(publish): expand repository shorthan..." | Re-trigger Greptile |
Summary
repositoryvalues to{ type, url }in the publish manifestContext
Inspired by pnpm 11.5.1 matching npm publish behavior for registries that reject string
repositoryfields.Tests
This PR was generated by Codex.
Note
Low Risk
Localized publish-metadata shaping with tests; no auth, network, or tarball logic changes beyond the repository field format.
Overview
Publish now normalizes string
repositoryvalues in the version metadata sent onPUT, so registries that reject bare strings (npm/pnpm-style) accept the payload.When
repositoryis a string, it is rewritten to{ "type": "git", "url": "<normalized>" }vianormalize_publish_manifestinbuild_publish_body. Shorthand forms (owner/repo,github:…,gitlab:…,bitbucket:…) expand tohttps://…/*.gitURLs; explicithttps://,git@, and fragments are preserved. Existing objectrepositoryvalues are left unchanged.Unit tests cover normalized string output, preserved objects, and URL shorthand expansion.
Reviewed by Cursor Bugbot for commit 67cb61b. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit