fix(update): include root package in workspace version map#757
Conversation
Greptile SummaryFixes
Confidence Score: 5/5Safe to merge — both changes are additive insertions before existing loops with no mutation of existing logic paths. The two code sites are symmetric and self-contained: each seeds the version map from the root manifest and falls back to "0.0.0" when version is absent, matching the identical pattern already used for child packages. The only edge case worth noting — a workspace whose packages: glob includes "." — results in a harmless double-insert of the same key/value. Error handling in update.rs correctly distinguishes missing-file (silent) from malformed-JSON (warn), and the four new tests cover the fix's core scenarios. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(update): apply cr and add tests" | Re-trigger Greptile |
|
will need a test |
Thanks for your attention. I'm currently optimizing based on greptile's CR report. |
|
@jdx All changes in this PR have been covered by unit tests and have passed local testing via |
Problem
When the workspace root's
package.jsondefines anameandversion, and a child package depends on the root package via theworkspace:*protocol,aube update/aube installfails withERR_AUBE_NO_MATCHING_VERSION.Root Cause
Root Cause:
ws_package_versionsis built solely from the glob matches ofpackages:inpnpm-workspace.yaml. The root package itself is not included in the glob, so itsname+versionis never added to the map.try_workspace_linkchecksworkspace_packages.get, which returnsNone, causing a fallback to registry fetch. Thenpick_versioncannot resolveworkspace:*as a semver range.Fixes (2 locations)
install/workspace.rsdiscover_workspace_plan)update.rsworkspace_package_versions)Both locations now use
root.version.as_deref().unwrap_or("0.0.0")as a fallback when theversionfield is missing, consistent with the handling for child packages.