Skip to content

feat(cli): offer to install fastlane with Homebrew for the fastlane APNs key setup - #1998

Merged
ArnabChatterjee20k merged 4 commits into
messaging-provider-cli-apnsfrom
messaging-provider-cli-apns-fastlane-install
Oct 9, 2026
Merged

ArnabChatterjee20k merged 4 commits into
messaging-provider-cli-apnsfrom
messaging-provider-cli-apns-fastlane-install

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown
Member

Stacked on #1963. When fastlane is missing, --provider fastlane now offers to install it with Homebrew, and otherwise explains how to install or upgrade it.

What

Before, the fastlane APNs key setup stopped with "needs fastlane 2.225.0 or later installed" and nothing more. Now:

Situation What happens
fastlane missing, Homebrew available, terminal Asks "fastlane is not installed. Install it with Homebrew now?". On yes, runs brew install fastlane on the terminal and continues with the key setup.
fastlane missing, and no Homebrew, a "No", or no terminal Stops before contacting Apple: "fastlane is not installed. Install it with brew install fastlane (Homebrew) or gem install fastlane, or add gem "fastlane" to your project's Gemfile and run bundle install. Or use --provider appwrite, which needs nothing installed"
fastlane older than 2.225.0 Stops with the matching upgrade command: bundle update fastlane in <folder> for a project's Bundler fastlane, otherwise brew upgrade fastlane, or gem update fastlane
Project Gemfile pins fastlane Unchanged: uses bundle exec fastlane, and never installs a different one
An explicit fastlane command set on the adapter Never replaced by an install
$ appwrite init apns --create-key --provider fastlane
? fastlane is not installed. Install it with Homebrew now?
> Yes, run brew install fastlane
  No
Running brew install fastlane ...

Why only Homebrew

Homebrew's fastlane brings its own Ruby and installs in one step on macOS (and Linux with Homebrew). gem install fastlane needs a working Ruby, and some of its about 70 dependencies need a C compiler. The macOS system Ruby is old and needs sudo to install gems. So gem and Bundler stay instructions rather than something the CLI runs. Installing changes the system, so the CLI always asks first. The answer "No", or no terminal, means no install.

Tests

  • TestCreateKeyInstallsFastlaneWithHomebrew: with only a stand-in brew on PATH, answering yes runs brew install fastlane once, logs it, and the key is created with the fastlane it installed.
  • TestCreateKeyDoesNotInstallFastlaneWhenDeclined: answering no never runs brew, and the error has the install instructions.
  • TestCreateKeyExplainsHowToInstallFastlane: without fastlane or Homebrew, apns.ErrUnavailable names brew, gem, the Gemfile and --provider appwrite.
  • TestOldFastlaneSaysHowToUpgrade: the upgrade command is in the too-old message.
  • The existing fastlane tests are unchanged. The full CLI suite (-race), gofmt, the WebAssembly browser build, GOOS=windows go vet for the apns packages and the Generation suite pass.

The fastlane APNs key setup stopped with a bare 'needs fastlane' when
none was installed. When Homebrew is available it now asks to run brew
install fastlane on the terminal and carries on. Without Homebrew, a
terminal or a yes, it says how to install fastlane (Homebrew, gem or the
project's Gemfile) or to use --provider appwrite. An installed fastlane
older than 2.225.0 now gets the matching upgrade command: bundle update
fastlane for a project's Bundler fastlane, otherwise brew upgrade or gem
update. A project's pinned fastlane and an explicit command are never
replaced by an install.
@hansi-codes

hansi-codes Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The fastlane APNs setup offers an opt-in Homebrew installation when fastlane is missing and provides installation or upgrade guidance when setup cannot proceed. It preserves project Gemfile/Bundler selection and explicitly configured fastlane commands, and quotes project paths in the Bundler upgrade hint. Tests cover installation behavior, guidance, and quoted shell paths.

Latest changes: The newest commit adds shell quoting for the Bundler upgrade path and tests quoting behavior, including a POSIX shell check for paths containing spaces and quotes.

Verdict New comments Fixed Still open
🛑 Changes requested 0 1 0
📂 Walkthrough · 2
File Change
templates/cli/internal/apns/fastlane/adapter.go Adds the opt-in Homebrew install flow, install/upgrade guidance, configured-command protection, and quoted Bundler upgrade paths.
templates/cli/internal/apns/fastlane/adapter_test.go Covers installation and decline behavior, setup guidance, configured commands, upgrade hints, and shell quoting.
✅ Fixed since the last review · 1
  • Quote the project path in the Bundler upgrade command · templates/cli/internal/apns/fastlane/adapter.go:288

Reviewed the commits since f0455a1 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

Comment thread templates/cli/internal/apns/fastlane/adapter.go Outdated
Comment thread templates/cli/internal/apns/fastlane/adapter.go Outdated
…er hint

A fastlane command set on the adapter was offered a Homebrew install
when it was missing, which could replace a deliberate choice; the offer
is now only for fastlane from PATH. The too-old message for a project's
Bundler fastlane said 'bundle update fastlane in <folder>', which Bundler
reads as gem names; it now says 'cd <folder> && bundle update fastlane'.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

Comment thread templates/cli/internal/apns/fastlane/adapter.go Outdated
cd <folder> && bundle update fastlane broke for folders with spaces: the
shell split the path. The folder is now quoted for the shell people
paste into, single quotes on Unix (with a single quote in the name
escaped) and double quotes on Windows, and left as is when it has only
safe characters.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Tier B · 1 blocking finding to address. Summary

Comment thread templates/cli/internal/apns/fastlane/adapter.go Outdated
Double quotes are not safe on Windows: PowerShell expands $name and $()
inside them, so a folder name could change the pasted command or run an
expression, cmd expands %, and Windows PowerShell has no &&. No single
quoting works in every Windows shell, so the Bundler upgrade hint there
names the folder to run bundle update fastlane from. Unix keeps the
single-quoted cd command.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ArnabChatterjee20k
ArnabChatterjee20k merged commit 89ea7ee into messaging-provider-cli-apns Oct 9, 2026
54 of 61 checks passed
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.

1 participant