-
Notifications
You must be signed in to change notification settings - Fork 0
fix(supply-chain): restore simple-path cycle regressions after Bolt rewrite #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5b71eb0
3f94b21
28c61cd
913e7c7
fca0bb7
b6690c6
bbf46a3
3ac96dd
a88b213
f4a6053
4881dba
dbcbe6d
bcf22ee
f270d3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| """Regression tests for Cargo dependency-path cycle handling.""" | ||
|
|
||
| from conftest import load_module | ||
|
|
||
|
|
||
| def test_dependency_path_does_not_reuse_a_package_key_through_a_cycle() -> None: | ||
| """Ensure a cycle cannot make one package instance satisfy two path positions.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_cycle_regression", | ||
| ) | ||
| package_dependencies = { | ||
| "root 1.0.0": ["alpha 1.0.0"], | ||
| "alpha 1.0.0": ["beta 1.0.0", "charlie 1.0.0"], | ||
| "beta 1.0.0": ["alpha 1.0.0"], | ||
| "charlie 1.0.0": [], | ||
| } | ||
|
|
||
| assert not supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) | ||
|
Comment on lines
+19
to
+23
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This locks the False cycle case only. On the same fixture, also assert |
||
|
|
||
|
|
||
| def test_dependency_path_can_match_same_name_on_distinct_package_keys() -> None: | ||
| """Ensure distinct package instances may legitimately satisfy repeated names.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_distinct_instances", | ||
| ) | ||
| package_dependencies = { | ||
| "root 1.0.0": ["alpha 1.0.0"], | ||
| "alpha 1.0.0": ["beta 1.0.0"], | ||
| "beta 1.0.0": ["alpha 2.0.0"], | ||
| "alpha 2.0.0": ["charlie 1.0.0"], | ||
| "charlie 1.0.0": [], | ||
| } | ||
|
|
||
| assert supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This locks the False cycle case only. The required counterpart is still missing: on this same fixture,
("alpha", "charlie")must stay True (direct remaining-name match must not die just becausebetapoints back atalpha@1). I reproduced True on this head; please add that assert here (and in the policy-module twin) on the landing vehicle. A walk that skips every other edge after seeing a back-edge would still pass this test and break owner-chain matching.