Repository navigation
fix(lifecycle): print the org deny_all lifecycle-scripts notice once per command - #4373
Merged
Daniel Meppiel (danielmeppiel) merged 5 commits intoNov 20, 2026
Merged
Conversation
…per command (#4333) update builds a lifecycle runner and its install pipeline builds another, so 'Lifecycle scripts suppressed by org policy (executables.deny_all).' printed twice. build_runner_from_context now marks the command logger once the notice is printed and skips it for later runners of the same command. The #4333 strict output cell is retired. Fixes #4333 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 15:18
# Conflicts: # tests/utils/lifecycle_evidence.py
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to deduplicate lifecycle-script suppression notices.
No open issues 🎉
What changed in this PR
Addresses #4333 by preventing repeated lifecycle-script suppression notices when an APM command builds multiple runners with the same logger. Script suppression behavior remains unchanged.
Changes:
- Tracks the last reported suppression reason on the command logger.
- Adds a regression test for two runners sharing one logger.
- Removes the known-output exception for the duplicate notice.
| File | Description |
|---|---|
tests/utils/lifecycle_evidence.py |
Removes the #4333 exception so duplicate notices fail the output check. |
tests/unit/core/test_lifecycle_scripts.py |
Verifies that runners sharing a logger emit the deny-all notice once. |
src/apm_cli/core/lifecycle_scripts.py |
Deduplicates suppression notices using logger-scoped state. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
5 of 10 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…cripts notice once per command Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-t1-deny-all-notice-once
branch
November 20, 2026 17:46
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>
5 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4333
Fixes #4399
What
Under an org policy with
executables.deny_all,apm update --yes(and an install that builds more than one lifecycle runner) printed[!] Lifecycle scripts suppressed by org policy (executables.deny_all).more than once.build_runner_from_context(core/lifecycle_scripts.py) is the only place that prints this notice. After printing, it now marks the command logger, and later runners built for the same command skip the notice. Scripts are still suppressed exactly as before; only the repeated line is gone. The #4333 strict output cell intests/utils/lifecycle_evidence.pyis removed in this PR.Validation
test_deny_all_notice_prints_once_per_command_logger: builds two runners with one logger and expects the notice once.pytest tests/unit/core/test_lifecycle_scripts.py tests/unit/install/test_lifecycle_trust_gate.py: 42 passed.tests/integration/test_lifecycle_deny_all_chain_lifecycle.pywas not run locally: this worktree's venv points at another checkout, so it is left to CI.Steward pre-approval (A-C)
tests/unit/core/test_lifecycle_scripts.py::TestBuildRunnerFromContext::test_deny_all_notice_prints_once_per_command_logger.update-deny-all-lifecycle-notice-repeats(apm update repeats the org deny_all lifecycle-scripts notice #4333), because the product fix in this PR makes the one-notice-per-command behavior required (tightens). 0 cells added; 0 obligation changes.#4399 (uninstall sibling): uninstall builds its pre/post runners with ONE command logger, so the same single-printer covers it with no extra change. Failing-before on main: test_lifecycle_deny_all_chain_lifecycle.py::test_deny_all_suppresses_every_lifecycle_tier_across_chain (I9 at the uninstall step). Passing-after on f2a9a6a: 1 passed (local, guard). No cell added.