Skip to content

test(resolver): cover alias peer cycle#813

Merged
jdx merged 2 commits into
mainfrom
test/alias-peer-cycle
May 31, 2026
Merged

test(resolver): cover alias peer cycle#813
jdx merged 2 commits into
mainfrom
test/alias-peer-cycle

Conversation

@jdx

@jdx jdx commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a timeout-guarded resolver regression for npm aliases participating in a peer cycle
  • assert the alias package keeps alias_of while the peer package resolves
  • mirrors the pnpm v11.5 dep-path hang shape without adding a large fixture

Tests

  • cargo fmt --check
  • cargo test -p aube-resolver resolve_terminates_on_npm_alias_peer_cycle
  • cargo test -p aube-resolver resolve_terminates_on
  • git diff --check

This PR was generated by Codex.


Note

Low Risk
Test-only change in crates/aube-resolver/src/tests.rs; no production resolver logic modified in this diff.

Overview
Adds a regression test in aube-resolver for resolver behavior when an npm alias sits in a peer dependency cycle, modeled on the pnpm v11.5 dep-path hang.

The fixture wires root alias-anpm:real-a, real-a peers on b, and b peers back on alias-a while depending on the same alias. The test runs resolve under a 5s timeout and asserts the graph finishes without hanging: the alias is keyed by its alias dep_path, keeps alias_of / registry_name(), does not expose a real-a@… package key, and still resolves b.

Reviewed by Cursor Bugbot for commit 83045e2. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a timeout-guarded async regression test for the resolver's behavior when an npm alias sits inside a peer dependency cycle, mirroring the dep-path hang shape fixed in pnpm v11.5. No production code is modified.

  • Fixtures alias-a → npm:real-a@1.0.0, real-a peering on b, and b peering back on alias-a; resolution must finish within 5 s and the alias package must retain its alias-keyed dep_path (alias_of, registry_name).
  • Assertions drive a direct graph.packages.get(alias_dep_path) key lookup (derived from the root importer) rather than a linear value scan, so a future regression that stores the alias under real-a@… would be caught immediately.

Confidence Score: 5/5

Test-only addition with no changes to production resolver logic; safe to merge.

The change is a single new async test. The 5 s timeout matches the sibling cycle test, the alias package is asserted via a dep_path key lookup (not a value scan), and the fixture follows the established make_packument / pre-seeded cache pattern. No production code is touched.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube-resolver/src/tests.rs Adds resolve_terminates_on_npm_alias_peer_cycle regression test with 5 s timeout, dep_path key lookup, and alias invariant assertions covering the pnpm v11.5 hang pattern.

Reviews (3): Last reviewed commit: "test(resolver): tighten alias peer cycle..." | Re-trigger Greptile

Comment thread crates/aube-resolver/src/tests.rs
Comment thread crates/aube-resolver/src/tests.rs
@jdx jdx force-pushed the test/alias-peer-cycle branch from 7e39e13 to 83045e2 Compare May 31, 2026 14:33
@jdx jdx enabled auto-merge (squash) May 31, 2026 14:43
@jdx jdx merged commit 16a2e98 into main May 31, 2026
18 checks passed
@jdx jdx deleted the test/alias-peer-cycle branch May 31, 2026 14:47
@greptile-apps greptile-apps Bot mentioned this pull request May 31, 2026
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.

1 participant