diff --git a/.circleci/default_config.yml b/.circleci/default_config.yml index 9ca895ca46..4cb701d3cc 100644 --- a/.circleci/default_config.yml +++ b/.circleci/default_config.yml @@ -1999,7 +1999,7 @@ jobs: command: bundle exec fastlane build_paywalls_tester_for_emerge - slack-notify-on-fail - emerge_binary_size_analysis: + binary_size_analysis: executor: name: macos-executor steps: @@ -2017,8 +2017,8 @@ jobs: - tuist-generate-workspace: query: "BinarySizeTest" - run: - name: Build BinarySizeTest (LOCAL_SOURCE) and upload to Emerge - command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:LOCAL_SOURCE + name: Build and upload BinarySizeTest (LOCAL_SOURCE) + command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:LOCAL_SOURCE # CocoaPods - run: @@ -2029,8 +2029,8 @@ jobs: - tuist-generate-workspace: query: "BinarySizeTest" - run: - name: Build BinarySizeTest (COCOAPODS) and upload to Emerge - command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:COCOAPODS + name: Build and upload BinarySizeTest (COCOAPODS) + command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:COCOAPODS # SPM - run: @@ -2040,8 +2040,8 @@ jobs: - tuist-generate-workspace: query: "BinarySizeTest" - run: - name: Build BinarySizeTest (SPM) and upload to Emerge - command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:SPM + name: Build and upload BinarySizeTest (SPM) + command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:SPM record-and-upload-paywalls-v2-snapshots: description: "Record paywall template screenshots and distribute them to the paywall-rendering-validation repository and/or Emerge" @@ -2317,30 +2317,18 @@ workflows: # # Boolean parameters like generate_snapshots, generate_revenuecatui_snapshots, # and generate_swiftinterface can be set to true from the CircleCI UI. - run-all-tests: + binary-size-analysis-test: when: - and: - - not: - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - - not: - equal: ["release-train", << pipeline.schedule.name >>] - - not: - equal: [bump, << pipeline.parameters.action >>] - - not: << pipeline.parameters.generate_snapshots >> - - not: << pipeline.parameters.generate_revenuecatui_snapshots >> - - not: << pipeline.parameters.generate_swiftinterface >> - - not: - matches: - pattern: "^(main|release/.*)$" - value: << pipeline.git.branch >> - - or: - - not: - matches: - pattern: "^generated_(snapshots|swiftinterface)/.*" - value: << pipeline.git.branch >> - - matches: - pattern: "^generated_(snapshots|swiftinterface)/main-.*" - value: << pipeline.git.branch >> + equal: [rickvdl/migrate-sentry-size-analysis, << pipeline.git.branch >>] + jobs: + - binary_size_analysis: + context: + - slack-secrets + - sentry + + # Temporarily disabled while validating the Sentry Size Analysis migration. + run-all-tests: + when: false jobs: # ============================================================= # Reduced Test Suite: Auto-run on every push @@ -2369,9 +2357,10 @@ workflows: - emerge_purchases_ui_snapshot_tests: context: - slack-secrets - - emerge_binary_size_analysis: + - binary_size_analysis: context: - slack-secrets + - sentry - build-tv-watch-mac-and-visionos: context: - slack-secrets @@ -2543,7 +2532,7 @@ workflows: - pod-lib-lint - run-revenuecat-ui-ios-26 - emerge_purchases_ui_snapshot_tests - - emerge_binary_size_analysis + - binary_size_analysis - build-tv-watch-mac-and-visionos - run-workflow-maestro-tests # Full Test Suite @@ -2639,15 +2628,8 @@ workflows: <<: *only-main-branch danger: - when: - or: - - not: - matches: - pattern: "^generated_(snapshots|swiftinterface)/.*" - value: << pipeline.git.branch >> - - matches: - pattern: "^generated_(snapshots|swiftinterface)/main-.*" - value: << pipeline.git.branch >> + # Temporarily disabled while validating the Sentry Size Analysis migration. + when: false jobs: - danger @@ -2871,9 +2853,10 @@ workflows: dry_run: true context: - slack-secrets - - emerge_binary_size_analysis: + - binary_size_analysis: context: - slack-secrets + - sentry - lint: context: - slack-secrets @@ -2931,7 +2914,7 @@ workflows: - api-tests - revenuecat-admob-tests - deploy-purchase-tester - - emerge_binary_size_analysis + - binary_size_analysis # ============================================================= # Release tagging: only on release branches. diff --git a/.circleci/generate-requested-jobs-config.js b/.circleci/generate-requested-jobs-config.js index 082725cbb0..517739e430 100644 --- a/.circleci/generate-requested-jobs-config.js +++ b/.circleci/generate-requested-jobs-config.js @@ -23,7 +23,7 @@ const JOBS = { "check-api-changes-revenuecat": ["slack-secrets-ios"], "check-api-changes-revenuecatui": ["slack-secrets-ios"], "docs-build": ["slack-secrets"], - "emerge_binary_size_analysis": ["slack-secrets"], + "binary_size_analysis": ["slack-secrets", "sentry"], "emerge_purchases_ui_snapshot_tests": ["slack-secrets"], "generate-swiftinterface": ["slack-secrets-ios"], "installation-tests-all-but-carthage": ["slack-secrets"], diff --git a/Gemfile.lock b/Gemfile.lock index 83005c18e4..8323d8071a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -251,6 +251,8 @@ GEM xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-emerge (0.10.8) faraday (~> 1.1) + fastlane-plugin-sentry (2.6.1) + os (~> 1.1, >= 1.1.4) fastlane-sirp (1.1.0) ffi (1.17.4) ffi (1.17.4-arm64-darwin) @@ -470,6 +472,7 @@ DEPENDENCIES fastlane-plugin-create_xcframework! fastlane-plugin-emerge fastlane-plugin-revenuecat_internal! + fastlane-plugin-sentry nokogiri rest-client (= 2.1.0) diff --git a/Projects/BinarySizeTest/Project.swift b/Projects/BinarySizeTest/Project.swift index 39e716da04..2538c6392a 100644 --- a/Projects/BinarySizeTest/Project.swift +++ b/Projects/BinarySizeTest/Project.swift @@ -3,8 +3,8 @@ import ProjectDescriptionHelpers import Foundation /// Unlike other Tuist projects in this repo, BinarySizeTest manages its own dependency integration -/// independently of `Environment.dependencyMode`. Each case produces a separate binary uploaded to -/// Emerge for size tracking, so they each have a distinct bundle ID. +/// independently of `Environment.dependencyMode`. Each case produces a separate binary for size +/// tracking, so they each have a distinct bundle ID. /// /// - `localSource`: Uses Xcode project target references (`.project(target:path:)`). /// Requires `TUIST_RC_XCODE_PROJECT=true` so that `Workspace.swift` includes the @@ -82,7 +82,7 @@ extension BinarySizeTestIntegrationMethod { } var provisioningProfileSpecifier: String { - return "match AppStore \(bundleId)" + return "match AdHoc \(bundleId)" } var provisioningProfileSettingValue: SettingValue { diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 49d1d3c913..8fa1477b1d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -62,6 +62,10 @@ REPO_NAME = 'purchases-ios' PAYWALL_PREVIEW_RESOURCES_REPO_NAME = 'paywall-preview-resources' CHANGELOG_LATEST_PATH = './CHANGELOG.latest.md' CHANGELOG_PATH = './CHANGELOG.md' +BINARY_SIZE_ANALYSIS_DEVICE = 'iPhone17,1' +BINARY_SIZE_ANALYSIS_CONFIGURATION = 'Release' +SENTRY_ORG_SLUG = 'revenuecat' +SENTRY_PROJECT_SLUG = 'purchases-ios' platform :ios do before_all do @@ -955,22 +959,55 @@ platform :ios do build_release(platform: 'macOS') end - desc "Build BinarySizeTest app and upload to Emerge" - lane :build_and_upload_emerge_binary_size_analysis do |options| + desc "Build BinarySizeTest app and upload it for size analysis" + lane :build_and_upload_binary_size_analysis do |options| integration_method = options[:integration_method] unless integration_method UI.user_error!("Missing required option: integration_method. Expected one of: LOCAL_SOURCE, COCOAPODS, SPM") end - archive_path = build_binary_size_test_app( + build = build_binary_size_test_app( integration_method: integration_method ) send_to_emerge( - archive_path: archive_path + archive_path: build[:archive_path] + ) + + send_to_sentry( + ipa_path: build[:ipa_path] ) end + private_lane :send_to_sentry do |options| + ipa_path = options[:ipa_path] + unless ipa_path && File.exist?(ipa_path) + UI.user_error!("Missing thinned IPA for Sentry upload at '#{ipa_path}'") + end + + sentry_args = { + org_slug: SENTRY_ORG_SLUG, + project_slug: SENTRY_PROJECT_SLUG, + ipa_path: ipa_path, + build_configuration: BINARY_SIZE_ANALYSIS_CONFIGURATION, + vcs_provider: "github", + head_repo_name: "RevenueCat/#{REPO_NAME}", + base_repo_name: "RevenueCat/#{REPO_NAME}", + force_git_metadata: true + } + + head_sha = ENV["CIRCLE_SHA1"] + sentry_args[:head_sha] = head_sha if head_sha && !head_sha.empty? + + head_ref = ENV["CIRCLE_BRANCH"] + sentry_args[:head_ref] = head_ref if head_ref && !head_ref.empty? + + pr_number = detect_pr_number + sentry_args[:pr_number] = pr_number if pr_number + + sentry_upload_build(sentry_args) + end + private_lane :build_binary_size_test_app do |options| integration_method = options[:integration_method] unless integration_method @@ -1020,10 +1057,10 @@ platform :ios do end bundle_id = settings[:bundle_id] - provisioning_profile_name = "match AppStore #{bundle_id}" + provisioning_profile_name = "match AdHoc #{bundle_id}" match( - type: "appstore", + type: "adhoc", readonly: true, platform: "ios", app_identifier: bundle_id, @@ -1037,19 +1074,20 @@ platform :ios do gym( workspace: workspace_path, scheme: "BinarySizeTest", - configuration: "Release", + configuration: BINARY_SIZE_ANALYSIS_CONFIGURATION, destination: "generic/platform=iOS", archive_path: archive_path, - export_method: "app-store", + export_method: "ad-hoc", export_options: { signingStyle: "manual", stripSwiftSymbols: false, - thinning: "", + thinning: BINARY_SIZE_ANALYSIS_DEVICE, provisioningProfiles: { bundle_id => provisioning_profile_name } }, output_directory: output_directory, + output_name: "BinarySizeTest-#{integration_method}-#{BINARY_SIZE_ANALYSIS_DEVICE}", include_bitcode: false, include_symbols: true, clean: false @@ -1060,7 +1098,10 @@ platform :ios do UI.user_error!("IPA export completed but no IPA file found in lane context") end - archive_path + { + archive_path: archive_path, + ipa_path: ipa_path + } end desc "archive" diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 9f0eb0bfa0..7f899ac33a 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -5,3 +5,4 @@ gem 'fastlane-plugin-create_xcframework', git: "https://github.com/RevenueCat/fastlane-plugin-create_xcframework" gem "fastlane-plugin-revenuecat_internal", git: "https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal" gem 'fastlane-plugin-emerge' +gem 'fastlane-plugin-sentry' diff --git a/fastlane/README.md b/fastlane/README.md index c8394f2471..1579944bbe 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -202,6 +202,14 @@ Release checks build tvOS, watchOS, macOS and visionOS +### ios build_with_app_extension_safe_apis + +```sh +[bundle exec] fastlane ios build_with_app_extension_safe_apis +``` + +Build a scheme with app-extension-safe API checks enabled + ### ios build_mac ```sh @@ -210,13 +218,13 @@ build tvOS, watchOS, macOS and visionOS macOS build -### ios build_and_upload_emerge_binary_size_analysis +### ios build_and_upload_binary_size_analysis ```sh -[bundle exec] fastlane ios build_and_upload_emerge_binary_size_analysis +[bundle exec] fastlane ios build_and_upload_binary_size_analysis ``` -Build BinarySizeTest app and upload to Emerge +Build BinarySizeTest app and upload it for size analysis ### ios archive @@ -352,7 +360,7 @@ Creates a new PR after new swiftinterface baseline files were generated [bundle exec] fastlane ios update_swiftinterface_baselines ``` -Generate and update baseline swiftinterface files locally +Generate and update baseline swiftinterface files ### ios compile_autogenerated_header @@ -386,13 +394,27 @@ Generate Tuist workspace Test XCFramework integration by building XCFrameworkInstallationTests app +### ios remote_config_production_tests + +```sh +[bundle exec] fastlane ios remote_config_production_tests +``` + +Run BackendIntegrationTests + +Runs the remote config blob health monitor against the live backend (two projects) + +Keys come from the environment (REVENUECAT_REMOTE_CONFIG_CDN_API_KEY / _INLINE_API_KEY); + +each test skips if its key is unset, so no key is ever written into source. + ### ios backend_integration_tests ```sh [bundle exec] fastlane ios backend_integration_tests ``` -Run BackendIntegrationTests + ### ios loadshedder_integration_tests_in_old_major @@ -498,6 +520,22 @@ Create or delete sandbox testers Enable customer center development by cherry-picking a specific commit +### ios notify_pr_ci_failure + +```sh +[bundle exec] fastlane ios notify_pr_ci_failure +``` + + + +### ios clear_pr_ci_failure + +```sh +[bundle exec] fastlane ios clear_pr_ci_failure +``` + + + ----