Skip to content

Commit 427609a

Browse files
xsahil03xclaude
andauthored
chore(repo): merge master into v10.0.0 (#2682)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 29fc127 commit 427609a

94 files changed

Lines changed: 7924 additions & 3208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/release-pr/SKILL.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
name: release-pr
3+
description: >
4+
Open a release PR: bumps versions in melos.yaml and pubspecs, finalises CHANGELOGs, opens a PR with auto-generated
5+
release notes against master (stable) or v10.0.0 (beta).
6+
disable-model-invocation: true
7+
argument-hint: "[version]"
8+
arguments: [version]
9+
allowed-tools:
10+
- Bash(git *)
11+
- Bash(gh *)
12+
- Bash(melos *)
13+
- Bash(which *)
14+
- Bash(grep *)
15+
- Read
16+
- Edit
17+
- Write
18+
---
19+
20+
# release-pr
21+
22+
Opens a release PR for stream-chat-flutter. Branch `release/v<X.Y.Z>` → base `master` (stable) or `v10.0.0` (beta) →
23+
title `chore(repo): release v<X.Y.Z>`.
24+
25+
**This skill only opens the PR.** After merge, tagging and pub.dev publishing happen via `release_tag.yml` +
26+
`release_publish.yml` (stable: automatic; beta/named: maintainer pushes the tag manually).
27+
28+
If `$version` is provided (e.g. `/release-pr 9.24.0`), use it. Strip any leading `v`. Otherwise ask the user.
29+
30+
## Release types
31+
32+
| Type | Base | Version shape | Tagging |
33+
|---|---|---|---|
34+
| **Stable** | `master` | `X.Y.Z` | Auto via `release_tag.yml` on merge |
35+
| **Beta** | `v10.0.0` | `X.Y.Z-beta.N` | Manual (`release_tag.yml` only watches master) |
36+
| **Named pre-release** | feature branch | `X.Y.Z-<name>.N` | Manual; same as beta |
37+
38+
`distribute_internal.yml` builds sample apps for branches like `feat/design-refresh`**not** a release. Don't use
39+
this skill for those.
40+
41+
## Inputs
42+
43+
1. **Version** (`X.Y.Z` or `X.Y.Z-suffix`). Use `$version` if supplied, otherwise ask. Don't infer.
44+
2. **Base branch** — auto-derive from `$version`:
45+
- No suffix (`X.Y.Z`) → `master`. Stable release.
46+
- `-beta.N` suffix → `v10.0.0`. Verify it exists: `git ls-remote --heads origin v10.0.0`.
47+
- Any other suffix (`-alpha.N`, `-rc.N`, `-design-refresh.N`, …) → ask the user which feature branch to target.
48+
3. **Previous tag** for the release-notes diff. Run `gh release list --limit 10`; pick the most recent tag of the same
49+
train (stable = no hyphen in tag; beta = matches `-beta.`; named = matches the same suffix prefix).
50+
51+
## Pre-flight
52+
53+
Run these checks. **If any fail, stop the skill, surface the failing check to the user, and do not try to auto-fix**
54+
(no stashing uncommitted work, no force-pulling, no killing processes).
55+
56+
- `git status --short -uno` clean after `git checkout <base>` + `git pull --ff-only`.
57+
- `which melos` succeeds.
58+
- `gh auth status` succeeds.
59+
- `gh pr list --head release/v<version> --state all --json number` returns `[]`.
60+
- Latest CI on the base-branch tip is green: `gh run list --branch <base> --limit 5` — no failures on the most
61+
recent runs.
62+
63+
## Steps
64+
65+
### 1. Branch off the chosen base
66+
67+
Pre-flight already left you on `<base>` with latest. Just create the release branch:
68+
69+
```bash
70+
git checkout -b release/v<version>
71+
```
72+
73+
### 2. Bump versions
74+
75+
Edit two sets of files by hand, then let `melos bs` propagate the rest.
76+
77+
**Edit:**
78+
79+
- `melos.yaml` — in the `command.bootstrap.environment.dependencies` block, bump all five `stream_chat*: ^<version>`
80+
entries. Locate with `grep -n "^ stream_chat" melos.yaml`.
81+
- Each `packages/*/pubspec.yaml` (5 files) — set `version: <version>`. Do **not** touch
82+
`packages/*/example/pubspec.yaml` or `sample_app/pubspec.yaml` `version:` fields; their deps are synced by
83+
`melos bs`.
84+
85+
**Then run:**
86+
87+
```bash
88+
melos bs
89+
```
90+
91+
`melos bs` does the rest:
92+
93+
- Propagates the `melos.yaml` deps block into every workspace pubspec, including each package's intra-monorepo dep
94+
constraints, every `packages/*/example/pubspec.yaml`, and `sample_app/pubspec.yaml`.
95+
- Fires the `command.bootstrap.hooks.post: melos run version:update` hook, which runs `tools/generate_version.dart`
96+
and regenerates `packages/stream_chat/lib/version.dart` from the new pubspec version.
97+
98+
Do **not** run `./tools/version.sh`. It calls `melos version` which leaves `melos.yaml`'s deps block stale — the next
99+
`melos bs` would re-write every pubspec dep constraint back to the old version.
100+
101+
Verify the diff shape matches the previous release PR. Find its number with:
102+
103+
```bash
104+
gh pr list --search "chore(repo): release in:title" --state merged --limit 5 --json number,title
105+
```
106+
107+
Then compare:
108+
109+
```bash
110+
git diff --stat
111+
gh pr diff <prev-release-pr-number> --name-only # for comparison
112+
```
113+
114+
### 3. Finalise the CHANGELOGs
115+
116+
Five files: `packages/{stream_chat, stream_chat_flutter, stream_chat_flutter_core, stream_chat_localizations,
117+
stream_chat_persistence}/CHANGELOG.md`.
118+
119+
For each, **apply the first matching rule below** — it's a decision tree, not a sequence:
120+
121+
1. **Top section is `## Upcoming Changes` or `## Upcoming`** → rename to `## <version>`. Keep bullets.
122+
2. **User-facing changes since `v<prev>`** — new APIs, bug fixes users would notice, deprecations. Check with
123+
`git log v<prev>..HEAD --oneline -- packages/<pkg>`. Add a `## <version>` header with bullets in the existing
124+
emoji-prefixed sections only (`✅ Added`, `🚀 Performance`, `🐞 Fixed`, `🔄 Changed`). Don't invent new
125+
section names.
126+
3. **Only `stream_chat` dep bump** (no in-package changes, but depends on `stream_chat`) → add the dep-bump line:
127+
```
128+
## <version>
129+
130+
- Updated `stream_chat` dependency to [`<version>`](https://pub.dev/packages/stream_chat/changelog).
131+
```
132+
4. **Anything else** (internal-only changes, test fixes, refactors, or truly nothing) → add `## <version>` +
133+
`- Minor bug fixes and improvements`.
134+
135+
**Every package gets a `## <version>` header**, even if it's only a dep-bump line. Empty version sections and
136+
missing headers both fail pana.
137+
138+
### 4. Sanity-check
139+
140+
```bash
141+
melos run analyze
142+
melos run lint:pub
143+
```
144+
145+
If either fails, surface to the user and stop.
146+
147+
### 5. Commit and push
148+
149+
```bash
150+
git add -A
151+
git commit -m "chore(repo): release v<version>"
152+
git push -u origin release/v<version>
153+
```
154+
155+
Single commit. The message format is load-bearing: `release_tag.yml` parses `vX.Y.Z` from it after merge.
156+
157+
### 6. Generate the PR body
158+
159+
The body **must be exactly what GitHub's release UI produces when you click "Generate release notes"** — no template
160+
wrapper, no extra description, no CLA checkboxes. The "New Contributors" block GitHub auto-appends stays in; that's
161+
part of the convention.
162+
163+
```bash
164+
gh api repos/GetStream/stream-chat-flutter/releases/generate-notes \
165+
-f tag_name=v<version> \
166+
-f previous_tag_name=v<previous> \
167+
-f target_commitish=<base> \
168+
--jq .body > /tmp/release-notes.md
169+
```
170+
171+
- `tag_name`: the tag we'll create (need not exist yet).
172+
- `previous_tag_name`: most recent tag of the same train (stable or beta).
173+
- `target_commitish`: the **base branch** (`master` or `v10.0.0`), not the release branch — the notes should cover
174+
every commit between `previous_tag_name` and where the tag will land after merge.
175+
176+
Read the file once to skim. If a PR title looks wrong, fix it on the originating PR upstream and re-run the API
177+
call; don't hand-edit `/tmp/release-notes.md`.
178+
179+
### 7. Open the PR
180+
181+
```bash
182+
gh pr create \
183+
--base <base> \
184+
--head release/v<version> \
185+
--title "chore(repo): release v<version>" \
186+
--body-file /tmp/release-notes.md
187+
```
188+
189+
Return the PR URL.
190+
191+
**If this is a beta or named pre-release**, also include this reminder in your message to the user:
192+
193+
> After this PR merges, manually create and push the tag — `release_tag.yml` only fires on `master`:
194+
> ```bash
195+
> git checkout <base>
196+
> git pull --ff-only
197+
> git tag v<version>
198+
> git push origin v<version>
199+
> ```
200+
201+
For stable releases (base `master`), no reminder needed — `release_tag.yml` handles it on merge.
202+
203+
## After merge (FYI)
204+
205+
Stable (base `master`): `release_tag.yml` extracts `vX.Y.Z` from the commit, creates and pushes the tag.
206+
`release_publish.yml` runs `melos run release:pub` and creates the GitHub release.
207+
208+
Beta / named pre-release: maintainer runs the tag commands surfaced at the end of step 7.
209+
210+
## Don't
211+
212+
- **Never create a GitHub release** (`gh release create`, `POST /repos/.../releases`). Step 6 uses
213+
`generate-notes`, which is read-only. The release itself is created by `release_publish.yml` after the tag is
214+
pushed.
215+
- **Never push a tag.** Stable is automatic on merge; beta/named is the maintainer's manual step.
216+
- **Never run `melos run release:pub`.** That's the publish step, triggered by the workflow on tag push. Even if the
217+
user asks, refuse — running it locally publishes from an unreviewed working tree.
218+
- **Never merge the PR.** Return the URL and stop.

.github/actions/pana/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
min_score:
55
required: false
66
type: number
7-
default: 120
7+
default: 100
88
pana_version:
99
required: false
1010
type: string

.github/workflows/check_db_entities.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
name: check_db_entities
22

3-
on:
3+
on:
44
pull_request:
5-
paths:
6-
- 'packages/stream_chat_persistence/**'
75

86
concurrency:
97
group: ${{ github.workflow }}-${{ github.ref }}
108
cancel-in-progress: true
119

1210
jobs:
11+
# Centralizes every gating decision for this workflow — currently just a
12+
# path filter. Downstream jobs only need a single
13+
# `if: needs.gate.outputs.should_run == 'true'`. A job skipped this way
14+
# reports `success` to branch protection (vs. `on.paths` filtering, which
15+
# hangs forever) — see
16+
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks
17+
gate:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
should_run: ${{ steps.filter.outputs.persistence }}
21+
steps:
22+
- name: 📥 Checkout
23+
uses: actions/checkout@v6
24+
25+
- name: 🛤️ Detect Path Changes
26+
uses: dorny/paths-filter@v3
27+
id: filter
28+
with:
29+
filters: |
30+
persistence:
31+
- 'packages/stream_chat_persistence/**'
32+
- '.github/workflows/check_db_entities.yml'
33+
1334
check_entity_modifications:
35+
needs: gate
36+
if: needs.gate.outputs.should_run == 'true'
1437
runs-on: ubuntu-latest
1538
steps:
1639
- name: 📥 Checkout
@@ -24,22 +47,22 @@ jobs:
2447
ENTITY_DIR="packages/stream_chat_persistence/lib/src/entity"
2548
TEMP_FILE="modified_entities"
2649
BASE_BRANCH="${{ github.base_ref }}"
27-
50+
2851
echo "Using base branch: origin/$BASE_BRANCH for comparison"
29-
52+
3053
# Check if any entity files have changed compared to the base branch
3154
git diff-index --name-only origin/$BASE_BRANCH -- $ENTITY_DIR | grep -E '\.dart$' > $TEMP_FILE || true
32-
55+
3356
if [ ! -s "$TEMP_FILE" ]; then
3457
echo "✅ No entity files changed."
3558
echo "has_changes=false" >> $GITHUB_OUTPUT
3659
rm $TEMP_FILE
3760
exit 0
3861
fi
39-
62+
4063
echo "⚠️ Entity files modified:"
4164
cat $TEMP_FILE
42-
65+
4366
# Set modified files as output
4467
echo "modified_files<<EOF" >> $GITHUB_OUTPUT
4568
cat $TEMP_FILE >> $GITHUB_OUTPUT
@@ -74,4 +97,4 @@ jobs:
7497
2. Update entity schema tests if necessary.
7598
7699
*Note: This comment is automatically generated by the CI workflow.*
77-
edit-mode: replace
100+
edit-mode: replace

.github/workflows/distribute_external.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,17 @@ jobs:
106106
- uses: maxim-lobanov/setup-xcode@v1
107107
with:
108108
xcode-version: '26.3'
109-
109+
110110
- name: "Install Flutter"
111111
uses: subosito/flutter-action@v2
112112
with:
113113
flutter-version: ${{ env.FLUTTER_VERSION }}
114114
channel: stable
115115
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
116116

117+
- name: "Disable Swift Package Manager"
118+
run: flutter config --no-enable-swift-package-manager
119+
117120
- name: Setup Ruby
118121
uses: ruby/setup-ruby@v1
119122
with:

.github/workflows/distribute_internal.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,23 @@ jobs:
116116
- uses: maxim-lobanov/setup-xcode@v1
117117
with:
118118
xcode-version: '26.3'
119-
119+
120120
- name: "Install Flutter"
121121
uses: subosito/flutter-action@v2
122122
with:
123123
flutter-version: ${{ env.FLUTTER_VERSION }}
124124
channel: stable
125125
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
126-
126+
127+
- name: "Disable Swift Package Manager"
128+
run: flutter config --no-enable-swift-package-manager
129+
127130
- name: "Install Tools"
128131
run: flutter pub global activate melos
129-
132+
130133
- name: "Bootstrap Workspace"
131134
run: melos bootstrap
132-
135+
133136
- name: Setup Ruby
134137
uses: ruby/setup-ruby@v1
135138
with:
@@ -167,20 +170,23 @@ jobs:
167170
- uses: maxim-lobanov/setup-xcode@v1
168171
with:
169172
xcode-version: '26.3'
170-
173+
171174
- name: "Install Flutter"
172175
uses: subosito/flutter-action@v2
173176
with:
174177
flutter-version: ${{ env.FLUTTER_VERSION }}
175178
channel: stable
176179
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
177-
180+
181+
- name: "Disable Swift Package Manager"
182+
run: flutter config --no-enable-swift-package-manager
183+
178184
- name: "Install Tools"
179185
run: flutter pub global activate melos
180-
186+
181187
- name: "Bootstrap Workspace"
182188
run: melos bootstrap
183-
189+
184190
- name: Setup Ruby
185191
uses: ruby/setup-ruby@v1
186192
with:

0 commit comments

Comments
 (0)