You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add automatic version bump detection to bit ci merge (teambit#9838)
Enhances `bit ci merge` command with automatic version bump detection
from commit messages, eliminating the need to manually specify version
flags in many cases.
**Auto-detection priority:**
1. **Explicit keywords**: `BIT-BUMP-MAJOR`, `BIT-BUMP-MINOR` in commit
message
2. **Conventional commits**: `feat\!:`/`BREAKING CHANGE` → major,
`feat:` → minor, `fix:` → patch
3. **Default**: patch version bump
**Key features:**
- Only triggers when no explicit version flags (`--patch`, `--minor`,
`--major`) are provided
- Configurable via `useConventionalCommitsForVersionBump` and
`useExplicitBumpKeywords` in workspace.jsonc
- Includes CircleCI wrapper script for environment variable support
(`VERSION_BUMP_TYPE`)
- Comprehensive documentation with examples
Copy file name to clipboardExpand all lines: scopes/git/ci/ci.docs.mdx
+88-11Lines changed: 88 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,25 @@ bit ci merge [--message <string>] [--build] [--increment <level>] [--patch|--min
96
96
|`--prerelease-id`|| Prerelease identifier (e.g. "dev" to get "1.0.0-dev.1"). |
97
97
|`--increment-by`|| Increment by more than 1 (e.g. `--increment-by 2` with patch: 0.0.1 → 0.0.3). |
98
98
99
+
### Automatic Version Bump Detection
100
+
101
+
When **no explicit version flags** are provided, `bit ci merge` can automatically determine the version bump level from the commit message:
102
+
103
+
1.**Explicit Keywords** (highest priority):
104
+
105
+
-`BIT-BUMP-MAJOR` anywhere in commit message → major version bump
106
+
-`BIT-BUMP-MINOR` anywhere in commit message → minor version bump
107
+
108
+
2.**Conventional Commits** (when enabled):
109
+
110
+
-`feat!:` or `BREAKING CHANGE` → major version bump
111
+
-`feat:` → minor version bump
112
+
-`fix:` → patch version bump
113
+
114
+
3.**Default**: patch version bump
115
+
116
+
**Note**: Auto-detection only occurs when no version flags (`--patch`, `--minor`, `--major`, etc.) are provided. Explicit flags always take precedence.
117
+
99
118
### Internal flow
100
119
101
120
1.**Ensure main lane**
@@ -123,20 +142,34 @@ bit ci merge [--message <string>] [--build] [--increment <level>] [--patch|--min
123
142
### Version bump examples
124
143
125
144
```bash
126
-
# Default patch increment (1.0.0 → 1.0.1)
127
-
bit ci merge --message "fix: resolve memory leak"
128
-
129
-
# Minor version bump (1.0.0 → 1.1.0)
145
+
# Explicit version bump (takes precedence over auto-detection)
130
146
bit ci merge --minor --message "feat: add new API endpoint"
131
-
132
-
# Major version bump (1.0.0 → 2.0.0)
133
147
bit ci merge --major --message "feat!: breaking API changes"
148
+
bit ci merge --patch --increment-by 3 --message "fix: critical patches"
134
149
135
-
# Prerelease increment (1.0.0 → 1.0.1-dev.1)
136
-
bit ci merge --pre-release dev --message "feat: experimental feature"
150
+
# Automatic detection from commit message (no flags needed)
151
+
git commit -m "feat: add new API endpoint"
152
+
bit ci merge --build # → auto-detects minor bump
137
153
138
-
# Custom increment amount (1.0.0 → 1.0.3)
139
-
bit ci merge --patch --increment-by 3 --message "fix: critical patches"
154
+
git commit -m "feat!: breaking API changes"
155
+
bit ci merge --build # → auto-detects major bump
156
+
157
+
git commit -m "fix: resolve memory leak"
158
+
bit ci merge --build # → auto-detects patch bump (if conventional commits enabled)
159
+
160
+
# Using explicit keywords for auto-detection
161
+
git commit -m "feat: add new feature BIT-BUMP-MINOR"
162
+
bit ci merge --build # → auto-detects minor bump
163
+
164
+
git commit -m "refactor: major code restructure BIT-BUMP-MAJOR"
165
+
bit ci merge --build # → auto-detects major bump
166
+
167
+
# Default patch increment (when no detection rules match)
168
+
git commit -m "chore: update dependencies"
169
+
bit ci merge --build # → defaults to patch bump
170
+
171
+
# Prerelease increment (explicit flag required)
172
+
bit ci merge --pre-release dev --message "feat: experimental feature"
140
173
```
141
174
142
175
### CI hint
@@ -152,7 +185,9 @@ The CI aspect supports configuration in `workspace.jsonc`:
0 commit comments