[BUG] install shows a traceback instead of a policy error when the org policy chain has an inheritance error
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
The traceback comes from discover_trust_policy, which does not catch the errors listed in POLICY_DISCOVERY_ERRORS (including PolicyInheritanceError) the way the audit path does. Compare the two code paths, then add the same handling so an inheritance error maps to the incomplete_chain outcome. Done when apm install prints a clear [x] message for an extends cycle instead of a traceback.
Written by the indexing model from the issue text.
Description
Summary
If the org policy chain has an inheritance error (an extends cycle, a cross-host extends, or chain depth over the limit), commands that read the trust policy during install (apm install and related trust readers that go through discover_trust_policy) fail with a Python traceback. They should report a named, routed policy error instead.
The behaviour fails closed: nothing is installed. But the user sees a stack trace rather than an [x] line that names the policy problem and how to fix it.
Expected
discover_trust_policy handles the same known discovery errors (POLICY_DISCOVERY_ERRORS, including PolicyInheritanceError) that audit uses. An inheritance error then routes as the always-block incomplete_chain outcome, with a clear [x] message.
Notes
Found while reviewing the audit policy-resolution change in #4920, which routes this case for apm audit.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 430
- Avg merge
- 19h 38m
- Merged PRs (30d)
- 637
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
-
[DOCS] Document Mode B waiver formatting/merge-queue requirements and post-approval issue editsOpenstatus/triage-pending type/docs
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
microsoft/apm#4719 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement status/accepted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/apm#4075 · 4 comments ·
Maintainers usually reply within 1 day
-
[BUG] Claude command transform drops frontmatter keys Claude Code supports on commandsPossibly taken @abhishekacharya200 claimed this 7 days ago. Openarea/multi-target status/accepted theme/portability triage/recommended type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/apm#3067 · 2 comments ·
Maintainers usually reply within 1 day
-
needs-design
Difficulty 5/5 Over a week Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
[BUG] apm approve <key> for a bundle saves the grant, then exits 1 when another trust layer still denies itPossibly taken @danielmeppiel claimed this today. Openbug status/accepted type/bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
microsoft/apm#4933 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 62/100
DaoCloud/DaoCloud-docs#7839 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
sav-oss-org/ptusa_main#1610 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sagemathinc/sagebrush#1701 ·
Maintainers usually reply within 1 day
-
reasons-gate
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
benthomasson/reasonsforge#100 ·
Maintainers usually reply within 1 day