Repository navigation
test(trust): make native plugin pin mode-change checks POSIX-only - #3987
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit intoNov 19, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
Daniel Meppiel (danielmeppiel) merged 1 commit into
Conversation
Windows has no POSIX exec bit, so chmod cannot change what the native plugin pin hashes, and the two #3918 tests that re-gated a pin through chmod failed on the Windows unit lane. The mode-change case is skipped on Windows, and the normalization-output test re-gates through a publisher byte change instead. Fixes #3985 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 19, 2026 19:31
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for this test-only repair to make native-plugin pin checks platform-independent.
No open issues 🎉
What changed in this PR
This test-only repair addresses #3985 by making native-plugin pin checks respect Windows file-mode behavior without changing production trust logic.
Changes:
- Skip the executable-mode mutation case on Windows while retaining it on POSIX.
- Use a publisher-file byte change to verify re-gating after APM normalization on all platforms.
| File | Description |
|---|---|
tests/unit/security/test_trust_admission.py |
Guards the POSIX-only mode assertion and makes the normalization regression check platform-independent. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-fix-3918-windows-native-pin
branch
November 19, 2026 19:40
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
Red-main repair. After #3918 (ee00d6a), the Windows unit tests fail (run 44596680888). Two tests in
tests/unit/security/test_trust_admission.pyre-gate a native plugin pin withPath.chmod(0o755)and expect(False, 'definition-changed'), but get(True, None):test_native_plugin_seam_parks_on_any_byte_or_mode_change[mode-change]test_native_plugin_pin_ignores_apm_normalization_outputWindows has no POSIX exec bit, so the chmod changes nothing the pin hashes. This is a test artifact, not a security gap: on Windows no change was made, so admitting the plugin is correct. Every byte change is still detected on Windows, and the other byte-change cases in the same test run there.
Changes (test-only):
mode-changeparameter is skipped on Windows, following the repo conventionos.name == "nt", "POSIX file modes are not enforced on Windows". POSIX still asserts that a mode change re-gates..apm/copies.Issue and approved scope
Issue: Fixes #3985
Human scope-approval comment: #3985 (comment)
Does this PR complete the issue, or what remains? It completes the issue. Whether the exec bit should be part of a pin committed to
apm.ymlacross operating systems is a separate decision, raised with the maintainer.Type of change
Testing
These checks emulate Windows chmod semantics by turning
Path.chmodinto a no-op, because Windows unit tests run only on main pushes:pytest -k "mode_change or normalization_output"->2 failed, bothassert (True, None) == (False, 'definition-changed'). This is the exact Windows failure.pytest tests/unit/security/test_trust_admission.py -k "not mode-change"->56 passed, 1 deselected..venv/bin/python -m pytest tests/unit/security/test_trust_admission.py -p no:xdist -q->57 passed.uvx [email protected] checkandformat --checkare clean.Changelog
## [Unreleased]inCHANGELOG.md: user-visibleeffect first, 25 words or fewer, ending with
(#PR); see.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.