Skip to content

test(policy): pin the conflicting-prefix refusal and the explicit-policy bypasses - #4547

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-4284-policy-tests
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-4284-policy-tests

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Test coverage that missed the 0.37 train, cherry-picked from 28406a8:

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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 explicit hash_algorithm: sha256.
  • Tests that --no-policy and explicit --policy-source bypass ambiguous git-remote discovery.
  • Clarifies the existing changelog entry’s remedy: add an origin remote.
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

Comment thread CHANGELOG.md Outdated
- 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]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit eee35d4 into main Nov 21, 2026
42 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-4284-policy-tests branch November 21, 2026 07:21
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.

2 participants