Skip to content

ci(ios): trust the facebook/fb tap formula required by newer Homebrew - #23640

Merged
dr1rrb merged 1 commit into
masterfrom
dev/dr/ci-brew-trust-facebook-tap
Jul 3, 2026
Merged

dr1rrb merged 1 commit into
masterfrom
dev/dr/ci-brew-trust-facebook-tap

Conversation

@dr1rrb

@dr1rrb dr1rrb commented Jul 3, 2026

Copy link
Copy Markdown
Member

GitHub Issue: no tracking issue — CI-infrastructure hotfix (all iOS UI test stages failing since the runner-image update last night).

PR Type:

  • 🏗️ Build or CI related changes

What is the current behavior? 🤔

Every iOS UI test stage fails at the idb install step since the macOS runner images picked up a newer Homebrew that gates formulas from third-party taps behind an explicit trust step:

Installing idb (fb-idb + idb-companion) pinned to Python 3.12
Error: Refusing to load formula facebook/fb/idb-companion from untrusted tap facebook/fb.
Run `brew trust --formula facebook/fb/idb-companion` or `brew trust facebook/fb` to trust it.

No repository change is involved — the tap facebook/homebrew-fb has been dormant since 2022 and its idb-companion formula pins the sha256 of the facebook/idb v1.1.8 release artifact, so the installed binary is unchanged; only the Homebrew policy on the runners moved.

What is the new behavior? 🚀

build/test-scripts/ios-uitest-run.sh trusts the required formula before installing it:

  • brew trust --formula facebook/fb/idb-companion — least privilege: only the one formula this script installs is trusted, not the whole tap;
  • falls back to brew trust facebook/fb for Homebrew versions that only support tap-level trust;
  • no-ops (|| true) on older Homebrew that has no trust command — and if trusting genuinely fails, the brew install idb-companion right after still surfaces the real error.

Also adds a header comment documenting what this script does (CI entry point running the SamplesApp UI test suites on an iOS Simulator), why it uses idb (Meta's iOS Development Bridge — xcrun simctl install was historically unreliable, see microsoft/appcenter#2389), and the supply-chain notes for the tap (sha256-pinned artifact, dormant tap, fb-idb from PyPI not version-pinned).

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

  • Single file, +36 lines, no behavioral change on runners where the older Homebrew accepts the tap as before.
  • The same script is byte-identical on release/stable/6.6, so this commit cherry-picks cleanly there — needed to unblock in-flight PRs targeting that branch (e.g. fix(devserver): bridge cross-major AssemblyRef requests in host (backport #23287 + #23308) #23638).
  • Suggested follow-up (not in this PR): version-pin pipx install fb-idb — it is currently unpinned from PyPI, the one remaining moving part in this install block.

Runner images picked up a Homebrew version that refuses formulas from
third-party taps until explicitly trusted, breaking every iOS UI test
stage overnight:

  Error: Refusing to load formula facebook/fb/idb-companion from
  untrusted tap facebook/fb.

Trust only the idb-companion formula (least privilege), with tap-level
trust as fallback and a no-op on older brews that have no trust command.
Also document what this script does and where idb comes from
(sha256-pinned facebook/idb v1.1.8 artifact; tap dormant since 2022).
Copilot AI review requested due to automatic review settings July 3, 2026 18:15
@dr1rrb
dr1rrb marked this pull request as ready for review July 3, 2026 18:15
@dr1rrb
dr1rrb enabled auto-merge July 3, 2026 18:15
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 1m 20s —— View job


Code Review

  • Gather context and read changed file
  • Review the shell script changes
  • Post inline comments
  • Post summary

Verdict: ship — clean, targeted CI hotfix with no blocking issues.

0 blocking / 0 non-blocking findings.

Cross-cutting notes:

  • brew trust fallback chain (lines 205–207): correctly ordered — formula-level trust first (least privilege), tap-level trust as fallback, then || true for older Homebrew that has no trust subcommand. Both stderr streams are suppressed intentionally; if trusting genuinely fails, the brew install idb-companion immediately after will surface the real error. The design is sound.
  • Header comment (lines 2–28): the supply-chain rationale (sha256-pinned artifact, dormant tap, Python client unpinned) is valuable and appropriately lives in the script rather than a PR description.
  • fb-idb not version-pinned (pipx install --force fb-idb, line 212): acknowledged in the header and PR description as a known follow-up. Not introduced by this PR.
  • Conventional Commits: ci(ios): is correct for this change type.
  • No test coverage needed: pure CI infrastructure script, no app behavior changed.

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 1m 3s —— View job


Review complete

  • Gather context and read changed file
  • Analyze the shell script changes
  • Post inline findings
  • Post summary

Summary

Verdict: ship — clean CI infrastructure hotfix, no blocking issues.

0 blocking / 0 warning findings.

Analysis

The change is correct and well-considered:

  • Trust-step fallback chain (brew trust --formula … || brew trust … || true) is the right shell pattern under set -euo pipefail. The explicit || true prevents the script from aborting when running on older Homebrew that has no trust subcommand, while letting brew install idb-companion immediately after surface any real failure.
  • Least-privilege: formula-level trust (--formula facebook/fb/idb-companion) is tried first; the broader tap-level trust (facebook/fb) is a fallback only for Homebrew versions that don't support the finer-grained form. This is the correct approach and is clearly explained in the inline comment.
  • Header comment: 28 lines is longer than usual for a shell script header, but CI entry points are notoriously opaque and the supply-chain rationale (sha256-pinned artifact, dormant tap, PyPI unpinning note) is exactly the kind of non-obvious context worth preserving.
  • Commit message (ci(ios): trust the facebook/fb tap formula required by newer Homebrew) follows Conventional Commits correctly.
  • Backward compatibility: zero behavioral change on runners still using older Homebrew — the || true no-op path handles that cleanly.

No issues found that warrant inline comments or require changes before merge.

Copilot AI 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.

Pull request overview

Updates the iOS UI test CI entrypoint script to handle newer Homebrew “untrusted tap” gating on macOS hosted agents so idb-companion can be installed reliably again.

Changes:

  • Added a detailed header comment documenting the script’s role and the idb supply-chain considerations.
  • Added a best-effort brew trust step (formula-level first, tap-level fallback) before installing idb-companion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@dr1rrb
dr1rrb merged commit ae4612a into master Jul 3, 2026
67 checks passed
@dr1rrb
dr1rrb deleted the dev/dr/ci-brew-trust-facebook-tap branch July 3, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants