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
Copy file name to clipboardExpand all lines: docs/automation-actions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -500,6 +500,10 @@ automations:
500
500
501
501
For more information about the `codeExperts` filter function, see the [filter functions documentation](https://docs.gitstream.cm/filter-functions/#codeexperts).
502
502
503
+
!!! tip "Limit git history for code experts"
504
+
505
+
Use the [`config.git_history_since`](./cm-file.md#configgit_history_since) configuration to limit the git history analysis to commits after a specific date. This is useful for team transitions or when you want to focus on recent contributors only.
|`config`| Map | - | per `.cm` file | Root configuration section, applies to the automations defined in the current file. |
177
+
|`config.admin.users`|[String]|`[]`|`gitstream.cm`| List of admin users, identified by Git provider usernames. |
178
+
|`config.git_history_since`| String | - | per `.cm` file | Limit git history analysis to commits after the specified date (YYYY-MM-DD). |
179
+
|`config.ignore_files`|[String]|`[]`| per `.cm` file | Files to exclude from consideration. |
180
+
|`config.user_mapping`|[String: String]|`[]`| per `.cm` file | Map Git user details to provider account names. |
180
181
181
182
##### `config.admin.users`
182
183
@@ -247,6 +248,46 @@ On the other hand, when using `explainRankByGitBlame` with `add-comment@v1` it s
247
248
1. `rankByGitBlame` will drop `null` users
248
249
2. `explainRankByGitBlame` will NOT drop `null` users
249
250
251
+
##### `config.git_history_since`
252
+
253
+
The `config.git_history_since` configuration limits how far back gitStream looks in git history when analyzing code expertise and git blame results. This affects filters and actions that rely on git history analysis, including:
254
+
255
+
- `codeExperts`filter
256
+
- `rankByGitBlame`filter
257
+
- `explainRankByGitBlame`filter
258
+
- `explain-code-experts`action
259
+
260
+
When `git_history_since` is configured, gitStream will only consider commits made on or after the specified date when determining code experts and calculating git blame rankings. This is particularly useful for:
261
+
262
+
- **Team transitions**: When a project changes hands between teams, you can set the date to when the new team took over to ensure only current team members are suggested as reviewers
263
+
- **Performance optimization**: Large repositories with extensive history can benefit from limiting the analysis scope
264
+
- **Relevant expertise**: Focus on recent contributions rather than legacy code changes
265
+
266
+
The value should be specified as a date in `YYYY-MM-DD` format.
267
+
268
+
```yaml title="example"
269
+
config:
270
+
git_history_since: '2025-01-01' # Only consider commits from January 1, 2025 onwards
271
+
```
272
+
273
+
**Example use case**: If your team took over a project on January 1, 2025, and you want to ensure that only current team members are suggested as code experts:
274
+
275
+
```yaml title=".cm/gitstream.cm"
276
+
config:
277
+
git_history_since: '2025-01-01'
278
+
279
+
automations:
280
+
assign_code_experts:
281
+
if:
282
+
- {{ files | codeExperts(gt=10) | length > 0 }}
283
+
run:
284
+
- action: add-reviewers@v1
285
+
args:
286
+
reviewers: {{ files | codeExperts(gt=10) }}
287
+
```
288
+
289
+
With this configuration, the `codeExperts` filter will only analyze git blame data from commits made on or after January 1, 2025, effectively filtering out previous team members from reviewer suggestions.
290
+
250
291
#### `triggers`
251
292
252
293
The `triggers` is section specifies when automations are executed, supporting `include` and `exclude` lists for branch and repository patterns at the file level. The `on` keyword can also be used within individual automations to define specific events that trigger those automations.
Copy file name to clipboardExpand all lines: docs/filter-functions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -415,6 +415,10 @@ automations:
415
415
reviewers: {{ repo | codeExperts(gt=10) }}
416
416
```
417
417
418
+
!!! tip "Limit git history for code experts"
419
+
420
+
Use the [`config.git_history_since`](./cm-file.md#configgit_history_since) configuration to limit the git history analysis to commits after a specific date. This is useful for team transitions or when you want to focus on recent contributors only.
421
+
418
422
#### `decode`
419
423
420
424
Decode Base64 encoded string into an object. Encoded strings are formatted: `"base64: <encoded_string>"`
0 commit comments