Skip to content

Commit d469ef0

Browse files
author
qwe7002
committed
feat: enhance breaking change detection for storage migrations and data layer changes
1 parent f485b55 commit d469ef0

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

docs/ci/BREAKING_CHANGES_DETECTION.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Users must update DataMigrationManager version."
8989
- **Behavioral Changes**: Significant changes in how features work
9090
- **Permission Changes**: Adding new required permissions in AndroidManifest
9191
- **Removed Features**: Deprecating or removing functionality
92+
- **Storage Migration**: Replacing storage libraries (e.g., Paper → MMKV, SharedPreferences → MMKV)
93+
- **Data Layer Changes**: Changing how data is persisted or retrieved
9294

9395
### What is NOT a Breaking Change?
9496

@@ -110,6 +112,20 @@ git commit -m "feat!: change bot token storage to encrypted format
110112
BREAKING CHANGE: Existing bot tokens will need to be re-entered.
111113
Users must reconfigure their bot in Settings."
112114

115+
# Storage library migration (Paper to MMKV)
116+
git commit -m "refactor!: migrate SharedPreferences to MMKV for better performance
117+
118+
BREAKING CHANGE: App will migrate existing configuration to MMKV on first launch.
119+
Users may need to reconfigure if migration fails. Backup your configuration before updating.
120+
121+
Migration handled by DataMigrationManager v3."
122+
123+
# Alternative: without explicit marker but detectable
124+
git commit -m "refactor(storage): replace Paper library with MMKV for resend list management
125+
126+
This commit migrates from Paper to MMKV storage library. While the app includes automatic
127+
migration logic, users should backup their data before updating."
128+
113129
# Conventional commit with explanation
114130
git commit -m "refactor!: restructure Carbon Copy configuration API
115131
@@ -147,6 +163,43 @@ Key methods:
147163
- `build_prompt(commits)`: Instructs AI to detect and categorize breaking changes
148164
- `generate(repo_path)`: Orchestrates detection and reporting
149165

166+
#### Breaking Change Detection Patterns
167+
168+
The script uses two detection strategies:
169+
170+
**1. Explicit Markers** (100% confidence):
171+
```python
172+
breaking_indicators = [
173+
"BREAKING CHANGE:",
174+
"breaking change:",
175+
"BREAKING:",
176+
"breaking:",
177+
"!:", # Conventional commit marker
178+
]
179+
```
180+
181+
**2. Potential Breaking Patterns** (AI-verified):
182+
```python
183+
potential_breaking_patterns = [
184+
"migrate",
185+
"migration",
186+
"replace.*with", # e.g., "replace Paper with MMKV"
187+
"removed.*feature",
188+
"deprecate",
189+
"rename.*package",
190+
"change.*api",
191+
"incompatible",
192+
"paper.*mmkv", # Specific: Paper to MMKV migration
193+
"sharedpreferences.*mmkv", # Specific: SharedPreferences to MMKV
194+
]
195+
```
196+
197+
These patterns catch implicit breaking changes like:
198+
- `refactor(storage): migrate SharedPreferences to MMKV`
199+
- `refactor(storage): replace Paper library with MMKV`
200+
201+
The AI then analyzes these commits to confirm they are actual breaking changes and provides detailed migration information.
202+
150203
### GitLab CI Configuration
151204

152205
Location: `.reallsys/.gitlab-ci.yml`

docs/ci/gitlab-ci.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,26 @@ VERSION_NAME="${RELEASE_TAG}"
197197
RELEASE_CHANGELOG=$(cat CHANGELOG.md)
198198
```
199199

200-
See [Breaking Changes Detection](./BREAKING_CHANGES_DETECTION.md) for details.
200+
The script automatically detects **Breaking Changes** by analyzing commit messages for:
201+
- Explicit markers: `BREAKING CHANGE:`, `breaking:`, `!:` in commit messages
202+
- Conventional commits with breaking marker: `feat!:`, `fix!:`, `refactor!:`
203+
- Library migrations: `Paper to MMKV`, `SharedPreferences to MMKV`
204+
- Data format changes: `migrate`, `migration`, `replace X with Y`
205+
- API changes: `change api`, `incompatible`, `deprecate`
206+
- Removed features: `removed feature`, `rename package`
207+
208+
**Example Breaking Changes**:
209+
```
210+
refactor(storage)!: migrate SharedPreferences to MMKV
211+
refactor(storage): replace Paper library with MMKV for resend list management
212+
```
213+
214+
When breaking changes are detected, the script:
215+
- ⚠️ Prints warning during execution
216+
- Places Breaking Changes section first in changelog
217+
- Prompts AI to provide detailed migration steps
218+
219+
See [Breaking Changes Detection](./BREAKING_CHANGES_DETECTION.md) for comprehensive details.
201220
202221
8. **Create GitHub Release**
203222
```bash

0 commit comments

Comments
 (0)