Skip to content

Commit 9ed54a8

Browse files
authored
Merge pull request #667 from linear-b/rm-ai_descripe_pr-filter
Update PR description docs to use describe-changes action
2 parents e4b8727 + 0c67761 commit 9ed54a8

File tree

3 files changed

+39
-70
lines changed

3 files changed

+39
-70
lines changed

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+
```

0 commit comments

Comments
 (0)