fix(install): honor targets: (plural) without singular target: present (closes #1503)#1560
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the install targets phase where specifying only the plural targets: field in apm.yml could still result in legacy greenfield auto-detection re-injecting the copilot target into the final deployment set.
Changes:
- Read targets consistently from the parsed
APMPackagemodel (supporting bothtargetandtargets) and normalize them for v2 resolution. - Prevent legacy-only canonical targets (notably
copilot) from being merged back into the v2-resolved canonical target set. - Add regression tests covering
run()andrun_targets_phase()behavior when onlytargets:is present.
Show a summary per file
| File | Description |
|---|---|
| src/apm_cli/install/phases/targets.py | Adds helpers to read/normalize target vs targets, and adjusts legacy/v2 merge logic to avoid reintroducing canonical fallbacks. |
| tests/unit/install/phases/test_targets_phase.py | Adds regression test ensuring targets: [claude] does not deploy .github/ when target: is absent. |
| tests/unit/install/phases/test_targets_phase_v2.py | Extends v2 phase tests to cover apm_package.targets driving directory materialization without .github/. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
| # Get config target from apm.yml if available. | ||
| config_target = _package_target_value(ctx.apm_package) | ||
|
|
||
| # Resolve effective explicit target: CLI --target wins, then apm.yml | ||
| _explicit = ctx.target_override or config_target or None |
Ensure plural-target parsing errors raised from the package model stay on the targets-phase UsageError path with logger formatting and exit code 2, addressing Copilot inline review and panel follow-ups for PR #1560. Add regression traps for run() and run_targets_phase(), plus the release-note entry for issue #1503. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
APM Review Panel:
|
| PR | Head | CEO stance | Iterations | Folds | Deferrals | Copilot rounds | CI | Mergeable | Merge state | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #1560 | ad08ac3 | ship_now | 1 | 3 | 0 | 2 | green | MERGEABLE | BLOCKED | pending required review |
This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.
2 similar comments
APM Review Panel:
|
| PR | Head | CEO stance | Iterations | Folds | Deferrals | Copilot rounds | CI | Mergeable | Merge state | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #1560 | ad08ac3 | ship_now | 1 | 3 | 0 | 2 | green | MERGEABLE | BLOCKED | pending required review |
This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.
APM Review Panel:
|
| PR | Head | CEO stance | Iterations | Folds | Deferrals | Copilot rounds | CI | Mergeable | Merge state | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #1560 | ad08ac3 | ship_now | 1 | 3 | 0 | 2 | green | MERGEABLE | BLOCKED | pending required review |
This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.
Fixes #1503.\n\n## Summary\n- honors parsed apm_package.targets when target: is absent\n- prevents the legacy greenfield copilot fallback from being merged back into v2-resolved canonical targets\n- adds regression tests for install run() and run_targets_phase()\n\n## Validation\n- PYTHONPATH=src /Users/danielmeppiel/Repos/awd-cli/.venv/bin/python -m pytest tests/unit/install/phases/test_targets_phase.py tests/unit/install/phases/test_targets_phase_v2.py tests/unit/install/phases/test_read_yaml_targets_list_form.py -q\n- /Users/danielmeppiel/Repos/awd-cli/.venv/bin/ruff check src/ tests/ --quiet\n- /Users/danielmeppiel/Repos/awd-cli/.venv/bin/ruff format --check src/ tests/ --quiet