Skip to content

fix(cli): skip prompt for optional App Store ID when registering iOS app#10754

Merged
joehan merged 3 commits into
firebase:mainfrom
peterfriese:fix-ios-apps-create-prompt
Jul 6, 2026
Merged

fix(cli): skip prompt for optional App Store ID when registering iOS app#10754
joehan merged 3 commits into
firebase:mainfrom
peterfriese:fix-ios-apps-create-prompt

Conversation

@peterfriese

Copy link
Copy Markdown
Contributor

Fixes #10753

Description

When registering an iOS application using the firebase apps:create IOS CLI 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 appStoreId when required options are provided (meaning the user isn't running the full interactive registration wizard).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/management/apps.ts Outdated
Comment on lines +100 to +103
if (promptAppStoreId) {
options.appStoreId =
options.appStoreId || (await input("Please specify your iOS app App Store ID:"));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. Reduce nesting as much as possible. Code should avoid unnecessarily deep nesting or long periods of nesting. (link)

@peterfriese peterfriese force-pushed the fix-ios-apps-create-prompt branch from 2d6a8ec to 9238c90 Compare July 1, 2026 15:57
@peterfriese

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist[bot] please re-review this updated pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/management/apps.ts
@@ -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:"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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):"));
    }

@codecov-commenter

codecov-commenter commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@0038038). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/management/apps.ts 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@peterfriese peterfriese force-pushed the fix-ios-apps-create-prompt branch from 9238c90 to 06c2f00 Compare July 1, 2026 16:03
@peterfriese

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist[bot] I've updated the PR to conditionally prompt for appStoreId only when the interactive wizard is used (specifically if --bundle-id is omitted). I also simplified the condition block to avoid nesting as suggested. Please re-review!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 joehan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@peterfriese peterfriese requested a review from joehan July 2, 2026 17:57
@joehan joehan enabled auto-merge (squash) July 6, 2026 18:40
@joehan joehan merged commit 7f11950 into firebase:main Jul 6, 2026
49 checks passed
bkendall pushed a commit that referenced this pull request Jul 9, 2026
…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>
bkendall pushed a commit that referenced this pull request Jul 9, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: apps:create IOS prompts for optional App Store ID even when required flags are provided

4 participants