Skip to content

fix(tests): restore arm64 integration lanes for 0.36.0 - #3766

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-fix-release-gate-lanes-2
Nov 17, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-fix-release-gate-lanes-2

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Gate run 44090072790 on main e9860ee169, which includes #3723, turned Windows, macOS x86_64 and both Linux Build & Test lanes green. Integration Tests on Linux arm64 still failed 27 tests. macOS arm64 failed 19 of the same tests and no others. The tests broke because of PRs that landed after the previous gate (#3672, #3709, #3716). PR CI never runs this full integration corpus. 18 failures reproduced locally; 9 failed only on Linux (case-sensitive file system, 80-column wrapping, network).

Product regression (fixed in src/)

Test Root cause Fix
test_case_insensitive_parent_identity_lifecycle.py::test_mixed_case_parent_records_canonical_parent_identity (Linux only) On a case-sensitive file system, a stale apm_modules/Test/C next to apm_modules/test/e made every repeat install fail with "Found multiple package directories". Switching the declared casing then failed with a false "Package directory casing collides". models/dependency/materialization.py: only two complete paths for the same package count as a collision. Relocation moves the package into an existing owner directory that differs only in case. A real duplicate at the package path still fails. New unit regression test in tests/unit/models/test_dependency_materialization.py, which fails without the fix. Refs #3698.

Stale tests (behavior changed on purpose; updated)

Test(s) Changed by Update
Hook sync test_removes_managed_hook_json (x2), test_removes_tracked_hook_files #3672 (#3663) Stale-file removal now requires a recorded content hash. The tests pass compute_deployed_hashes(...) and still assert removal.
test_mcp_integrator_characterisation.py::TestRemoveStale (x2) #3672 (#3664) Runtime-scoped cleanup no longer needs the marker directory; cleanup across all runtimes still does. The tests assert both.
test_deps_models_validation.py local dep #3672 (#3667) Audit replays the install image under apm_modules/, and the fixture now includes an apm.yml.
test_skill_materialization_receipt_lifecycle.py frozen cases (x2) #3672 (#3654, breaking) --frozen exits 1 on an edited skill. The tests still assert the edit and the receipt are kept.
test_coverage_phase4.py marketplace set #3672 (#3670) The old patch never took effect. The test now mocks the remote ref listing, because an unverifiable ref is now an error.
test_architecture_semantic_rule_mutations.py (x4) #3672 (#3659) Moved the guarded rule to the owner matrix and added a test for its packed-source half. Re-anchored the audit.py mutation.
test_wave4_pure_logic_coverage.py::TestUnpackBundle (x3) #3716 unpack writes only under managed integration directories, so the fixtures now live under .github/prompts/.
test_artifactory_install_e2e.py redirect #3716 Uses the real RegistryConfig.headers_for(). Still proves the token is not sent cross-host and .netrc is not used.
test_gitlab_install_e2e.py #3716 The stub accepts allow_netrc. The test asserts token-bearing fetches pass allow_netrc=False.
test_user_authored_name_collision_lifecycle.py (Linux only) #3709 (#3679, #3684) Checks the real file system's case sensitivity and asserts the correct contract for each case. User files are never claimed.
test_install_conflicted_lockfile_e2e.py (x6, Linux only) #3709 (#3695) Rich wrapped the long CI tmp path, splitting the lockfile name. The test compares the full path with whitespace removed, as its sibling tests in the file already do.
test_plugin_e2e.py sequential install (network) #3709 (#3699) A package and its own subdirectory package can no longer both be declared. The test asserts that clear error and that the lockfile is unchanged. A second, independent skill exercises the sequential install.

No CHANGELOG entry, because these are regressions in the unreleased cycle (per the release captain).

Issue and approved scope

Issue: Refs #3649. Also refs #3698, #3663, #3664, #3667, #3654, #3670, #3659, #3679, #3684, #3695 and #3699, the issues behind each change.

Human scope-approval comment: commissioned by the 0.36.0 coordinator as a release-blocking repair of the tag-gate lanes. Each change stays within the approved scope of the PR that broke it. Admin merge is coordinated with the release captain.

What remains: re-dispatch manual-build-release after merge and repeat until it is green, then the captain tags v0.36.0.

Type of change

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

Testing

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

On macOS arm64 with APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm -p no:xdist -m "not live":

  • Every file with a failing test, plus test_architecture_owner_rule_mutations.py (the full module), test_local_shared_root_skill_cleanup.py and tests/unit/models/test_dependency_materialization.py: 1769 passed, 12 skipped in a clean run. On unmodified main, 18 of the 27 failures reproduced.
  • Linux-only failures: reproduced on a case-sensitive APFS volume (case tests) and with a 120-character --basetemp (wrapping); both pass after the fix. test_plugin_e2e was run with a token (not skipped): passed.
  • The 51 unit files that cover materialization: 1855 passed, 2 skipped.
  • Lint contract: ruff check and format --check (0.15.12), pylint R0801, lint-auth-signals.sh and the architecture-boundaries lint all pass. ASCII-only and file-length guards pass.
  • Known cosmetic leftover: after a casing switch, an empty old owner directory (for example apm_modules/Test/) remains. Prune, deps list and audit all ignore it.

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Gate run 44090072790 (main e9860ee) failed 27 Linux arm64 integration
tests (19 also on macOS arm64), introduced by PRs that landed after the
previous gate. PR CI never runs this corpus.

Product regression, fixed:
- On case-sensitive file systems a stale apm_modules/Test/C beside
  apm_modules/test/e made every repeat install fail ("Found multiple
  package directories"), and switching the declared casing failed with a
  false casing collision. Materialization now treats only two complete
  paths for one package as a collision and relocates into an existing
  case-variant owner directory (Refs #3698).

Stale tests, updated to intentional behaviour changes:
- #3672 (Refs #3649): stale-file removal needs a recorded hash (#3663);
  runtime-scoped MCP cleanup without marker dir (#3664); audit replays
  the install image (#3667); --frozen fails closed on edited skills
  (#3654); unverifiable marketplace ref is an error (#3670); architecture
  owner/semantic mutation matrix and audit.py re-anchor (#3659).
- #3716 (Refs #3649): unpack writes only under managed integration dirs;
  registry token via headers_for(); raw-file fetch passes allow_netrc.
- #3709: case-only user-file collisions branch on the actual file system
  (#3679, #3684); conflicted-lockfile path survives rich 80-col wrapping
  (#3695); a package and its own subdirectory package cannot both be
  declared (#3699).

apm-spec-waiver: restores pre-existing install behaviour on case-sensitive file systems; no OpenAPM-observable change

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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

Case-normalization migration leaves empty source directories that later cause root dependency lookup to fail with “Found multiple package directories,” requiring rollback-safe pruning and a regression test.

1 open issue
What changed in this PR

This PR targets the remaining Linux and macOS arm64 integration failures for 0.36.0, following #3723. It fixes package-directory casing migration and updates stale tests to match behavior introduced by recent regression fixes and security hardening.

Changes:

  • Allow distinct packages under case-variant owner directories and add regression coverage.
  • Update lifecycle fixtures and assertions for cleanup, frozen installs, bundles, and package collisions.
  • Repair credential-handling mocks, ref-resolution mocks, and architecture mutation checks.
File Description
tests/​unit/​models/​test_dependency_materialization.py Covers packages sharing case-variant owner directories.
tests/​integration/​test_wave6_integrators_coverage.py Supplies recorded hashes for hook cleanup.
tests/​integration/​test_wave4_pure_logic_coverage.py Uses managed unpack destinations and verifies deployed content.
tests/​integration/​test_user_authored_name_collision_lifecycle.py Adapts collision assertions to filesystem case sensitivity.
tests/​integration/​test_skill_materialization_receipt_lifecycle.py Expects frozen installs to reject edited deployed skills.
tests/​integration/​test_plugin_e2e.py Tests nested-package rejection and independent sequential installs.
tests/​integration/​test_mcp_integrator_characterisation.py Distinguishes runtime-scoped cleanup from broadcast cleanup.
tests/​integration/​test_integrators_hooks_phase3c.py Adds hash evidence to managed-hook removal.
tests/​integration/​test_integrators_hooks_execution.py Adds hash evidence to managed-hook removal.
tests/​integration/​test_install_conflicted_lockfile_e2e.py Makes path assertions resilient to terminal wrapping.
tests/​integration/​test_gitlab_install_e2e.py Updates the HTTP stub and checks netrc suppression.
tests/​integration/​test_deps_models_validation.py Verifies audit replays the materialized local package.
tests/​integration/​test_coverage_phase4.py Mocks remote refs and verifies the resolved commit.
tests/​integration/​test_artifactory_install_e2e.py Uses real registry credential scoping in redirect coverage.
tests/​integration/​test_architecture_semantic_rule_mutations.py Re-anchors audit mutation and removes the moved source-parsing case.
tests/​integration/​test_architecture_owner_rule_mutations.py Adds packed-source parsing guard coverage.
src/​apm_cli/​models/​dependency/​materialization.py Checks complete package paths and relocates across case-variant parents.

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Brings the arm64 lanes of the release gate back to green for v0.36.0. It fixes one real casing-collision regression and updates 26 tests to match deliberate earlier changes.

panel-mode=lean; personas=python-architect,test-coverage-expert,apm-ceo

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

Both panelists judge the PR safe, and neither weakened guard nor required change came up. The python-architect confirmed the case-variant relocation in materialization.py is sound. It never merges two different packages, it stays inside apm_modules/, the rollback journal records full paths, and match_complete_path=True relaxes no guard. The test-coverage-expert confirmed that all 26 test updates keep or strengthen their assertions, including the security-sensitive ones (Artifactory cross-host token, GitLab allow_netrc, unpack destinations, the MCP marker-directory guard, frozen user-edit protection, user-file collisions). It also confirmed the new materialization unit test fails without the fix.

The one notable gap is coverage at the lifecycle tier: no install-update-uninstall test runs two distinct packages under owner directories that differ only in case on a case-sensitive file system. This is the last change holding the v0.36.0 tag, so that test and the cleanup of empty owner directories are tracked in #3770 rather than here.

Aligned with: Multi-harness / multi-host: the Linux arm64 lanes are green again. Portable by manifest: materialization now behaves the same on case-sensitive and case-insensitive file systems.

Panel summary

Persona B R N Takeaway
Python Architect 0 1 0 Relocation is semantically safe, rollback stays correct, and no guard is weakened. Empty owner directories should be cleaned up.
Test Coverage Expert 0 1 0 No protective test was weakened, and the unit test fails without the fix. No lifecycle test covers owner directories that differ only in case.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 2 follow-ups

  1. [Test Coverage Expert] Add a lifecycle test for owner directories that differ only in case on a case-sensitive file system ([FEATURE] Prune empty case-variant owner dirs after relocation; lifecycle test for case-variant owners #3770). -- It would pin the behavior of this code path, which writes durable state, before materialization is refactored again.
  2. [Python Architect] Remove empty owner directories after a cross-parent relocation ([FEATURE] Prune empty case-variant owner dirs after relocation; lifecycle test for case-variant owners #3770). -- _remove_empty_parents currently runs only on rollback.

Recommendation

Ship now to unblock the v0.36.0 tag. The fix is correct and unit-tested, and the test updates follow from changes already merged. #3770 tracks the follow-ups.


Full per-persona findings

Python Architect

  • [recommended] After a package moves to a different parent directory, the old, now-empty owner directory is never removed. At src/apm_cli/models/dependency/materialization.py:420.
    When the source and target parents differ, the original owner directory (for example Test/) is left empty. _remove_empty_parents already exists but runs only on rollback. Nothing behaves incorrectly today, but these directories accumulate.

Test Coverage Expert

  • [recommended] The case-variant owner fix has a unit test but no lifecycle test. At tests/unit/models/test_dependency_materialization.py.
    This path writes durable state, and the unit test fails without the fix. What is missing is an install-update-uninstall test with two distinct packages under owner directories that differ only in case.
    Proof (missing at): tests/integration/test_case_insensitive_parent_identity_lifecycle.py

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.


Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.

…ation

Moving Test/C/packages/a beside test/c/packages/b on a case-sensitive
file system left an empty Test/C tree that a later root dependency
test/c counted as a second package directory. relocate_path now
removes emptied source ancestors below apm_modules; rollback already
recreates them via source.parent.mkdir(parents=True).

apm-spec-waiver: restores pre-existing install behaviour on case-sensitive file systems; no OpenAPM-observable change

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 74e5d22 into main Nov 17, 2026
24 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-release-gate-lanes-2 branch November 17, 2026 15:36
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 17, 2026
…#3787)

CaseSensitiveMaterializationReader.samefile compared Path objects. On
Windows, WindowsPath equality is case-insensitive, so the fake reported
apm_modules/Test and apm_modules/test as the same directory and the
#3766 regression test recorded an extra owner rename (push run
44116362481, Windows x86_64). Compare .parts, which is case-sensitive on
every platform, matching the case-sensitive file system the fake models.
The product reader uses os.path.samefile and is unaffected.

Mark the test windows_compat so the PR-time Windows gate runs it.

Refs #3698

Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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