microsoft / microsoft/react-native-windows

Add `--prompt` flag to scripts that can be used from CI environment and still prompt

Open
#5,611 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Test Infrastructure enhancement Workstream: Test Coverage
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Proposal: Add --prompt flag to scripts that can be used from CI environment and still prompt

Summary

In PR #5603 @asklar validly pointed out that we have a user prompt in one of our scripts that is used in our CI.
It is generally bad practice to prompt from scripts that can run unattended like this particular script.
The answer is to add a flag .
Since you use yargs, adding a boolean flag called prompt with default true would suffice. Thanks go to @NickGerleman
for his explanation in the linked PR.
When a prompt is encountered and that flag is false, the script should error out to avoid hanging.

Motivation

Make automations using the react-native-windows scripts more robust.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the react-native-windows scripts that use yargs and can prompt, then inspect how their existing arguments and prompt path are tested. Add the boolean prompt option with default true, ensure a prompt attempt errors when it is false, and verify the scripts no longer hang in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
ci-cd, cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.