Skip to content

[BUG] apm install <path> --dry-run writes apm.yml in project scope #3836

Closed

Description

Reporting and investigating a bug need no permission. Before implementing a
substantive fix for inclusion in APM, obtain human scope approval and a review
contact on this issue. Trivial documentation corrections have standing
preapproval. See Contributing.

For vulnerabilities, use SECURITY.md
instead of a public issue. Remove credentials and other sensitive data from logs.

Describe the bug
A dry run with no apm.yml bootstraps a real apm.yml on disk at project scope (it prints [*] Created apm.yml). With -g the dry run correctly uses a temp manifest and prints Would create.

To Reproduce

  1. mkdir proj && cd proj && mkdir -p ../localpkg && printf 'name: localpkg\nversion: 1.0.0\n' > ../localpkg/apm.yml
  2. apm install ../localpkg --dry-run
  3. ls -la shows apm.yml (217 bytes, a bootstrap manifest with no dependency).

Expected behavior
--dry-run writes nothing. It prints Dry run: Would create apm.yml and plans against a temp manifest, as -g already does.

Environment (please complete the following information):

  • OS: macOS (also reasoned from code; not platform-specific)
  • Python Version: 3.12
  • APM Version: main @ 2c984f6 (after v0.36.1)
  • VSCode Version (if relevant): n/a

Logs

[*] Created apm.yml
Dry run: Would add 1 package to apm.yml

Additional context
Where: src/apm_cli/commands/install.py:1519-1539 (_create_minimal_apm_yml); src/apm_cli/install/manifest_helpers.py:55 and :91 gate the temp redirect and the message on user_scope. Suggested fix: drop the user_scope condition for dry runs.

Found by the docs corpus re-sweep (#3800): the docs now describe the intended contract (with a short note where users are hit today).

Activity

  1. added
    area/cli
    type/bug
    on Nov 18, 2026
  2. danielmeppiel commented on Nov 18, 2026

    @danielmeppiel
    CollaboratorAuthor

    Taking this for 0.37.0 as part of the docs re-sweep (#3800) code-defect batch, landing as one PR. Context, Daniel's direction for the docs report: "do not defer things nor hold things - simply fix it with the criteria of a world class documentation writer as well as the UX and Product chief", and "all those fixes must land in a single PR and in 0.37". Scope record follows.

  3. danielmeppiel commented on Nov 18, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision: approve
    Area: project
    Scope: Make apm install --dry-run write nothing in project scope: when no apm.yml exists it plans against a temporary manifest and prints Would create apm.yml, matching the -g behavior.
    Done when: apm install --dry-run in a directory without apm.yml leaves the directory unchanged and prints a would-create line; a regression test fails before the fix; CHANGELOG updated.
    Out of scope: Other dry-run output changes and non-dry-run bootstrap behavior.
    Review contact: Daniel Meppiel (@danielmeppiel)

  4. added
    status/accepted
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clistatus/acceptedtype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions