Repository navigation
test(policy): pin the conflicting-prefix refusal and the explicit-policy bypasses - #4547
Merged
Daniel Meppiel (danielmeppiel) merged 2 commits intoNov 21, 2026
Merged
Conversation
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 05:29
3 of 6 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The CHANGELOG.md entry exceeds the documented 25-word limit and needs shortening while preserving the remote-selection behavior and suggested remedy.
1 open issue
What changed in this PR
Adds regression coverage for policy behavior shipped in 0.37 through #4424, completing the remaining tests from #4284 without changing production code.
Changes:
- Tests refusal of a
sha512:hash prefix paired with explicithash_algorithm: sha256. - Tests that
--no-policyand explicit--policy-sourcebypass ambiguous git-remote discovery. - Clarifies the existing changelog entry’s remedy: add an
originremote.
| File | Description |
|---|---|
| tests/integration/test_policy_remote_selection_lifecycle.py | Adds installed-CLI tests for both remote-discovery bypasses. |
| tests/integration/test_policy_hash_prefix_lifecycle.py | Adds a conflicting hash-algorithm refusal test. |
| CHANGELOG.md | Clarifies recovery from ambiguous remote selection. |
Review effort: Balanced
| - A dependency chain deeper than the transitive depth cap (50) fails the install, naming the chain, instead of dropping the dependency past the cap. (#4284) | ||
| - Registry lock replay accepts the locked archive from any registry declared in `apm.yml` when it matches `resolved_hash`; each registry's credentials go only to its own URL and a hash mismatch still fails. (#4284) | ||
| - Org policy discovery uses the single git remote when there is no `origin`, and with several remotes and no `origin` it stops and names them. (#4284) | ||
| - Org policy discovery uses the single git remote when there is no `origin`; with several remotes and no `origin` it stops, names them and says to add an `origin` remote. (#4284, #4547) |
…icy bypasses A sha512: prefix under an explicit sha256 hash_algorithm is refused (#4253); install --no-policy and policy status --policy-source still work with several remotes and no origin, since only auto-discovery reads the remote (#4279). (cherry picked from commit 28406a8) Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-4284-policy-tests
branch
from
November 21, 2026 06:52
98c9964 to
e0a93a6
Compare
…ells Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-4284-policy-tests
branch
November 21, 2026 07:21
Merged
3 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Test coverage that missed the 0.37 train, cherry-picked from 28406a8:
tests/integration/test_policy_hash_prefix_lifecycle.py: asha512:prefix under an explicithash_algorithm: sha256is refused ([BUG] policy.hash algorithm is not inferred from its sha384:/sha512: prefix #4253).tests/integration/test_policy_remote_selection_lifecycle.py: with several git remotes and noorigin,apm install --no-policyandapm policy status --policy-sourcestill work, because only auto-discovery reads the remote ([BUG] Policy discovery ignores a sole non-origin git remote and does not fail closed on several #4279).Relates to #4284
Issue and approved scope
Issue: Relates to #4284
Human scope-approval comment: private release coordination with the 0.37 steward (post-merge test-only landing ruled 05:54).
Does this PR complete the issue, or what remains? Completes the remaining test coverage for #4284; its fixes shipped in #4424.
Type of change
Testing
Rebased onto main c0c6e25 (v0.37.0); test-only, no CHANGELOG entry. Earlier run on main 52e5b69, binary driver pinned to the tree, through the host guard, no xdist:
test_policy_hash_prefix_lifecycle.py+test_policy_remote_selection_lifecycle.py: 7 passed, 0 skipped. ruff 0.15.12 and the assertion-quality check: clean.