Skip to content

Commit 2fc18bd

Browse files
committed
Update config files with improved bot detection and auto-approvals
1 parent 837c252 commit 2fc18bd

File tree

5 files changed

+63
-12
lines changed

5 files changed

+63
-12
lines changed

docs/downloads/automation-library/integrations/LinearBAI/code-review.cm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ manifest:
33

44
automations:
55
linearb_ai_review:
6+
# Trigger it only when PR is created or has new commits
7+
# Note: explicit triggers are ignored for GitLab or Bitbucket
68
on:
79
- pr_created
810
- commit
@@ -14,4 +16,4 @@ automations:
1416
args:
1517
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
1618

17-
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
19+
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ manifest:
33

44
automations:
55
linearb_ai_description:
6-
# trigger it only when PR is created or has new commits
6+
# Trigger it only when PR is created or has new commits
7+
# Note: explicit triggers are ignored for GitLab or Bitbucket
78
on:
89
- pr_created
910
- commit

docs/downloads/gitStream-gl.cm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ automations:
1010
linearb_ai_review:
1111
if:
1212
- {{ not pr.draft }}
13-
- {{ IS_NOT_A_BOT }}
13+
- {{ not is.bot }}
1414
run:
1515
- action: code-review@v1
16+
args:
17+
approve_on_LGTM: {{ calc.safe_changes }}
1618

1719
# Use LinearB's AI service to add a description to the PR
1820
linearb_ai_description:
1921
if:
2022
- {{ not pr.draft }}
21-
- {{ IS_NOT_A_BOT }}
23+
- {{ not is.bot }}
2224
run:
2325
- action: describe-changes@v1
2426
args:
@@ -64,6 +66,7 @@ automations:
6466

6567
calc:
6668
etr: {{ branch | estimatedReviewTime }}
69+
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}
6770

6871
has:
6972
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
@@ -74,4 +77,9 @@ colors:
7477
yellow: 'fbca04'
7578
green: '0e8a16'
7679

77-
IS_NOT_A_BOT: {{ pr.author | match(list=['_bot_', '[bot]', 'dependabot']) | nope }}
80+
is:
81+
formatting: {{ source.diff.files | isFormattingChange }}
82+
docs: {{ files | allDocs }}
83+
tests: {{ files | allTests }}
84+
image: {{ files | allImages }}
85+
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}

docs/downloads/gitstream-bb.cm

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,27 @@ manifest:
66

77

88
automations:
9-
# Add a comment that indicates how many minutes it will take to review the PR.
9+
# Use LinearB's AI service to review the changes
10+
linearb_ai_review:
11+
if:
12+
- {{ not pr.draft }}
13+
- {{ not is.bot }}
14+
run:
15+
- action: code-review@v1
16+
args:
17+
approve_on_LGTM: {{ calc.safe_changes }}
18+
19+
# Use LinearB's AI service to add a description to the PR
20+
linearb_ai_description:
21+
if:
22+
- {{ not pr.draft }}
23+
- {{ not is.bot }}
24+
run:
25+
- action: describe-changes@v1
26+
args:
27+
concat_mode: append
28+
29+
# Add a label indicating how long it will take to review the PR.
1030
estimated_time_to_review:
1131
if:
1232
- true
@@ -25,15 +45,14 @@ automations:
2545
comment: |
2646
This PR is missing a Jira ticket reference in the title or description.
2747
Please add a Jira ticket reference to the title or description of this PR.
28-
2948
# Post a comment that lists the best experts for the files that were modified.
3049
explain_code_experts:
3150
if:
3251
- true
3352
run:
34-
- action: explain-code-experts@v1
53+
- action: explain-code-experts@v1
3554
args:
36-
gt: 10
55+
gt: 10
3756

3857

3958
# +----------------------------------------------------------------------------+
@@ -43,7 +62,20 @@ automations:
4362

4463
calc:
4564
etr: {{ branch | estimatedReviewTime }}
65+
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}
4666

4767
has:
4868
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
4969
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}
70+
71+
colors:
72+
red: 'b60205'
73+
yellow: 'fbca04'
74+
green: '0e8a16'
75+
76+
is:
77+
formatting: {{ source.diff.files | isFormattingChange }}
78+
docs: {{ files | allDocs }}
79+
tests: {{ files | allTests }}
80+
image: {{ files | allImages }}
81+
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}

docs/downloads/gitstream.cm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ automations:
1313
- commit
1414
if:
1515
- {{ not pr.draft }}
16-
- {{ IS_NOT_A_BOT }}
16+
- {{ not is.bot }}
1717
run:
1818
- action: code-review@v1
19+
args:
20+
approve_on_LGTM: {{ calc.safe_changes }}
1921

2022
# Use LinearB's AI service to add a description to the PR
2123
linearb_ai_description:
@@ -24,7 +26,7 @@ automations:
2426
- commit
2527
if:
2628
- {{ not pr.draft }}
27-
- {{ IS_NOT_A_BOT }}
29+
- {{ not is.bot }}
2830
run:
2931
- action: describe-changes@v1
3032
args:
@@ -74,6 +76,7 @@ automations:
7476

7577
calc:
7678
etr: {{ branch | estimatedReviewTime }}
79+
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}
7780

7881
has:
7982
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
@@ -84,4 +87,9 @@ colors:
8487
yellow: 'fbca04'
8588
green: '0e8a16'
8689

87-
IS_NOT_A_BOT: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | nope }}
90+
is:
91+
formatting: {{ source.diff.files | isFormattingChange }}
92+
docs: {{ files | allDocs }}
93+
tests: {{ files | allTests }}
94+
image: {{ files | allImages }}
95+
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}

0 commit comments

Comments
 (0)