compilation-target policy check ignores the plural targets: key

Open Beginner friendly
#3,732 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@MohammedAlkindi is already working on this.

Since Nov 15, 2026.

  • #3739 by @MohammedAlkindi — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start with _check_compilation_target in src/apm_cli/policy/policy_checks.py, which reads only the target key from the manifest dict. Find where apm install resolves the plural targets: key and reuse that logic so the check accepts either key. Done when a manifest with targets: [claude, cursor] fails the check under an allow list of [claude, copilot] with enforcement block, and the singular form behaves as before.

Written by the indexing model from the issue text.

Description

Description

The compilation-target policy check reads only the singular target: key from apm.yml. A manifest that declares its targets with the plural targets: key, which apm install honours ("Targets: claude, copilot (source: apm.yml)"), is reported as "No compilation target set in manifest" and passes, whatever targets it lists. So compilation.target.allow and compilation.target.enforce don't apply to those projects.

Version

APM 0.35.0 and 0.35.1. main has the same code.

Cause

_check_compilation_target in src/apm_cli/policy/policy_checks.py takes (raw_yml or {}).get("target") and returns a pass when it's empty.

Reproduction

  1. A policy with compilation.target.allow: [claude, copilot] and enforcement: block.
  2. An apm.yml with targets: [claude, cursor].
  3. apm audit --ci --policy ./apm-policy.yml passes compilation-target with "No compilation target set in manifest". With target: [claude, cursor] instead, the same check fails on cursor.

Expected

The check reads whichever of target and targets the manifest uses, the same way install resolves the targets.

Dominant language
Python
Stars
4.3k
Forks
415
Avg merge
3d 5h
Merged PRs (30d)
172

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/apm

All issues in microsoft/apm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.