Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/automation-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ automations:
- commit
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: code-review@v1
args:
Expand Down Expand Up @@ -385,7 +385,7 @@ automations:
# skip description for Draft PRs and PRs from bots
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: describe-changes@v1
args:
Expand Down
44 changes: 35 additions & 9 deletions docs/automations/integrations/LinearBAI/code-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,41 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti

* Perform an AI-driven code review and append the review comments to the PR.

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review.cm){ .md-button }
</span>
</div>
=== "For GitHub"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review.cm){ .md-button }
</span>
</div>

=== "For GitLab"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm){ .md-button }
</span>
</div>

=== "For Bitbucket"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources
Expand Down
44 changes: 35 additions & 9 deletions docs/automations/integrations/LinearBAI/describe-pr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,41 @@ Use the [`describe-changes`](/automation-actions/#describe-changes) automation a

* Append the AI-generated description to the PR description.

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr.cm){ .md-button }
</span>
</div>
=== "For GitHub"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr.cm){ .md-button }
</span>
</div>

=== "For GitLab"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm){ .md-button }
</span>
</div>

=== "For Bitbucket"

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
manifest:
version: 1.0

automations:
linearb_ai_review:
if:
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it

APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
manifest:
version: 1.0

automations:
linearb_ai_review:
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it

APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ manifest:

automations:
linearb_ai_review:
# Trigger it only when PR is created or has new commits
on:
- pr_created
- commit
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it

APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
manifest:
version: 1.0

automations:
linearb_ai_description:
# skip description for Draft PRs and PRs from bots
if:
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: describe-changes@v1
args:
concat_mode: append
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
manifest:
version: 1.0

automations:
linearb_ai_description:
# skip description for Draft PRs and PRs from bots
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: describe-changes@v1
args:
concat_mode: append
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ manifest:

automations:
linearb_ai_description:
# trigger it only when PR is created or has new commits
# Trigger it only when PR is created or has new commits
# Note: explicit triggers are ignored for GitLab or Bitbucket
on:
- pr_created
- commit
# skip description for Draft PRs and PRs from bots
if:
- {{ not pr.draft }}
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
run:
- action: describe-changes@v1
args:
Expand Down
14 changes: 11 additions & 3 deletions docs/downloads/gitStream-gl.cm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ automations:
linearb_ai_review:
if:
- {{ not pr.draft }}
- {{ IS_NOT_A_BOT }}
- {{ not is.bot }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ calc.safe_changes }}

# Use LinearB's AI service to add a description to the PR
linearb_ai_description:
if:
- {{ not pr.draft }}
- {{ IS_NOT_A_BOT }}
- {{ not is.bot }}
run:
- action: describe-changes@v1
args:
Expand Down Expand Up @@ -64,6 +66,7 @@ automations:

calc:
etr: {{ branch | estimatedReviewTime }}
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}

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

IS_NOT_A_BOT: {{ pr.author | match(list=['_bot_', '[bot]', 'dependabot']) | nope }}
is:
formatting: {{ source.diff.files | isFormattingChange }}
docs: {{ files | allDocs }}
tests: {{ files | allTests }}
image: {{ files | allImages }}
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
38 changes: 34 additions & 4 deletions docs/downloads/gitstream-bb.cm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@ manifest:


automations:
# Add a comment that indicates how many minutes it will take to review the PR.
# Use LinearB's AI service to review the changes
linearb_ai_review:
if:
- {{ not is.bot }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ calc.safe_changes }}

# Use LinearB's AI service to add a description to the PR
linearb_ai_description:
if:
- {{ not is.bot }}
run:
- action: describe-changes@v1
args:
concat_mode: append

# Add a label indicating how long it will take to review the PR.
estimated_time_to_review:
if:
- true
Expand All @@ -25,15 +43,14 @@ automations:
comment: |
This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

# Post a comment that lists the best experts for the files that were modified.
explain_code_experts:
if:
- true
run:
- action: explain-code-experts@v1
- action: explain-code-experts@v1
args:
gt: 10
gt: 10


# +----------------------------------------------------------------------------+
Expand All @@ -43,7 +60,20 @@ automations:

calc:
etr: {{ branch | estimatedReviewTime }}
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}

has:
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}

colors:
red: 'b60205'
yellow: 'fbca04'
green: '0e8a16'

is:
formatting: {{ source.diff.files | isFormattingChange }}
docs: {{ files | allDocs }}
tests: {{ files | allTests }}
image: {{ files | allImages }}
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
14 changes: 11 additions & 3 deletions docs/downloads/gitstream.cm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ automations:
- commit
if:
- {{ not pr.draft }}
- {{ IS_NOT_A_BOT }}
- {{ not is.bot }}
run:
- action: code-review@v1
args:
approve_on_LGTM: {{ calc.safe_changes }}

# Use LinearB's AI service to add a description to the PR
linearb_ai_description:
Expand All @@ -24,7 +26,7 @@ automations:
- commit
if:
- {{ not pr.draft }}
- {{ IS_NOT_A_BOT }}
- {{ not is.bot }}
run:
- action: describe-changes@v1
args:
Expand Down Expand Up @@ -74,6 +76,7 @@ automations:

calc:
etr: {{ branch | estimatedReviewTime }}
safe_changes: {{ is.formatting or is.docs or is.tests or is.image }}

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

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