Skip to content

chore(repo): sync sample_app version to SDK + add TestFlight internal builds#2705

Merged
xsahil03x merged 5 commits into
masterfrom
chore/sample-app-version-sync-and-testflight
Jun 2, 2026
Merged

chore(repo): sync sample_app version to SDK + add TestFlight internal builds#2705
xsahil03x merged 5 commits into
masterfrom
chore/sample-app-version-sync-and-testflight

Conversation

@xsahil03x
Copy link
Copy Markdown
Member

@xsahil03x xsahil03x commented Jun 2, 2026

Summary

Cherry-picks two changes from the v10.0.0 branch onto master:

  • chore(sample): Set appversion to main sdk version #2678 chore(sample): Set appversion to main sdk versiontools/generate_version.dart now also rewrites sample_app/pubspec.yaml to match the stream_chat package version. Sample app version bumped from 2.2.0 to 9.24.0 to match master's current SDK.
  • chore(sample): Internal testflight builds #2508 add internal testflight builds — new distribute_to_testflight_internal Fastlane lane and ios_testflight job in distribute_internal.yml that pushes builds to TestFlight's Internal Testers group on every push to master.

Notes

  • The ios_testflight workflow job was adapted from chore(sample): Internal testflight builds #2508 to match master's existing ios job conventions: added maxim-lobanov/setup-xcode@v1 (xcode 26.3), added the Disable Swift Package Manager step, and removed the redundant cache: true flag.
  • Dropped the # TODO: Remove once feat/design-refresh is merged to master comment from the workflow — it's moot now that this lives on master.
  • The two trivial docs_screenshots formatting tweaks from chore(sample): Set appversion to main sdk version #2678 were skipped — those files were deleted on master.

Test plan

  • CI passes (distribute_internal.yml should validate)
  • Verify dart run tools/generate_version.dart updates both version.dart and sample_app/pubspec.yaml
  • On next push to master, confirm the ios_testflight job successfully uploads to TestFlight Internal Testers

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added automated iOS TestFlight distribution for internal beta testers (via CI + build lane).
    • Improved version propagation to ensure a cleaned/consistent version string across build tooling.
  • Version

    • App version updated to 9.24.0.

renefloor and others added 3 commits June 2, 2026 07:43
* Set appversion to main sdk version

* formatting
The cherry-picked commit set the sample_app version to 10.0.0; on master,
the stream_chat SDK is 9.24.0. Running tools/generate_version.dart syncs
sample_app/pubspec.yaml accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@xsahil03x, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd374408-16b0-49b3-b5d3-215ccd60fde1

📥 Commits

Reviewing files that changed from the base of the PR and between e8bd639 and f40268b.

📒 Files selected for processing (1)
  • tools/generate_version.dart
📝 Walkthrough

Walkthrough

Adds internal TestFlight distribution: sample app version is synchronized, a Fastlane lane builds and uploads an app-store-signed IPA to TestFlight for internal testers, and a GitHub Actions job invokes that lane with required secrets.

Changes

TestFlight Internal Distribution for Sample App

Layer / File(s) Summary
Version setup for sample app
sample_app/pubspec.yaml, tools/generate_version.dart
sample_app version updated to 9.24.0; tools/generate_version.dart computes a cleaned version (strips - suffixes) and writes it into sample_app/pubspec.yaml.
TestFlight internal distribution lane
sample_app/ios/fastlane/Fastfile
Adds distribute_to_testflight_internal lane that runs match, computes next TestFlight build number, builds an app-store IPA, uploads dSYMs to Crashlytics, and distributes to internal testers only (no external notifications).
GitHub Actions workflow job
.github/workflows/distribute_internal.yml
New ios_testflight job on macos-15 with Xcode 26.3 that prepares Flutter/Melos/Ruby tooling and runs bundle exec fastlane distribute_to_testflight_internal with MATCH_PASSWORD and APPSTORE_API_KEY in env.

Sequence Diagram

sequenceDiagram
  participant GitHubActions as GitHub Actions (ios_testflight)
  participant Fastlane as Fastlane lane (distribute_to_testflight_internal)
  participant AppStoreConnect as App Store Connect/TestFlight
  participant Crashlytics as Firebase Crashlytics

  GitHubActions->>Fastlane: invoke distribute_to_testflight_internal (env: MATCH_PASSWORD, APPSTORE_API_KEY)
  Fastlane->>Fastlane: match provisioning & increment build number
  Fastlane->>Fastlane: build IPA (export_method: app-store)
  Fastlane->>Crashlytics: upload dSYMs
  Fastlane->>AppStoreConnect: upload IPA to TestFlight (groups: Internal Testers)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • renefloor
  • VelikovPetar
  • martinmitrevski

Poem

🐰 I hopped a lane to TestFlight skies,
Built an IPA with careful ties,
Version cleaned and synced just right,
CI nudged the lane to take its flight,
Internal testers clap in tiny bytes.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly summarizes the two main changes: syncing sample_app version to match SDK and adding TestFlight internal build distribution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sample-app-version-sync-and-testflight

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@xsahil03x xsahil03x changed the title chore(sample): sync sample_app version to SDK + add TestFlight internal builds chore(samples): sync sample_app version to SDK + add TestFlight internal builds Jun 2, 2026
@xsahil03x xsahil03x changed the title chore(samples): sync sample_app version to SDK + add TestFlight internal builds chore(repo): sync sample_app version to SDK + add TestFlight internal builds Jun 2, 2026
Match the v10 branch — the internal TestFlight lane should upload dSYMs
to Firebase Crashlytics like distribute_to_testflight does, so symbolicated
crash reports are available for internal-tester builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tools/generate_version.dart (1)

54-59: ⚡ Quick win

Validate the pubspec.yaml replacement before writing.

This new path uses replaceFirst with an unanchored version: .+ pattern and then always logs success. If the top-level version: line stops matching, the script silently leaves sample_app/pubspec.yaml stale while claiming it was updated.

Suggested hardening
-  final updatedSampleAppPubspec = sampleAppPubspec.replaceFirst(
-    RegExp('version: .+'),
-    'version: $cleanedVersion',
-  );
+  final versionPattern = RegExp(r'^version:\s*.+$', multiLine: true);
+  if (!versionPattern.hasMatch(sampleAppPubspec)) {
+    throw StateError('Top-level version not found in $sampleAppPubspecPath');
+  }
+  final updatedSampleAppPubspec = sampleAppPubspec.replaceFirst(
+    versionPattern,
+    'version: $cleanedVersion',
+  );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/generate_version.dart` around lines 54 - 59, The current replacement
using sampleAppPubspec.replaceFirst(RegExp('version: .+'), 'version:
$cleanedVersion') may silently fail; change the regex to anchor to the top-level
line (e.g. use multiline start '^version:\\s*.+', with RegExp(..., multiLine:
true)) and validate that the replacement actually changed the string by
comparing updatedSampleAppPubspec != sampleAppPubspec before calling
File(...).writeAsString; if no change occurred, log an error (including the
original pubspec snippet) and exit non-zero instead of claiming success. Ensure
you reference the symbols updatedSampleAppPubspec,
sampleAppPubspec.replaceFirst, RegExp('version: .+'), and
File(sampleAppPubspecPath).writeAsString when making the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/distribute_internal.yml:
- Around line 159-199: Update the workflow steps to pin third‑party actions to
immutable commit SHAs (replace uses: webfactory/ssh-agent@v0.9.1,
maxim-lobanov/setup-xcode@v1, subosito/flutter-action@v2, ruby/setup-ruby@v1,
etc. with their corresponding full commit SHAs) and set persist-credentials:
false on the "Git Checkout" step (the step titled "Git Checkout" that uses
actions/checkout@v6) so the checkout token is not persisted to subsequent steps.

In `@sample_app/ios/fastlane/Fastfile`:
- Around line 133-144: The TestFlight internal lane currently calls build_ipa
and upload_to_testflight but does not upload dSYMs, so internal builds reach
Crashlytics without symbols; after the upload_to_testflight step in this lane,
add a call to upload_dsyms_to_crashlytics (using the dSYM/IPA output from
build_ipa, e.g. the same build output under root_path/build/ios) so Crashlytics
receives the symbol files; ensure the call occurs after upload_to_testflight and
references the correct artifact path used by build_ipa/ipa (e.g., the
ChatSample.ipa/dSYMs).

---

Nitpick comments:
In `@tools/generate_version.dart`:
- Around line 54-59: The current replacement using
sampleAppPubspec.replaceFirst(RegExp('version: .+'), 'version: $cleanedVersion')
may silently fail; change the regex to anchor to the top-level line (e.g. use
multiline start '^version:\\s*.+', with RegExp(..., multiLine: true)) and
validate that the replacement actually changed the string by comparing
updatedSampleAppPubspec != sampleAppPubspec before calling
File(...).writeAsString; if no change occurred, log an error (including the
original pubspec snippet) and exit non-zero instead of claiming success. Ensure
you reference the symbols updatedSampleAppPubspec,
sampleAppPubspec.replaceFirst, RegExp('version: .+'), and
File(sampleAppPubspecPath).writeAsString when making the fix.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0da835e6-9327-46ab-a66d-7c62d7e19e66

📥 Commits

Reviewing files that changed from the base of the PR and between 58331ec and e2a1c33.

📒 Files selected for processing (4)
  • .github/workflows/distribute_internal.yml
  • sample_app/ios/fastlane/Fastfile
  • sample_app/pubspec.yaml
  • tools/generate_version.dart

Comment on lines +159 to +199
- name: Connect Bot
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}

- name: "Git Checkout"
uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.3'

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}

- name: "Disable Swift Package Manager"
run: flutter config --no-enable-swift-package-manager

- name: "Install Tools"
run: flutter pub global activate melos

- name: "Bootstrap Workspace"
run: melos bootstrap

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: sample_app/ios

- name: Distribute to TestFlight Internal
working-directory: sample_app/ios
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/distribute_internal.yml"
echo "== File existence =="
ls -l "$FILE"

echo "== Show lines 130-230 =="
nl -ba "$FILE" | sed -n '130,230p'

echo "== Find all actions/checkout usages =="
rg -n "uses:\s*actions/checkout" "$FILE" || true

echo "== Show any persist-credentials settings =="
rg -n "persist-credentials" "$FILE" || true

echo "== Show all uses lines in the workflow (limited to within distribute_internal.yml) =="
rg -n "^\s*uses:\s*" "$FILE" | head -n 200

Repository: GetStream/stream-chat-flutter

Length of output: 271


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/distribute_internal.yml"
nl -ba "$FILE" | sed -n '150,210p'

Repository: GetStream/stream-chat-flutter

Length of output: 116


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/distribute_internal.yml"
echo "== File existence =="
ls -l "$FILE"

echo "== Match actions/checkout usages =="
rg -n "uses:\s*actions/checkout" "$FILE" || true

echo "== Match persist-credentials settings =="
rg -n "persist-credentials" "$FILE" || true

echo "== Match all uses: lines (first 200) =="
rg -n "^\s*uses:\s*" "$FILE" | head -n 200 || true

echo "== Show file excerpt (lines 140-220) using awk =="
awk 'NR>=140 && NR<=220 {printf "%5d %s\n", NR, $0}' "$FILE" | sed -n '1,200p'

Repository: GetStream/stream-chat-flutter

Length of output: 3350


Pin GitHub Actions to SHAs and prevent checkout token persistence

In the ios_testflight job, actions/checkout@v6 is used without persist-credentials: false, and multiple third-party actions use mutable version tags (webfactory/ssh-agent@v0.9.1, maxim-lobanov/setup-xcode@v1, subosito/flutter-action@v2, ruby/setup-ruby@v1). Pin each uses: to a full commit SHA, and set persist-credentials: false on the Git Checkout step.

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 164-167: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 160-160: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 165-165: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 169-169: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 174-174: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 190-190: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/distribute_internal.yml around lines 159 - 199, Update the
workflow steps to pin third‑party actions to immutable commit SHAs (replace
uses: webfactory/ssh-agent@v0.9.1, maxim-lobanov/setup-xcode@v1,
subosito/flutter-action@v2, ruby/setup-ruby@v1, etc. with their corresponding
full commit SHAs) and set persist-credentials: false on the "Git Checkout" step
(the step titled "Git Checkout" that uses actions/checkout@v6) so the checkout
token is not persisted to subsequent steps.

Comment thread sample_app/ios/fastlane/Fastfile
Wrap the long print() call to satisfy the 80-col formatter the cherry-pick
inherited (line was over the limit in the master format target).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.67%. Comparing base (58331ec) to head (f40268b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2705   +/-   ##
=======================================
  Coverage   65.67%   65.67%           
=======================================
  Files         423      423           
  Lines       26694    26694           
=======================================
  Hits        17532    17532           
  Misses       9162     9162           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xsahil03x xsahil03x merged commit 8f77232 into master Jun 2, 2026
20 checks passed
@xsahil03x xsahil03x deleted the chore/sample-app-version-sync-and-testflight branch June 2, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants