Skip to content

Commit a798138

Browse files
authored
Apply review nitpicks from the TestFlight CI PR (#25674) (#25709)
* Trim transient RFC context from TestFlight CI comments The shell-script and pipeline.yml header comments carried "Faster Releases" rollout context that's only relevant while the project is in flight. Drop it, keep the factual one-liners, and switch the build step to the :testflight: emoji to match the matrix group. Addresses review feedback from #25674. * Drop transient RFC context from the TestFlight lane doc comment The "intentionally additive / source of truth until proven" and "wired up in later phases of the RFC" paragraphs describe the rollout state, not the lane. Keep the build-code explanation, which documents behavior that outlives the project. Addresses review feedback from #25674. * Validate BUILDKITE_BUILD_NUMBER before building the TestFlight app The env check sat after the case statement, so a missing build number only surfaced after update_certs_and_profiles_* had already run. Move the check to the top of the lane to fail before any cert/profile work. Addresses review feedback from #25674. * Tidy the internal TestFlight upload helper - Tag the placeholder "what's new" comment TODO instead of TBD, which isn't a convention anyone greps for. - Spell the changelog env fallbacks "unknown branch" / "unknown commit" so a missing value reads as such. - Manage the temp file with Dir.mktmpdir's block form, which cleans up the directory itself instead of a manual begin/ensure rm. Addresses review feedback from #25674. * Announce Reader's omission when building all apps locally The lane is named build_all_apps_for_testflight but only builds WordPress and Jetpack. Print a visible heads-up at runtime so someone running it locally isn't left wondering where the Reader build went. Addresses review feedback from #25674.
1 parent 5fbce59 commit a798138

3 files changed

Lines changed: 14 additions & 30 deletions

File tree

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash -eu
22

33
# Builds one app and uploads it to TestFlight for internal testers.
4-
#
5-
# Part of the "Faster Releases for WordPress and Jetpack" RFC. CI runs one
6-
# invocation per app (in parallel) via the matrix step in pipeline.yml.
74

85
APP="${1:?Usage: build-and-upload-testflight.sh <wordpress|jetpack|reader>}"
96

@@ -13,5 +10,5 @@ APP="${1:?Usage: build-and-upload-testflight.sh <wordpress|jetpack|reader>}"
1310
echo "--- :closed_lock_with_key: Installing Secrets"
1411
bundle exec fastlane run configure_apply
1512

16-
echo "--- :hammer_and_wrench: Building and uploading ${APP} to TestFlight"
13+
echo "--- :testflight: Building and uploading ${APP} to TestFlight"
1714
bundle exec fastlane build_and_upload_app_for_testflight app:"${APP}"

.buildkite/pipeline.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ steps:
3232
context: "Jetpack Prototype Build"
3333

3434
#################
35-
# Continuous Delivery: build & upload each app to TestFlight (internal testers)
36-
#
37-
# Part of the "Faster Releases for WordPress and Jetpack" RFC. On every trunk
38-
# commit, each app builds and uploads to TestFlight in parallel via the matrix
39-
# below. Gated to trunk so it doesn't run on PR branches.
35+
# Continuous Delivery: build & upload each app to TestFlight (internal testers) from trunk
4036
#################
4137
- group: ":testflight: TestFlight Builds"
4238
key: testflight_builds_group

fastlane/lanes/build.rb

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,22 @@
317317
# Builds a single app and uploads it to TestFlight for *internal* testers,
318318
# stamping the build code with the Buildkite build number.
319319
#
320-
# This is the per-commit "continuous delivery" build from the "Faster Releases
321-
# for WordPress and Jetpack" RFC. It is intentionally additive: the existing
322-
# release lanes are untouched and remain the source of truth until this flow
323-
# is proven.
324-
#
325320
# The marketing version (`VERSION_SHORT`) is read from `Version.public.xcconfig`
326321
# as-is. The build code is `<marketing version>.0.<buildkite build number>`
327322
# (e.g. `27.0.0.4567`). Buildkite build numbers increase monotonically, so each
328323
# build for a given marketing version gets a unique, higher build code — which
329324
# is all App Store Connect requires.
330325
#
331-
# "Internal-only" means no external groups and no external-tester notifications
332-
# (matching the existing Reader upload). Distributing to the a8c staff beta
333-
# group, and separately to the public beta group, is wired up in later phases
334-
# of the RFC.
335-
#
336326
# @param [String] app One of `wordpress`, `jetpack`, or `reader`.
337327
#
338328
# @called_by CI
339329
#
340330
desc 'Builds one app and uploads it to TestFlight for internal testers'
341331
lane :build_and_upload_app_for_testflight do |app:|
332+
# Fail before any cert/profile work if the build code can't be computed.
333+
build_number = ENV.fetch('BUILDKITE_BUILD_NUMBER', nil)
334+
UI.user_error!('BUILDKITE_BUILD_NUMBER is not set — this lane is meant to run on CI') if build_number.nil?
335+
342336
app = app.to_s.downcase
343337

344338
case app
@@ -367,9 +361,6 @@
367361
UI.user_error!("Unknown app '#{app}'. Expected one of: wordpress, jetpack, reader")
368362
end
369363

370-
build_number = ENV.fetch('BUILDKITE_BUILD_NUMBER', nil)
371-
UI.user_error!('BUILDKITE_BUILD_NUMBER is not set — this lane is meant to run on CI') if build_number.nil?
372-
373364
build_code = "#{release_version_current}.0.#{build_number}"
374365
UI.important("Building #{scheme} #{release_version_current} (#{build_code}) for internal TestFlight distribution")
375366

@@ -419,7 +410,9 @@
419410
#
420411
desc 'Builds and uploads WordPress and Jetpack to TestFlight (internal)'
421412
lane :build_all_apps_for_testflight do
422-
%w[wordpress jetpack].each do |app|
413+
apps = %w[wordpress jetpack]
414+
UI.important("Building #{apps.join(' and ')} for TestFlight. Reader is omitted because its App Store archive is currently broken.")
415+
apps.each do |app|
423416
build_and_upload_app_for_testflight(app: app)
424417
end
425418
end
@@ -542,24 +535,22 @@ def upload_build_to_testflight(ipa_path:, whats_new_path:, distribution_groups:,
542535
# @param [String] beta_app_description_path Path to the beta app description file.
543536
#
544537
def upload_app_to_testflight_internal(ipa_path:, beta_app_description_path:)
545-
# TBD (RFC D4): the "what's new" text for per-commit internal builds is not
538+
# TODO: the "what's new" text for per-commit internal builds is not
546539
# finalized yet. For now, generate a minimal placeholder from the commit
547540
# metadata so the upload has something to show. Public-beta builds will get
548541
# richer notes generated from the PRs merged since the previous public build.
549-
changelog = "Automated build from `#{ENV.fetch('BUILDKITE_BRANCH', 'unknown')}` (#{ENV.fetch('BUILDKITE_COMMIT', 'unknown')[0...7]})."
550-
whats_new_path = File.join(Dir.tmpdir, 'testflight_whats_new.txt')
542+
changelog = "Automated build from `#{ENV.fetch('BUILDKITE_BRANCH', 'unknown branch')}` (#{ENV.fetch('BUILDKITE_COMMIT', 'unknown commit')[0...7]})."
551543

552-
begin
544+
Dir.mktmpdir do |dir|
545+
whats_new_path = File.join(dir, 'testflight_whats_new.txt')
553546
File.write(whats_new_path, changelog)
554547

555548
upload_build_to_testflight(
556549
ipa_path: ipa_path,
557550
whats_new_path: whats_new_path,
558-
distribution_groups: [], # Internal-only for now (RFC D2): no external groups.
551+
distribution_groups: [],
559552
beta_app_description_path: beta_app_description_path
560553
)
561-
ensure
562-
FileUtils.rm_rf(whats_new_path)
563554
end
564555
end
565556

0 commit comments

Comments
 (0)