Repository navigation
Commit a218645
committed
Merge origin/main; address Copilot review findings on PR microsoft#928
This brings the branch up to date with origin/main (which advanced
significantly: --frozen flag, local-bundle install, --refresh, --as,
--legacy-skill-paths, --all flag for compile, parse_targets_field
canonical plural support, install_started_at timing, etc.) and folds
in Copilot's automated review feedback.
Conflict resolution: kept upstream's body wholesale and re-threaded
the --root + source_root substitutions on top. install.py LOC budget
raised 2010 -> 2050 to absorb the --root option declaration, the
--root + --global UsageError, and the with-block re-indent
(re-indentation does not add lines but the option/preamble does).
Review fixes (microsoft#928 (review)):
* compile/cli.py: reject --root + --watch with UsageError -- the
watch loop uses bare-relative paths (Path(APM_DIR), AgentsCompiler("."))
and would scan the deploy root.
* root_redirect.py: thread dry_run through; refuse to mkdir the deploy
target on previews so apm install --dry-run --root DIR cannot leak
a directory creation onto disk.
* commands/install.py: logger UnboundLocalError -- already addressed
upstream (logger = None initialized before try; except handlers
guard with `if logger`). Preserved through the merge.
* template_builder.py: E305 -- two blank lines between TemplateData
dataclass and render_instructions_block (was one).
* core/scope.py: get_manifest_path USER branch delegates to
get_apm_dir(scope) / APM_YML_FILENAME so the user-scope location
cannot drift between helpers.
* tests/unit/install/test_root_redirect.py: NEW. 8 tests covering
no-op-when-None, no-op-when-empty, chdir+override on entry,
restore-on-exception, mkdir-on-write, dry-run-refuses-mkdir,
dry-run-with-existing-dir, compile-alias-identity.
* docs/src/content/docs/reference/cli-commands.md +
packages/apm-guide/.apm/skills/apm-usage/commands.md: documented
--root for both install and compile per repo doc rules; called out
--global / --watch incompatibility and --dry-run mkdir-refusal.
Verified:
* 1039 install + compilation unit tests pass (656 baseline + new
--root tests + the larger upstream surface).
* Ruff clean on every touched file (UP035 + I001 fixed during
resolution).
* End-to-end: apm install --root SCRATCH + apm compile --root SCRATCH
--target codex,opencode produces byte-identical AGENTS.md to an
in-place compile (Build ID modulo).
* CLI rejections: --root + --watch, --root + --global, and --dry-run
+ --root with missing DIR all emit a click.UsageError exit 2.610 files changed
Lines changed: 69199 additions & 9381 deletions
File tree
- .agents/skills
- apm-review-panel
- assets
- evals
- fixtures
- apm-strategy
- apm-triage-panel
- assets
- auth
- cli-logging-ux
- devx-ux
- oss-growth
- pr-description-skill
- assets
- evals
- content
- fixtures
- results
- scripts
- python-architecture
- supply-chain-security
- .apm
- agents
- instructions
- skills
- apm-review-panel
- assets
- evals
- fixtures
- pr-description-skill
- assets
- .github
- agents
- aw
- instructions
- skills/apm-review-panel
- assets
- evals
- workflows
- build
- docs
- src/content/docs
- contributing
- enterprise
- getting-started
- guides
- integrations
- introduction
- reference
- packages/apm-guide/.apm/skills/apm-usage
- scripts
- windows
- src/apm_cli
- adapters/client
- bundle
- cache
- commands
- compile
- deps
- marketplace
- compilation
- core
- deps
- install
- heals
- mcp
- phases
- integration
- marketplace
- models
- dependency
- policy
- primitives
- registry
- runtime
- security
- utils
- tests
- fixtures
- marketplace
- schemas
- integration
- fixtures
- claude_mcp_golden
- target_resolution
- s01_claude_md_only
- .apm/skills/placeholder
- s02_github_dir_only
- .apm/skills/placeholder
- .github
- s02b_copilot_instructions
- .apm/skills/placeholder
- .github
- s03_ambiguous_multi
- .apm/skills/placeholder
- .claude
- .cursor
- s04_greenfield_explicit
- .apm/skills/placeholder
- s05_apm_yml_multi
- .apm/skills/placeholder
- .github
- s05b_apm_yml_singular
- .apm/skills/placeholder
- s05c_apm_yml_both
- .apm/skills/placeholder
- s06_dry_run
- .apm/skills/placeholder
- s07_compile_all_single
- .apm
- instructions
- skills
- hello
- placeholder
- s08_targets_cmd
- .apm/skills/placeholder
- .claude
- .cursor
- s09_unknown_target
- .apm/skills/placeholder
- s10_agents_md_only
- .apm/skills/placeholder
- s11_csv_multi_target
- .apm/skills/placeholder
- s12_empty_repo
- .apm/skills/placeholder
- s13_global_copilot
- .apm/skills/placeholder
- s14_no_manifest
- s15_claude_rules_exists
- .apm/skills/placeholder
- .claude/rules
- s16a_targets_inactive
- .apm/skills/placeholder
- .claude
- s16b_provenance_cwd
- .apm/skills/placeholder
- subdir
- s17_cursorrules_file
- .apm/skills/placeholder
- s18_gemini_dir
- .apm/skills/placeholder
- .gemini
- s19_opencode_dir
- .apm/skills/placeholder
- .opencode
- s20_windsurf_dir
- .apm/skills/placeholder
- .windsurf
- s21_codex_dir
- .apm/skills/placeholder
- .codex
- s22_gemini_md_only
- .apm/skills/placeholder
- s23_error_renderer
- .apm/skills/placeholder
- s24_priority_override
- .apm/skills/placeholder
- .claude
- s25_copilot_alias
- .apm/skills/placeholder
- marketplace
- unit
- bundle
- cache
- commands
- compilation
- core
- deps
- install
- heals
- phases
- integration
- marketplace
- policy
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
0 commit comments