[BUG] apm approve <key> for a bundle saves the grant, then exits 1 when another trust layer still denies it

オープン
#4,933 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

2026年11月23日 から。

  • #4934 @danielmeppiel による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
cli, security

調査の方向性

Start in src/apm_cli/commands/approve.py, the bundle-only path where the grant is written before the remaining denial from another trust layer is reported. Use the ordering fix in PR #4928 (refuse before writing apm.yml) as the pattern to follow, and check which approval state is saved before the exit. Done when a bundle-only approve that is still denied exits 1 with the same message and leaves the approvals and apm.yml bytes unchanged, shown by a test that fails before the change.

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

説明

bug status/accepted type/bug

Summary

apm approve <key> for a local bundle saves the approval and only then exits 1 with "still denied by another trust layer". A failed command changes durable state, which breaks invariant I7 (a failed command changes nothing).

Details

#4923 (PR #4928) makes apm approve refuse an org-denied package before writing apm.yml. The bundle-only path in src/apm_cli/commands/approve.py has the same ordering problem: it records the grant, then reports the remaining denial from another trust layer.

Expected

When another trust layer will still deny the item, apm approve <key> refuses before any write: exit 1, the same message, and approvals and apm.yml bytes unchanged.

Acceptance

A failing-before cell: a bundle-only approve that is still denied by another layer exits 1 and leaves the approvals and apm.yml bytes unchanged.

Source: out-of-scope finding while fixing #4923 (PR #4928).

主要言語
Python
スター
4.4k
フォーク
430
平均マージ
19時間 38分
マージ済み PR(30日)
637

環境構築

はじめの一歩

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

microsoft/apm のほかの issue

microsoft/apm の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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