Skip to content

Simplify installer Yes/No prompt handling - #1255

Open
sylvesterkaczmarek wants to merge 1 commit into
cisagov:contributor-prsfrom
sylvesterkaczmarek:fix/765-refactor-yesno-20261016
Open

sylvesterkaczmarek wants to merge 1 commit into
cisagov:contributor-prsfrom
sylvesterkaczmarek:fix/765-refactor-yesno-20261016

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Maintenance update on 6 November 2026

Refreshed onto contributor-prs at 7046399b after the integration branch history changed. This PR now contains its 2-file topic change in one commit.

python -m pytest -q shared/tests/test_malcolm_yes_or_no.py: 28 passed. Python compilation passes; the pre-existing unrelated Ruff self.run_process finding is unchanged. Git whitespace checks pass.

No interactive installer deployment was run.

Earlier validation counts below record the original branch state. ChatGPT assisted with this refresh, corrections and validation.


Summary

Refs #765.

Reduce cyclomatic complexity in the installer's YesOrNo prompt routine without changing its public API or prompt behaviour. Radon grade: E (39) → B (6).

  • Separate dialog button mapping, terminal prompt formatting, terminal response validation, non-interactive default handling and result conversion.
  • Preserve Yes/No button ordering (including custom labels and extra/back), capitalization of default prompts, retry on invalid responses, optional screen clearing and default acceptance.
  • Add 28 tests using the real module with mocked input/dialog functions.

Validation

  • python -m pytest -q shared/tests/test_malcolm_yes_or_no.py: 28 passed.
  • python -m pytest -q shared/tests: 659 passed, 6 skipped, 31 subtests passed.
  • Python compilation, targeted Ruff tests, Black on new tests, git diff --check: passed.

Tested offline; no live installer/dialog interaction or production deployment.

Scope

Targets contributor-prs. Only the #765 YesOrNo item is addressed; the broader complexity review remains open.

@mmguero mmguero added the install.py Relating to the install.py configuration script label Oct 19, 2026
@mmguero mmguero added this to Malcolm Oct 19, 2026
@mmguero mmguero moved this to Review in Malcolm Oct 19, 2026
Refresh the focused change onto contributor-prs at 7046399.

`python -m pytest -q shared/tests/test_malcolm_yes_or_no.py`: **28 passed**. Python compilation passes; the pre-existing unrelated Ruff `self.run_process` finding is unchanged.

No interactive installer deployment was run.
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix/765-refactor-yesno-20261016 branch from 0fc55d4 to 37de6a0 Compare November 6, 2026 07:49
@mmguero mmguero added this to the z.staging milestone Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install.py Relating to the install.py configuration script

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants