From 7d778a301af4ddbe075b3a8add685ac8b99c9018 Mon Sep 17 00:00:00 2001 From: Jamie <2119834+jamieQ@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:39:08 -0500 Subject: [PATCH 1/3] ci(ios): Test empty selective snapshot uploads Build the sentry-cli test branch and submit an empty selective upload with the complete generated snapshot manifest. Refs EME-1290 --- .../workflows/ios_sentry_upload_snapshots.yml | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios_sentry_upload_snapshots.yml b/.github/workflows/ios_sentry_upload_snapshots.yml index b5b8ad59..b26d0120 100644 --- a/.github/workflows/ios_sentry_upload_snapshots.yml +++ b/.github/workflows/ios_sentry_upload_snapshots.yml @@ -183,7 +183,23 @@ jobs: with: fetch-depth: 0 + - name: Checkout sentry-cli empty selective upload branch + if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' + uses: actions/checkout@v6 + with: + repository: getsentry/sentry-cli + ref: fix/allow-empty-selective-snapshots + path: sentry-cli + + - name: Build sentry-cli empty selective upload branch + if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' + working-directory: ${{ github.workspace }}/sentry-cli + run: | + rustup target add aarch64-apple-darwin + cargo build --release --locked --target aarch64-apple-darwin + - name: Set up Ruby env + if: github.event_name != 'pull_request' || github.head_ref != 'ci/test-empty-selective-snapshots' uses: ruby/setup-ruby@v1 with: ruby-version: 3.3.10 @@ -191,6 +207,7 @@ jobs: working-directory: ios - name: Setup gems + if: github.event_name != 'pull_request' || github.head_ref != 'ci/test-empty-selective-snapshots' run: exec ../.github/scripts/ios/setup.sh - name: Download generated snapshots @@ -206,7 +223,56 @@ jobs: echo echo "Total PNG images: $(find "${SNAPSHOT_UPLOAD_BASE_DIR}" -type f -name '*.png' | wc -l | tr -d ' ')" + - name: Prepare empty selective snapshot upload + if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' + env: + ALL_IMAGE_FILE_NAMES_FILE: ${{ runner.temp }}/all-image-file-names.txt + EMPTY_SNAPSHOT_DIR: ${{ runner.temp }}/empty-selected-snapshots + run: | + mkdir -p "${EMPTY_SNAPSHOT_DIR}" + ( + cd "${SNAPSHOT_UPLOAD_BASE_DIR}" + find . -type f -name '*.png' -print | sed 's#^\./##' | LC_ALL=C sort > "${ALL_IMAGE_FILE_NAMES_FILE}" + ) + + if [ ! -s "${ALL_IMAGE_FILE_NAMES_FILE}" ]; then + echo "The complete snapshot filename manifest is empty" >&2 + exit 1 + fi + + if find "${EMPTY_SNAPSHOT_DIR}" -type f -name '*.png' -print -quit | grep -q .; then + echo "The selective upload directory unexpectedly contains PNG files" >&2 + exit 1 + fi + + echo "Complete snapshot names: $(wc -l < "${ALL_IMAGE_FILE_NAMES_FILE}" | tr -d ' ')" + echo "Selected snapshot images: 0" + + - name: Test empty selective upload with sentry-cli branch + if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' + env: + ALL_IMAGE_FILE_NAMES_FILE: ${{ runner.temp }}/all-image-file-names.txt + EMPTY_SNAPSHOT_DIR: ${{ runner.temp }}/empty-selected-snapshots + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} + SENTRY_LOG_LEVEL: debug + run: | + "${{ github.workspace }}/sentry-cli/target/aarch64-apple-darwin/release/sentry-cli" snapshots upload \ + --org sentry \ + --project hackernews-ios \ + --app-id com.emergetools.hackernews \ + --all-image-file-names-file "${ALL_IMAGE_FILE_NAMES_FILE}" \ + --vcs-provider github \ + --head-sha "${{ github.event.pull_request.head.sha }}" \ + --base-sha "${{ github.event.pull_request.base.sha }}" \ + --head-ref "${{ github.head_ref }}" \ + --base-ref "${{ github.base_ref }}" \ + --head-repo-name "${{ github.event.pull_request.head.repo.full_name }}" \ + --base-repo-name "${{ github.event.pull_request.base.repo.full_name }}" \ + --pr-number "${{ github.event.pull_request.number }}" \ + "${EMPTY_SNAPSHOT_DIR}" + - name: Upload snapshots to Sentry + if: github.event_name != 'pull_request' || github.head_ref != 'ci/test-empty-selective-snapshots' env: SENTRY_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} - run: bundle exec fastlane ios upload_sentry_snapshots path:"${SNAPSHOT_UPLOAD_BASE_DIR}" \ No newline at end of file + run: bundle exec fastlane ios upload_sentry_snapshots path:"${SNAPSHOT_UPLOAD_BASE_DIR}" From e3c71c17c7a1bb402c0e5459699796d1ca52f4c0 Mon Sep 17 00:00:00 2001 From: Jamie <2119834+jamieQ@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:13:15 -0500 Subject: [PATCH 2/3] ci(ios): Skip secondary snapshot upload test Skip Swift Snapshot Testing generation and upload on the empty selective upload test branch so only one snapshot artifact is created. Refs EME-1290 --- .github/workflows/ios_sentry_upload_swift_snapshots.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios_sentry_upload_swift_snapshots.yml b/.github/workflows/ios_sentry_upload_swift_snapshots.yml index e93ddccf..f4db9d64 100644 --- a/.github/workflows/ios_sentry_upload_swift_snapshots.yml +++ b/.github/workflows/ios_sentry_upload_swift_snapshots.yml @@ -9,6 +9,7 @@ on: jobs: upload_sentry_swift_snapshots: + if: github.event_name != 'pull_request' || github.head_ref != 'ci/test-empty-selective-snapshots' runs-on: macos-26 defaults: From 280ce5a17b3d42f39b895765a38f87957ceadca1 Mon Sep 17 00:00:00 2001 From: Jamie <2119834+jamieQ@users.noreply.github.com> Date: Thu, 27 Aug 2026 16:07:37 -0500 Subject: [PATCH 3/3] ci(ios): Test empty snapshots with sentry-cli master --- .github/workflows/ios_sentry_upload_snapshots.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios_sentry_upload_snapshots.yml b/.github/workflows/ios_sentry_upload_snapshots.yml index b26d0120..54b40c6e 100644 --- a/.github/workflows/ios_sentry_upload_snapshots.yml +++ b/.github/workflows/ios_sentry_upload_snapshots.yml @@ -183,15 +183,15 @@ jobs: with: fetch-depth: 0 - - name: Checkout sentry-cli empty selective upload branch + - name: Checkout sentry-cli master if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' uses: actions/checkout@v6 with: repository: getsentry/sentry-cli - ref: fix/allow-empty-selective-snapshots + ref: master path: sentry-cli - - name: Build sentry-cli empty selective upload branch + - name: Build sentry-cli master if: github.event_name == 'pull_request' && github.head_ref == 'ci/test-empty-selective-snapshots' working-directory: ${{ github.workspace }}/sentry-cli run: |