ROSAENG-64571 | refactor: add Prompter DI for interactive account-roles tests - #3450
ROSAENG-64571 | refactor: add Prompter DI for interactive account-roles tests#3450amandahla wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (11)
📝 WalkthroughWalkthroughThe interactive package adds injectable Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amandahla The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…es tests Co-authored-by: Cursor <cursoragent@cursor.com>
d7d2866 to
7331808
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
@amandahla: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Giving up the idea considering the bubble tea will change everything/not reusable. |
PR Summary
Add a
Prompterinterface onRuntimeso interactive account-roles flows (Polarion OCP-43071 steps 3–4) can be unit-tested without a real terminal. Production behavior unchanged viaSurveyPrompter.Detailed Description of the Issue
Interactive ROSA CLI flows call package-level
interactive.Get*helpers backed bysurvey, which blocks unit tests from asserting which questions run under which flags. ROSAENG-64571 asks for a Prompter DI pilot oncreate account-rolesso Polarion-style interactive flow checks can run in-process.Related Issues and PRs
guidelines/ARCHITECTURE.md,guidelines/refactor/pkg-architecture.md(interim Prompter note; target remainsinternal/cli/)Type of Change
Previous Behavior
create account-rolesinteractive prompts used packageinteractive.Get*directly. Classic vs hosted-cp ask/skip rules lived inline inrun. Those rules were not covered by unit tests.Behavior After This Change
RuntimecarriesPrompter(defaultSurveyPrompter).Get*helpers delegate todefaultPrompter.create account-rolesusesr.Prompter; classic/hosted-cp flow is inpromptClassicAndHostedCP.--classic/--hosted-cp).GetModeerror string (staticcheck) + matching test assertion.How to Test (Step-by-Step)
Preconditions
go.modTest Steps
go test ./pkg/interactive/ ./cmd/create/accountroles/ -count=1rosa create account-roles -iand confirm classic (default Y) then hosted-cp (default N) still appear when no flags are set;--hosted-cp/--classicstill skip the other question.Expected Results
OCP-43071 promptClassicAndHostedCP.Proof of the Fix
Breaking Changes
Breaking Change Details / Migration Plan
N/A
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make install-hookshas been run in this clone.make testpasses.make lintpasses.make rosapasses.Made with Cursor
Summary by CodeRabbit
New Features
Bug Fixes
Documentation