fix(cli): skip prompt for optional App Store ID when registering iOS app#10754
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the iOS app creation flow in src/management/apps.ts to only prompt for the App Store ID if the bundle ID was not already provided in the options. The review feedback suggests simplifying the nested logical OR assignment by moving the check for options.appStoreId directly into the if condition, which aligns with the repository's style guide to reduce nesting.
| if (promptAppStoreId) { | ||
| options.appStoreId = | ||
| options.appStoreId || (await input("Please specify your iOS app App Store ID:")); | ||
| } |
There was a problem hiding this comment.
We can simplify this block by moving the check for options.appStoreId directly into the if condition. This avoids the nested logical OR assignment and makes the code cleaner and easier to read.
if (promptAppStoreId && !options.appStoreId) {
options.appStoreId = await input("Please specify your iOS app App Store ID:");
}References
- Reduce nesting as much as possible. Code should avoid unnecessarily deep nesting or long periods of nesting. (link)
2d6a8ec to
9238c90
Compare
|
@gemini-code-assist[bot] please re-review this updated pull request. |
There was a problem hiding this comment.
Code Review
This pull request removes the interactive prompt for appStoreId during iOS app creation. The reviewer points out that removing this prompt entirely deprives interactive users of any way to specify the App Store ID, since there is no update command in the CLI. The reviewer suggests conditionally prompting for appStoreId as an optional field when the interactive wizard is used.
| @@ -96,8 +96,6 @@ async function initiateIosAppCreation(options: CreateIosAppOptions): Promise<Ios | |||
| if (!options.nonInteractive) { | |||
| options.displayName = options.displayName || (await getDisplayName()); | |||
| options.bundleId = options.bundleId || (await input("Please specify your iOS app bundle ID:")); | |||
There was a problem hiding this comment.
The current implementation completely removes the prompt for appStoreId even when the user is running the full interactive registration wizard (i.e., when no options like --bundle-id are provided). Since there is no apps:update command in the CLI, this means interactive users will no longer have any way to specify the App Store ID during registration via the CLI.
To preserve the interactive wizard's ability to prompt for appStoreId while still skipping it when required options are provided, we can check if options.bundleId was initially provided. If it wasn't, we can prompt for appStoreId as an optional field.
const isInteractiveWizard = !options.bundleId;
options.bundleId = options.bundleId || (await input("Please specify your iOS app bundle ID:"));
if (isInteractiveWizard) {
options.appStoreId =
options.appStoreId || (await input("Please specify your iOS app App Store ID (optional):"));
}…app with required options
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10754 +/- ##
=======================================
Coverage ? 57.94%
=======================================
Files ? 612
Lines ? 39632
Branches ? 7993
=======================================
Hits ? 22964
Misses ? 14788
Partials ? 1880 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9238c90 to
06c2f00
Compare
|
@gemini-code-assist[bot] I've updated the PR to conditionally prompt for |
There was a problem hiding this comment.
Code Review
This pull request updates the interactive iOS app creation flow in src/management/apps.ts. It introduces a check to only prompt the user for an App Store ID if the bundle ID was not already provided in the options. There are no review comments, so I have no feedback to provide.
joehan
left a comment
There was a problem hiding this comment.
LGTM since we have that --app-store-id flag. Please just add a changelog entry for this:
- Fixed an issue where App Store ID was always prompted for even when unecessary.
…app (#10754) * fix(cli): skip prompt for optional App Store ID when registering iOS app with required options * docs: add changelog entry --------- Co-authored-by: Joe Hanley <joehanley@google.com>
…app (#10754) * fix(cli): skip prompt for optional App Store ID when registering iOS app with required options * docs: add changelog entry --------- Co-authored-by: Joe Hanley <joehanley@google.com>
Fixes #10753
Description
When registering an iOS application using the
firebase apps:create IOSCLI command, the CLI always prompts for the optional App Store ID in interactive environments, even when the required options (like--bundle-id) are provided.This PR fixes the behavior so that we do not prompt for
appStoreIdwhen required options are provided (meaning the user isn't running the full interactive registration wizard).