Repository navigation
fix(discover): --apply without --yes honors APM_NON_INTERACTIVE and CI - #4413
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 21, 2026
Merged
Conversation
#4411) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 16:29
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The CI unit suite fails because the existing interactive-consent tests inherit CI and APM_NON_INTERACTIVE, triggering ClickException before the mocked confirmation; both variables must be cleared in those tests.
1 open issue
What changed in this PR
Fixes #4411 by making discovery’s apply-consent gate honor non-interactive environment settings, including Windows CI consoles.
Changes:
- Reuses
is_interactive()soAPM_NON_INTERACTIVEandCIsuppress confirmation prompts. - Adds parameterized regression coverage for both environment variables.
- Documents the corrected consent behavior in the changelog.
| File | Description |
|---|---|
tests/unit/adopt/test_onboarding.py |
Adds console-stdin regression cases for non-interactive consent handling. |
src/apm_cli/commands/discover.py |
Uses the shared interactivity check before prompting. |
CHANGELOG.md |
Records the non-interactive consent fix. |
Review effort: Balanced
| from apm_cli.commands.auth import is_interactive | ||
|
|
||
| # APM_NON_INTERACTIVE and CI forbid a prompt even on a console (#4411). | ||
| if not is_interactive() or output_format != "text": |
5 of 10 tasks
…ON_INTERACTIVE (#4411) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-discover-non-interactive
branch
November 21, 2026 05:24
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.

Description
apm init --apply/apm discover --applywithout--yesdecided whether to prompt fromsys.stdin.isatty()alone. On a Windows CI runner stdin is a console. So withAPM_NON_INTERACTIVE=1orCIset, the command still asked "Add the listed dependencies ...? [y/N]", read end-of-file, and exited 1 with "Aborted!" instead of the consent error. Found by the Windows lifecycle journeys (J15 step 4).src/apm_cli/commands/discover.py: the consent gate uses the existingapm_cli.commands.auth.is_interactive(), which returns False whenAPM_NON_INTERACTIVEorCIis set and otherwise checks stdin. This matches the other prompts (install/phases/integrate.py,security/executables.py).tests/unit/adopt/test_onboarding.py:test_apply_without_consent_never_prompts_when_non_interactive[APM_NON_INTERACTIVE|CI]makes the runner's stdin report a console and asserts the consent error with no[y/N]prompt. Both cases fail without the fix.Issue and approved scope
Issue: Fixes #4411
Human scope-approval comment: the 0.37 steward ruling relayed by the Stream T lead (Windows journeys: a prompt in CI hangs pipelines; fix in 0.37).
Does this PR complete the issue, or what remains? It completes it.
Type of change
Testing
Results:
pytest tests/unit/adopt/test_onboarding.py tests/unit/test_init_command.py: 136 passed.Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)