Skip to content

Commit 77a58de

Browse files
committed
Improve README for failOnStabilityChange
1 parent 82b1dad commit 77a58de

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,42 @@ composeStabilityAnalyzer {
754754

755755
// Exclude specific sub-projects/modules (useful for multi-module projects)
756756
ignoredProjects.set(listOf("benchmarks", "examples", "samples"))
757+
758+
// Control build failure behavior on stability changes (default: true)
759+
failOnStabilityChange.set(true)
760+
}
761+
}
762+
```
763+
764+
#### `failOnStabilityChange` Option
765+
766+
By default, `stabilityCheck` will **fail the build** when stability changes are detected. This is ideal for CI/CD pipelines where you want to prevent stability regressions from being merged.
767+
768+
However, in some scenarios you may want to **log warnings instead of failing**:
769+
770+
```kotlin
771+
composeStabilityAnalyzer {
772+
stabilityValidation {
773+
// Log stability changes as warnings instead of failing the build
774+
failOnStabilityChange.set(false)
775+
}
776+
}
777+
```
778+
779+
**When to use `failOnStabilityChange.set(false)`:**
780+
781+
- **Initial adoption**: When first adding stability validation to an existing project, you may want to see all stability issues without blocking builds.
782+
- **Gradual migration**: Allow the team to fix stability issues incrementally while still tracking them.
783+
- **Development branches**: Use warnings during development, but enable strict mode for `main` branch.
784+
- **Monitoring only**: Track stability trends without enforcing them as build requirements.
785+
786+
**Example: Different behavior per environment**
787+
788+
```kotlin
789+
composeStabilityAnalyzer {
790+
stabilityValidation {
791+
// Fail on CI, warn locally
792+
failOnStabilityChange.set(System.getenv("CI") == "true")
757793
}
758794
}
759795
```

0 commit comments

Comments
 (0)