Skip to content

fix(pack): warn about deprecated target keys for plugin-only packages - #3980

Closed
Daniel Meppiel (danielmeppiel) wants to merge 2 commits into
mainfrom
fix/3965-pack-deprecation-warnings
Closed

Daniel Meppiel (danielmeppiel) wants to merge 2 commits into
mainfrom
fix/3965-pack-deprecation-warnings

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

apm pack on a plugin-only package (no dependencies:) printed none of the 0.37 deprecation warnings for target:, the vscode alias, or compilation.target. Install and compile print them. Pack read the plugin-manifest targets from raw YAML through manifest_target_restriction, which bypasses the warning owner. Only the bundle path, which runs when dependencies: exists, went through APMPackage and warned.

manifest_target_restriction in models/manifest_targets.py (the target-declaration owner) now takes an optional manifest path. When the path is given, it reads through ManifestTargetDeclaration.from_manifest, which emits the warnings once per run through _warn_deprecated_manifest_keys. Both pack reads in core/build_orchestrator.py (detect_outputs and the plugin-manifest producer) pass the path. The per-process dedupe keeps a pack with dependencies: at one warning per key. Docs already say APM warns for these keys, so they need no change.

Issue and approved scope

Issue: Fixes #3965

Human scope-approval comment: #3965 (comment)

Does this PR complete the issue, or what remains? It completes the issue. Deprecation timelines are unchanged (out of scope).

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass

  • Added tests for new functionality (if applicable)

  • tests/integration/test_pack_deprecation_warning_lifecycle.py runs the real CLI apm pack on a plugin-only package with each deprecated form: target: claude,codex, targets: [vscode, codex], and compilation.target. It asserts the exact-replacement warning appears exactly once. All 3 cases fail on main and pass here.

  • .venv/bin/python -m pytest -q -n 6 tests/unit/models tests/unit/core/test_build_orchestrator.py tests/unit/test_packer.py tests/unit/integration/test_mcp_integrator*.py: 424 passed.

  • uvx [email protected] check / format --check (src, tests, architecture linter scripts): clean. pylint R0801: 10.00/10. bash scripts/lint-auth-signals.sh: clean. bash scripts/lint-architecture-boundaries.sh: rc 0.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md:
    user-visible effect first, 25 words or fewer, ending with (#PR);
    breaking changes only under upgrade notes; no Highlights; see
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…#3965)

apm pack read the plugin-manifest targets from raw YAML through
manifest_target_restriction, bypassing the deprecation warning owner, so a
package without dependencies: never saw the target:, vscode or
compilation.target warnings that install and compile print.

manifest_target_restriction now takes the manifest path and, when given,
reads through ManifestTargetDeclaration.from_manifest, which emits the
warnings once per run. Both pack reads (detect_outputs and the plugin
manifest producer) pass it.

Fixes #3965

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 19, 2026
Copilot AI balanced review requested due to automatic review settings November 19, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change restoring deprecation warnings for plugin-only apm pack packages.

No open issues 🎉

What changed in this PR

Fixes #3965 by making apm pack emit target deprecation warnings for plugin-only packages through the existing warning owner, matching install and compile behavior.

Changes:

  • Adds an optional manifest path to target restriction reads and passes it from both pack call sites.
  • Adds real-CLI regression tests for all three deprecated forms, asserting each warning appears exactly once.
  • Records the user-visible fix in the changelog.
File Description
tests/​integration/​test_pack_deprecation_warning_lifecycle.py Tests plugin-only pack warnings and generated plugin manifests.
src/​apm_cli/​models/​manifest_targets.py Routes path-aware restriction reads through the existing warning owner.
src/​apm_cli/​core/​build_orchestrator.py Supplies the manifest path at both target-reading call sites.
CHANGELOG.md Documents the restored pack deprecation warnings.

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Superseded by #3989 (the #3983 umbrella, PR B, stacked on #3988). This branch's fix and tests were harvested into #3989, which routes the change through its canonical owner with a closed-world guard. Closing in favour of #3989.

Takeshi Masukawa (takeaship) pushed a commit to takeaship/apm that referenced this pull request Nov 20, 2026
…microsoft#3965)

Harvested from microsoft#3980. Raw apm.yml readers must pass the manifest path to
manifest_target_restriction; only APMPackage-loaded configs may omit it
(closed-world guard).

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] apm pack on plugin-only packages never prints the target deprecation warnings

2 participants