fix(install): handle workspace scripts and pnpm aliases#500
Conversation
7eb5adc to
bef204c
Compare
Greptile SummaryThis PR fixes three related issues in workspace installs: lifecycle hooks now run for every physical workspace importer in topological dependency order rather than only the root; build policy ( Confidence Score: 5/5Safe to merge; only finding is a P2 quality concern about silent cycle handling in the topological sort. All three bug fixes are correctly implemented, well-tested, and the logic is sound. The single comment is a P2 about missing diagnostics in an edge case (cyclic workspace deps) that pnpm itself would reject as invalid. No P0 or P1 issues found. No files require special attention; the topological sort fallback in mod.rs at the cycle-detection boundary is the only item worth revisiting. Important Files Changed
Reviews (3): Last reviewed commit: "fix(install): run workspace lifecycle sc..." | Re-trigger Greptile |
bef204c to
f362657
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f362657. Configure here.
f362657 to
5701829
Compare

Summary
onlyBuiltDependenciescan approve their dependency builds.pnpm-lock.yamlnpm aliases in pnpm's native shape while keepingaube-lock.yaml's internalaliasOfround-trip.Root Cause
aube installcollected all workspace importers for resolution/linking, but lifecycle execution and build policy construction still used only the root manifest. The pnpm writer also reused aube's internal alias metadata inpnpm-lock.yaml, which produced extraaliasOffields instead of pnpm's native<real>@<version>alias encoding.Validation
cargo fmt --checkcargo test -p aube-lockfile write_pnpm_lockfile_uses_native_alias_shape -- --nocapturecargo test -p aube-lockfile npm_alias -- --nocapturemise run test:bats test/lifecycle_scripts.bats --filter 'workspace install runs member postinstall hooks|workspace member onlyBuiltDependencies'mise run test:bats test/install.bats --filter 'npm-alias'cargo clippy -p aube -p aube-lockfile --all-targets -- -D warningsNote: the full
test/lifecycle_scripts.batsfile still has two unrelated existing/environment failures in this checkout:dep postinstall can invoke a transitive-dep bin by bare nameand the registry-backedaube add --allow-build=<pkg> writes to workspace root under --filter.Note
Medium Risk
Changes installation-time lifecycle execution and build-policy merging across workspace members, which can affect which scripts run (and in what order) during workspace installs. Also changes
pnpm-lock.yamlalias serialization, which could impact lockfile round-trips and dependency resolution if edge cases were missed.Overview
During recursive/workspace installs,
aube installnow runs project lifecycle hooks (preinstall/install/postinstall/prepare) for each linked workspace importer (in dependency order) instead of only the workspace root, and it builds the dependency build-script policy by mergingpnpm.allowBuilds/onlyBuiltDependencies/neverBuiltDependenciesacross all participating manifests (with deny winning on conflicts).pnpm-lock.yamlwriting now emits npm aliases in pnpm’s native encoding (aliasversion:points at<real>@<resolved>and lockfile keys/snapshots use the real package name), while keeping aube’s internalaliasOfmetadata for non-pnpm-lock.yamloutputs; parsing is hardened to resolve alias targets even when peer suffixes are present. Adds targeted Rust unit tests plus Bats integration tests covering workspace lifecycle execution and memberonlyBuiltDependenciesbehavior.Reviewed by Cursor Bugbot for commit 5701829. Bugbot is set up for automated code reviews on this repo. Configure here.