compilation-target policy check ignores the plural targets: key
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
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
- A policy with
compilation.target.allow: [claude, copilot]andenforcement: block. - An
apm.ymlwithtargets: [claude, cursor]. apm audit --ci --policy ./apm-policy.ymlpassescompilation-targetwith "No compilation target set in manifest". Withtarget: [claude, cursor]instead, the same check fails oncursor.
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/apm
-
[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yamlPossibly taken @Parth-Vasave claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3749 · 1 comment ·
Maintainers usually reply within 1 day
-
require_pinned_constraint rejects [email protected] release tags as bare branchesPossibly taken @MohammedAlkindi claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[BUG] Shorthand like git/git or jonas/tig is rejected because rstrip(".git") strips a character setOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
type/automation type/performance
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
[BUG] apm compile reports 'Referenced file not found' for links with a #fragmentPossibly taken A pull request linked to this issue is open or already merged. Openstatus/accepted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3255 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyPossibly taken @prabhleen2317 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#4387 ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/numba-cuda-mlir#467 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackPossibly taken @HhH666-ux claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day