Skip to content

Commit f2ce786

Browse files
authored
Merge branch 'main' into main
2 parents bb47540 + 9ed54a8 commit f2ce786

File tree

6 files changed

+104
-102
lines changed

6 files changed

+104
-102
lines changed

docs/automation-actions.md

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ For all other actions, gitStream executes the actions in the order they are list
3030
- [`approve`](#approve) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3131
- [`close`](#close) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3232
- [`code-review`](#code-review) :fontawesome-brands-github: <!-- :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
33+
- [`describe-changes`](#describe-changes) :fontawesome-brands-github: <!-- :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
3334
- [`explain-code-experts`](#explain-code-experts) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3435
- [`merge`](#merge) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3536
- [`request-changes`](#request-changes) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
@@ -245,31 +246,6 @@ automations:
245246
comment: "Please make sure this change request is documented before merging"
246247
```
247248

248-
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
249-
250-
This action, shall add a comment with codeExperts suggestion. If the comment already exists, the comment shall be edited.
251-
252-
<div class="filter-details" markdown=1>
253-
254-
| Args | Usage | Type | Description |
255-
| -----------|------|-----|------------------------------------------------ |
256-
| `lt` | Optional | Integer | Filter the user list, keeping those below the specified threshold |
257-
| `gt` | Optional | Integer | Filter the user list, keeping those above the specified threshold |
258-
| `verbose` | Optional| Bool | When set to false then only shows the suggestion summary and skips the per file details (true by default) |
259-
260-
</div>
261-
262-
```yaml+jinja title="example"
263-
automations:
264-
code_experts:
265-
if:
266-
- true
267-
run:
268-
- action: explain-code-experts@v1
269-
args:
270-
gt: 10
271-
```
272-
273249
#### `approve` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
274250

275251
This action, once triggered, approves the PR for merge.
@@ -305,7 +281,7 @@ automations:
305281

306282
#### `code-review` :fontawesome-brands-github: <!-- >:fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
307283

308-
This action, once triggered, reviews the code in the PR, and generates a comment with the identified issue, bugs, misconfigurations, and bad practices in the newly introduced code, with an option to approve the PR if no issues were found.
284+
This action, once triggered, reviews the code in the PR, and generates a comment with the identified issue, bugs, misconfigurations, and bad practices in the newly introduced code, with an option to approve the PR if no issues were found.
309285

310286
<div class="filter-details" markdown=1>
311287

@@ -333,6 +309,63 @@ automations:
333309
APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users
334310
```
335311

312+
#### `describe-changes` :fontawesome-brands-github:
313+
314+
This action, once triggered, leverages AI to generate a comprehensive summary of the changes in the PR and incorporates it into the PR description.
315+
316+
The action automatically analyzes the code modifications to create a clear, high-level overview of what has been changed, making it easier for reviewers to understand the scope and purpose of the PR.
317+
318+
<div class="filter-details" markdown=1>
319+
320+
| Args | Usage | Type | Description |
321+
| ------------ | -------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
322+
| `concat_mode` | Optional | String | By default `replace`. The mode to add the changes description, can be `replace`, `append`, or `prepend` to the PR description |
323+
324+
</div>
325+
326+
```yaml+jinja title="example"
327+
automations:
328+
pr_description:
329+
# trigger it only when PR is created or has new commits.
330+
on:
331+
- pr_created
332+
- commit
333+
# Skip description for Draft PRs and PRs from bots.
334+
if:
335+
- {{ not pr.draft }}
336+
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
337+
run:
338+
- action: describe-changes@v1
339+
args:
340+
concat_mode: append
341+
```
342+
343+
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
344+
345+
This action, shall add a comment with codeExperts suggestion. If the comment already exists, the comment shall be edited.
346+
347+
<div class="filter-details" markdown=1>
348+
349+
| Args | Usage | Type | Description |
350+
| -----------|------|-----|------------------------------------------------ |
351+
| `lt` | Optional | Integer | Filter the user list, keeping those below the specified threshold |
352+
| `gt` | Optional | Integer | Filter the user list, keeping those above the specified threshold |
353+
| `verbose` | Optional| Bool | When set to false then only shows the suggestion summary and skips the per file details (true by default) |
354+
355+
</div>
356+
357+
```yaml+jinja title="example"
358+
automations:
359+
code_experts:
360+
if:
361+
- true
362+
run:
363+
- action: explain-code-experts@v1
364+
args:
365+
gt: 10
366+
```
367+
368+
336369
#### `merge` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
337370

338371
Once triggered, merge the PR if possible. It can be set to wait for all checks to pass or only required ones.

docs/automations/integrations/LinearBAI/describe-pr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ starter_kits: [genai]
77
# Add PR Description Using LinearB's AI :material-star-circle:
88

99
<!-- --8<-- [start:example]-->
10-
Use the `AI_DescribePR` filter to automatically generate and append a concise, AI-generated description to a pull request. This ensures that all PRs include meaningful and helpful descriptions, improving review efficiency.
10+
Use the [`describe-changes`](/automation-actions/#describe-changes) automation action to automatically generate and append a concise, AI-generated description to a pull request. This ensures that all PRs include meaningful and helpful descriptions, improving review efficiency.
1111

1212
![summarized-pr](/automations/integrations/LinearBAI/describe-pr/LinearB-AI-describe-pr.png)
1313

docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ manifest:
22
version: 1.0
33

44
automations:
5-
add_pr_description:
5+
pr_description:
6+
# trigger it only when PR is created or has new commits.
67
on:
78
- pr_created
89
- commit
10+
# Skip description for Draft PRs and PRs from bots.
911
if:
12+
- {{ not pr.draft }}
1013
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
1114
run:
12-
- action: update-description@v1
15+
- action: describe-changes@v1
1316
args:
1417
concat_mode: append
15-
description: {{ source | AI_DescribePR }}

docs/filter-functions.md

Lines changed: 33 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ The following functions are supported in addition to the built-in functions prov
4242

4343
| Function | Input | Args | Output |
4444
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- | -------------------------------------------------- | ----------------------- |
45-
| [`AI_DescribePR`](#ai_describepr) :material-star-circle:{ title="Premium feature" } <br />Returns an AI-generated description of the PR based on the provided input diff | Object | - | String |
4645
| [`allDocs`](#alldocs)<br />Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool |
4746
| [`allImages`](#allimages)<br />Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool |
4847
| [`allTests`](#alltests)<br />Checks the list includes only tests | [`files`](./context-variables.md#files) | - | Bool |
@@ -316,38 +315,6 @@ Checks whether any element in the list is `true`. In case the list of elements
316315
{{ files | match(list=['src', 'dest']) | some }}
317316
```
318317

319-
#### `AI_DescribePR` :material-star-circle: { title="Premium feature" }
320-
321-
!!! note "Premium Feature"
322-
This filter uses LinearB’s AI service and is available exclusively for paid accounts.
323-
324-
If you’re interested in unlocking this feature, [contact our sales team](https://linearb.io/book-a-demo) to learn more.
325-
326-
Leverage LinearB's AI to assist with generating a concise and meaningful description for pull requests based on the provided context. Streamline the review process by summarizing the purpose and key changes in a PR, reducing the manual effort and cognitive load for developers and reviewers.
327-
328-
| **Argument** | Usage | **Type** | **Description** |
329-
| ------------ | ------ | -------- | ---------------------------------------------------------------------- |
330-
| - | Input | `Object` | The context to send to the AI for generating a description. |
331-
| - | Output | String | AI-generated description of the PR based on the provided input context |
332-
333-
Use the `AI_DescribePR` filter in a `.cm` file to append the AI-generated description to the PR description on each non-bot commit:
334-
335-
```yaml
336-
automations:
337-
add_pr_description:
338-
on:
339-
- pr_created
340-
- commit
341-
if:
342-
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
343-
run:
344-
- action: update-description@v1
345-
args:
346-
concat_mode: append
347-
description: {{ source | AI_DescribePR }}
348-
349-
```
350-
351318
#### `allDocs`
352319

353320
Return `true` if the input list includes only documents based on file extensions.
@@ -985,40 +952,40 @@ README_CONTENT: {{ "./README.md" | readFile() }}
985952

986953
Read JSON configuration file from the `cm` repo and use some of the properties in a comment:
987954
```
988-
automations:
989-
describe_teams:
990-
if:
991-
- {{ true }}
992-
run:
993-
- action: add-comment@v1
994-
args:
995-
comment: |
996-
We have {{ TEAMS | length }} teams with {{ TEAMS.front.members | length + TEAMS.back.members | length }} members in total:
997-
FrontEnd: include {{ TEAMS.front.members | length }} members
998-
BackEnd: include {{ TEAMS.back.members | length }} members
999-
1000-
1001-
TEAMS: {{ "../cm/TEAMS.json" | readFile(output="json") }}
955+
automations:
956+
describe_teams:
957+
if:
958+
- {{ true }}
959+
run:
960+
- action: add-comment@v1
961+
args:
962+
comment: |
963+
We have {{ TEAMS | length }} teams with {{ TEAMS.front.members | length + TEAMS.back.members | length }} members in total:
964+
FrontEnd: include {{ TEAMS.front.members | length }} members
965+
BackEnd: include {{ TEAMS.back.members | length }} members
966+
967+
968+
TEAMS: {{ "../cm/TEAMS.json" | readFile(output="json") }}
1002969
```
1003970

1004971
Configuration file example:
1005972
``` JSON
1006-
{
1007-
"front": {
1008-
"name": "Frontend",
1009-
"description": "Frontend team",
1010-
"members": [
1011-
"John",
1012-
"Jane"
1013-
]
1014-
},
1015-
"back": {
1016-
"name": "Backend",
1017-
"description": "Backend team",
1018-
"members": [
1019-
"Alice",
1020-
"Bob"
1021-
]
1022-
}
1023-
}
1024-
```
973+
{
974+
"front": {
975+
"name": "Frontend",
976+
"description": "Frontend team",
977+
"members": [
978+
"John",
979+
"Jane"
980+
]
981+
},
982+
"back": {
983+
"name": "Backend",
984+
"description": "Backend team",
985+
"members": [
986+
"Alice",
987+
"Bob"
988+
]
989+
}
990+
}
991+
```

docs/integrations/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ visible: false
66
# gitStream Integrations
77
<!-- --8<-- [start:integrations]-->
88
<div class="integrations-list" markdown="1">
9-
9+
1010
<div class="integrations-card" markdown="1">
1111
<div class="integrations-card-title" markdown="1">
1212
<a href=/integrations/linearb>![LinearB](/downloads/images/linearb-symbol-dark.png#only-light) ![LinearB](/downloads/images/linearb-symbol-white.png#only-dark) LinearB</a>
@@ -21,7 +21,7 @@ visible: false
2121

2222
<div class="integrations-card" markdown="1">
2323
<div class="integrations-card-title" markdown="1">
24-
[:fontawesome-solid-wand-magic-sparkles: askAI](/integrations/askAI)
24+
[:fontawesome-solid-wand-magic-sparkles: Bring Your Own AI](/integrations/askAI)
2525
</div>
2626
</div>
2727

docs/integrations/askAI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Integrate gitStream with AI
2+
title: Integrate gitStream with Your Own AI
33
description: Use gitStream to integrate with AI services for Review, describe and add tests.
44
category: [quality, genai, copilot, tests, efficiency]
55
---
6-
# Integrate gitStream with AI
6+
# Integrate gitStream with your own AI
77

88
<!-- --8<-- [start:examples]-->
99
!!! warning "Required gitStream Plugins"
10-
This example requires you to install the [`askAI`](/filter-function-plugins/#askai) plugin.
10+
To use these examples, you need to install the [`askAI`](/filter-function-plugins/#askai) plugin and provide your own AI service API key.
1111

1212
[Learn more about gitStream plugins](/plugins/).
1313

@@ -40,4 +40,4 @@ category: [quality, genai, copilot, tests, efficiency]
4040

4141
--8<-- "docs/snippets/general.md"
4242

43-
--8<-- "docs/snippets/automation-footer.md"
43+
--8<-- "docs/snippets/automation-footer.md"

0 commit comments

Comments
 (0)