Repository navigation
fix(install): omit author from auto-bootstrapped apm.yml - #3630
Daniel Meppiel (danielmeppiel) merged 3 commits into
Conversation
When `apm install` creates apm.yml in a directory without one (project scope, `-g`, and `-g --mcp`), it no longer stamps the local `git config user.name` as `author`. The person who first runs install is not necessarily the project's author. Explicit `apm init` keeps its current author detection. Fixes #3593 Co-authored-by: Copilot App <[email protected]>
…piel-fix-3593-omit-bootstrap-author
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the changes to omit installer Git identity from automatically created manifests.
No open issues 🎉
What changed in this PR
Addresses #3593 by preventing apm install from recording the installer's Git identity in automatically created manifests, while preserving author detection for explicit apm init commands.
Changes:
- Separates author-free bootstrap configuration from initialization defaults and makes manifest author output conditional.
- Updates package and global MCP bootstrap paths to use the author-free configuration.
- Adds regression coverage and documents the new behavior.
| File | Description |
|---|---|
tests/unit/test_install_command.py |
Adds package and global MCP bootstrap tests with a configured Git identity. |
src/apm_cli/commands/install.py |
Switches install bootstrap paths to author-free defaults. |
src/apm_cli/commands/_helpers.py |
Adds bootstrap defaults and writes author only when supplied. |
packages/apm-guide/.apm/skills/apm-usage/commands.md |
Documents author omission in the usage guide. |
docs/src/content/docs/reference/cli/install.md |
Clarifies author handling for auto-created manifests. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| DevX UX Expert | 0 | 0 | 0 | Auto-bootstrap author omission aligns with npm convention; all canonical doc surfaces updated; clean DRY refactor; no UX regressions. |
| Test Coverage Expert | 0 | 0 | 0 | All bootstrap paths have regression traps with configured git user.name; apm init author-write invariant defended by existing tests. Ship. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Recommendation
Both panelists are clean, the scope matches the accepted brief exactly, regression tests defend both bootstrap paths, and docs + CHANGELOG are updated. No follow-ups to track. Ready for the CODEOWNERS reviewer to confirm and merge at their discretion.
Full per-persona findings
DevX UX Expert
No findings.
Test Coverage Expert
No findings.
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.
|
Retriggering the CLA check (license/cla never reported at fad5e50); reopening immediately. |
Bring PR microsoft#2944 up to date with main 90e76bf. Both overlapping files merged keeping both intents: CHANGELOG.md keeps main's microsoft#3630 entry alongside this PR's microsoft#2944 entry under Unreleased/Fixed, and test_architecture_owner_rule_mutations.py keeps main's updated github_downloader intent plus this PR's user-hook-home-reference case. Co-authored-by: Copilot App <[email protected]>
Resolve conflicts with #3633 (forwarded apm install options) and #3630 (bootstrap author), keeping the APM_HOME wording. Co-authored-by: Copilot App <[email protected]>
Description
TL;DR
apm install <pkg>in a directory with noapm.ymlbootstraps a manifest — and until now stampedauthor: <git config user.name>into it. The person who first runs install in a consuming project is not necessarily its author, so the field was misleading and leaked a personal identity. Auto-bootstrapped manifests now omitauthor; explicitapm init(interactive and--yes) is unchanged.Problem (WHY)
git config user.name=Jane Example,apm install --target copilot ../demo-pkgwritesauthor: Jane Exampleinto the newapm.yml._get_default_config(), which always ran_auto_detect_author(): project-scope package install,-gpackage install, and-g --mcp(~/.apm/apm.yml).Approach (WHAT)
apm install <pkg>(noapm.yml)author: <git user.name>authorkeyapm install -g <pkg>(no~/.apm/apm.yml)author: <git user.name>authorkeyapm install -g --mcp NAME(no~/.apm/apm.yml)author: <git user.name>authorkeyapm init/apm init --yesauthor: <git user.name>Implementation (HOW)
src/apm_cli/commands/_helpers.py_get_bootstrap_config()returns name/version/description only (no git subprocess for author)._get_default_config()now builds on it and addsauthor, soapm initoutput is byte-identical._create_minimal_apm_yml()writesauthoronly when the key is present, keeping the existing field order.src/apm_cli/commands/install.py--mcp) switch to_get_bootstrap_config().tests/unit/test_install_command.pyGIT_CONFIG_GLOBALand assert noauthorreaches the manifest / MCP bootstrap config.docs/.../reference/cli/install.md,packages/apm-guide/.../commands.mdauthorfield.CHANGELOG.mdFixedentry.Diagram
Legend: the install bootstrap now uses a config builder that never consults Git identity;
apm initkeeps the author-detecting path.flowchart LR I["apm install PKG / -g --mcp<br/>(no apm.yml)"] --> B["_get_bootstrap_config()<br/>name, version, description"] N["apm init / init --yes"] --> D["_get_default_config()"] D --> B D --> A["_auto_detect_author()<br/>git config user.name"] B --> W["_create_minimal_apm_yml()<br/>writes author only if present"] D --> WTrade-offs
authoris optional; a placeholder likeDeveloperwould be equally misleading._get_bootstrap_config()makes intent explicit at call sites and skips the Git subprocess entirely, rather than threading aninclude_author=flag through_get_default_config().Benefits
apm.ymlno longer records the installer's Git identity.gitsubprocess per bootstrap.apm initoutput and its tests are unchanged (301 targeted tests pass).Issue and approved scope
Issue: Fixes #3593
Human scope-approval comment: #3593 (comment)
This PR completes the issue: auto-bootstrapped manifests contain no
author, a regression test covers a configuredgit user.name,apm initbehavior/tests are unchanged, and docs + CHANGELOG are updated. Out of scope per the record: changingapm initdefaults, new install prompts, rewriting existing manifests.Note
Local preflight skipped by maintainer instruction (2026-11-12); CI is the gate.
Type of change
Testing
Scenario evidence
apm install <pkg>with no manifest and a configured Git user createsapm.ymlwithoutauthortests/unit/test_install_command.py::TestInstallCommandAutoBootstrap::test_install_auto_created_apm_yml_omits_git_authorapm install -g --mcp NAMEwith no~/.apm/apm.ymlbootstraps withoutauthortests/unit/test_install_command.py::TestInstallMcpFlag::test_global_mcp_bootstrap_config_omits_git_authorapm initstill detectsauthorfrom Gittests/unit/test_init_command.py,tests/unit/commands/test_helpers_coverage.py(unchanged, passing)Validation output
Reproduced on HEAD before the fix (both new tests failed):
After the fix:
Mutation-break: re-adding
"author": _auto_detect_author()to_get_bootstrap_config()makes both regression tests fail (2 failed); reverting restores green.Lint: ruff check + ruff format --check on changed files pass; full CI lint mirror run before the final push (see commit).
How to test
git config --global user.name "Jane Example"(or useGIT_CONFIG_GLOBALwith a temp file).apm install --target copilot <any-package>.cat apm.yml— there is noauthor:line.apm init --yes—author: Jane Exampleis still written.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.
Co-authored-by: Copilot [email protected]