From 9ff68a469e1893430f4850a2a7c508e1df5d3255 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Dec 2025 13:36:19 +1100 Subject: [PATCH 1/7] Add Buildkite step to optionally trigger FAD build on `trunk` --- .buildkite/pipeline.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a3e9f2d9153..8770677e472 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -31,6 +31,20 @@ steps: - github_commit_status: context: Prototype Build + - group: ":rocket: Prototype Build" + if: build.branch == "trunk" + steps: + - input: Deploy Prototype Build + prompt: Share a Prototype Build via Firebase App Distribution? + key: prototype_triggered + - label: Prototype Build + depends: prototype_triggered + command: .buildkite/commands/prototype-build.sh + plugins: [$CI_TOOLKIT] + notify: + - github_commit_status: + context: Prototype Build From Trunk + ################# # Run Unit Tests ################# From b8470b673bff8441f776d3244f429ad03953b6c2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Dec 2025 13:53:41 +1100 Subject: [PATCH 2/7] Only add PR number to release notes if one is available --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b681784c356..fa7324b793c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -777,10 +777,10 @@ platform :ios do build_for_prototype_build release_notes = <<~NOTES - Pull Request: ##{pull_request_number || 'N/A'} Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}` Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]} NOTES + release_notes += "Pull Request: ##{pull_request_number}" unless pull_request_number.nil? firebase_app_distribution( app: FIREBASE_APP_ID, From 0a28f5e57d943d1c5aea663a14c68415b5a9a3af Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Dec 2025 13:57:53 +1100 Subject: [PATCH 3/7] Refactor `pull_request_number` method into a constant No need to read every time --- .buildkite/pipeline.yml | 2 +- fastlane/Fastfile | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 8770677e472..3bc2d250a4e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -38,7 +38,7 @@ steps: prompt: Share a Prototype Build via Firebase App Distribution? key: prototype_triggered - label: Prototype Build - depends: prototype_triggered + depends_on: prototype_triggered command: .buildkite/commands/prototype-build.sh plugins: [$CI_TOOLKIT] notify: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fa7324b793c..c09d3ccb3cd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -780,7 +780,7 @@ platform :ios do Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}` Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]} NOTES - release_notes += "Pull Request: ##{pull_request_number}" unless pull_request_number.nil? + release_notes += "Pull Request: ##{PULL_REQUEST_NUMBER}" unless PULL_REQUEST_NUMBER.nil? firebase_app_distribution( app: FIREBASE_APP_ID, @@ -796,13 +796,13 @@ platform :ios do dsym_path: './build/WooCommerce.app.dSYM.zip' ) - next if pull_request_number.nil? + next if PULL_REQUEST_NUMBER.nil? # PR Comment comment_body = prototype_build_details_comment(app_display_name: 'WooCommerce iOS Prototype') comment_on_pr( project: GITHUB_REPO, - pr_number: pull_request_number, + pr_number: PULL_REQUEST_NUMBER, reuse_identifier: 'prototype-build-link', body: comment_body ) @@ -812,7 +812,7 @@ platform :ios do lane :build_for_prototype_build do |fetch_code_signing: true| update_certs_and_profiles_enterprise if fetch_code_signing - pr_prefix = pull_request_number&.then { |num| "pr#{num}" } + pr_prefix = PULL_REQUEST_NUMBER&.then { |num| "pr#{num}" } commit_short_hash = ENV.fetch('BUILDKITE_COMMIT', '0')[0...7] build_number = [pr_prefix, commit_short_hash].compact.join('-') @@ -1526,11 +1526,8 @@ TEST_ANALYTICS_ENVIRONMENT = %w[ # Release Management Utils # ----------------------------------------------------------------------------------- -def pull_request_number - # Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR - pr_num = ENV.fetch('BUILDKITE_PULL_REQUEST', 'false') - pr_num == 'false' ? nil : Integer(pr_num) -end +# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR +PULL_REQUEST_NUMBER = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) } def create_backmerge_pr version = release_version_current From f5f24ebb7b5d2f98046485fed8cfd6b809ca35ee Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 5 Dec 2025 11:17:56 +1100 Subject: [PATCH 4/7] Make `input` text a question Co-authored-by: Olivier Halligon --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 3bc2d250a4e..8351872b7f4 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -34,7 +34,7 @@ steps: - group: ":rocket: Prototype Build" if: build.branch == "trunk" steps: - - input: Deploy Prototype Build + - input: Deploy Prototype Build? prompt: Share a Prototype Build via Firebase App Distribution? key: prototype_triggered - label: Prototype Build From 153f41f79498cb128e9ebdd4aa5757a3cb3cd037 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 00:30:57 +0000 Subject: [PATCH 5/7] Initial plan From 9ce0ff52e3f5e4f19c63e4db1156635a20b8c4c7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 00:32:52 +0000 Subject: [PATCH 6/7] Rename PULL_REQUEST_NUMBER to pull_request_number Co-authored-by: mokagio <1218433+mokagio@users.noreply.github.com> --- fastlane/Fastfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c09d3ccb3cd..dc1b3776920 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -780,7 +780,7 @@ platform :ios do Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}` Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]} NOTES - release_notes += "Pull Request: ##{PULL_REQUEST_NUMBER}" unless PULL_REQUEST_NUMBER.nil? + release_notes += "Pull Request: ##{pull_request_number}" unless pull_request_number.nil? firebase_app_distribution( app: FIREBASE_APP_ID, @@ -796,13 +796,13 @@ platform :ios do dsym_path: './build/WooCommerce.app.dSYM.zip' ) - next if PULL_REQUEST_NUMBER.nil? + next if pull_request_number.nil? # PR Comment comment_body = prototype_build_details_comment(app_display_name: 'WooCommerce iOS Prototype') comment_on_pr( project: GITHUB_REPO, - pr_number: PULL_REQUEST_NUMBER, + pr_number: pull_request_number, reuse_identifier: 'prototype-build-link', body: comment_body ) @@ -812,7 +812,7 @@ platform :ios do lane :build_for_prototype_build do |fetch_code_signing: true| update_certs_and_profiles_enterprise if fetch_code_signing - pr_prefix = PULL_REQUEST_NUMBER&.then { |num| "pr#{num}" } + pr_prefix = pull_request_number&.then { |num| "pr#{num}" } commit_short_hash = ENV.fetch('BUILDKITE_COMMIT', '0')[0...7] build_number = [pr_prefix, commit_short_hash].compact.join('-') @@ -1527,7 +1527,7 @@ TEST_ANALYTICS_ENVIRONMENT = %w[ # ----------------------------------------------------------------------------------- # Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR -PULL_REQUEST_NUMBER = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) } +pull_request_number = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) } def create_backmerge_pr version = release_version_current From c96ea40a98dc4d5bce465355bb7696ef1e1e60b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 00:53:20 +0000 Subject: [PATCH 7/7] Move pull_request_number to top of Fastfile Co-authored-by: mokagio <1218433+mokagio@users.noreply.github.com> --- fastlane/Fastfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index dc1b3776920..f77b4391920 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -29,6 +29,9 @@ WORKSPACE_PATH = File.join(PROJECT_ROOT_FOLDER, 'WooCommerce.xcworkspace') FIREBASE_APP_ID = '1:124902176124:ios:02259de1e7c42b291620f9' FIREBASE_TESTERS_GROUP = 'woocommerce-ios---prototype-builds' +# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR +pull_request_number = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) } + BUILDKITE_RELEASE_PIPELINE = 'release-builds.yml' IOS_LOCALES = %w[ar-SA de-DE en-US es-ES fr-FR he id it ja ko nl-NL pt-BR ru sv tr zh-Hans zh-Hant].freeze SIMULATOR_VERSION = '18.5' # For screenshots @@ -1526,9 +1529,6 @@ TEST_ANALYTICS_ENVIRONMENT = %w[ # Release Management Utils # ----------------------------------------------------------------------------------- -# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR -pull_request_number = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) } - def create_backmerge_pr version = release_version_current