compilation-target policy check ignores the plural targets: key

オープン 初心者向け
#3,732 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@MohammedAlkindi がすでに取り組んでいます。

2026年11月15日 から。

  • #3739 @MohammedAlkindi による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

src/apm_cli/policy/policy_checks.py の _check_compilation_target から始めてください。この関数はマニフェストの dict から target キーだけを読み取ります。apm install が複数形の targets: キーをどこで解決しているかを調べ、そのロジックを再利用して、チェックが両方のキーを受け入れるようにしてください。targets: [claude, cursor] を含むマニフェストが、許可リスト [claude, copilot] と enforcement block の下でチェックに失敗し、単数形の場合は従来どおり動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
4.3k
フォーク
415
平均マージ
3日 5時間
マージ済み PR(30日)
172

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/apm のほかの issue

microsoft/apm の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。