Repository navigation
[0.38] test(install): S13 asserts the bare global install contract - #4561
Merged
Daniel Meppiel (danielmeppiel) merged 2 commits intoNov 21, 2026
Merged
Conversation
A bare `apm install -g` with no user manifest exits 1, names the missing `$APM_HOME/apm.yml` and gives `apm install -g <org/repo>` as the next step, like project-scope `apm install` without `apm.yml` (S14). S13 now runs the installed CLI against that contract instead of expecting a deploy, and its strict expected failure is removed. It also checks that no user manifest, lockfile or Copilot file is written; only APM's lock files and the update-check cache may appear under the isolated HOME. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
The install reference now says, next to the project-scope sentence, that a bare `apm install -g` with no user manifest exits 1, names the missing `$APM_HOME/apm.yml` and suggests `apm install -g <org/repo>`. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
November 21, 2026 08:48
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 08:48
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
S13 can fail on Windows because its exclusions omit the update-check stamp under AppData/Local/apm/cache, even when installation correctly refuses without deploying anything.
1 open issue
What changed in this PR
This PR addresses #4544 by aligning S13 and the install reference with the existing bare global-install contract. It changes tests and documentation, not product behavior.
Changes:
- Removes S13's strict expected-failure marker and asserts exit code 1, the missing-manifest message, and the suggested next command.
- Checks that the refused install creates no manifest, lockfile, or deployment, allowing incidental APM files.
- Documents the same bare
apm install -gbehavior alongside project-scope guidance.
| File | Description |
|---|---|
tests/integration/test_target_resolution_e2e.py |
Replaces S13's success expectation with error and filesystem assertions. |
docs/src/content/docs/reference/cli/install.md |
Clarifies behavior when a bare global install has no user manifest. |
Review effort: Balanced
| for path in fakehome.rglob("*") | ||
| if path.is_file() | ||
| and path.name != ".apm-lifecycle.lock" | ||
| and path.relative_to(fakehome).parts[0] != ".cache" |
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-4544-bare-global-install
branch
November 21, 2026 08:52
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
TL;DR
S13 in
tests/integration/test_target_resolution_e2e.pywas a strict expected failure. It expectedapm install -g --target copilot, run with no user manifest, to deploy. The kept contract is the opposite: the command exits 1, names$APM_HOME/apm.yml, and givesapm install -g <org/repo>as the next step, just like project-scopeapm installwithoutapm.yml(S14). S13 now asserts that contract through the installed CLI, and the expected-failure marker is removed. The install reference states the same contract. There is no product change.What changed
S13 (test commit): runs
apm install -g --target copilotagainst the installed CLI. HOME and USERPROFILE point at an isolated fake home, andAPM_HOME,APM_TARGETandAPM_CONFIGare unset. The test asserts:No <fakehome>/.apm/apm.yml foundin the output;'apm install -g <org/repo>'next step in the output;~/.copilot;.apm-lifecycle.lockfiles and the.cache/update-check stamp.The strict
xfailis gone.Docs (last commit):
reference/cli/install.md, in the auto-bootstrap note, now states the bare-gcontract right after the project-scope sentence.Decision for Daniel (taken under rule S15, flagged to the PM)
The record's Done-when says nothing is created under the fake HOME ("no
.apm/, no copilot files"). On main, a refused bareapm install -gstill creates:~/.apm/apm_modules/(fromensure_user_dirs()in the user-scope prep);~/.apm/.apm-lifecycle.lockand~/.apm-local/.apm-lifecycle.lock(the install transaction takes its locks before the manifest check).Making "no
.apm/" literally true would mean reordering user-scope prep and lock acquisition incommands/install.py, which is a product change. This PR does not make one.The default I took is the record's intent: no user manifest, lockfile, harness or deployed file. The leftover is limited to APM's own lock files and an empty
apm_modules/, and the test names that allowance explicitly. If the empty scaffolding should go too, that is a small follow-up product change: check for the manifest beforeensure_user_dirs()and before the lifecycle lock.Issue and approved scope
Issue: Fixes #4544
Human scope-approval comment: #4544 (comment) (
scripts/governance/eligibility.cjs: record-present,contact_confirmation_needed: false).Does this PR complete the issue, or what remains? It completes it, except for the
.apm/scaffolding decision above.Controls:
apm install -g <pkg>with no user manifest creates~/.apm/apm.yml) keeps its existing coverage:tests/integration/test_global_scope_e2e.py::TestGlobalManifestPlacement::test_auto_bootstrap_creates_user_manifest.Type of change
Testing
c78f412(33 pass, 3 skipping).Local results:
uv run --extra dev pytest tests/integration/test_target_resolution_e2e.py -k "s13 or s14": 2 passed.uv run --extra dev pytest "tests/integration/test_global_scope_e2e.py::TestGlobalManifestPlacement::test_auto_bootstrap_creates_user_manifest": 1 passed.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)