diff --git a/docs/automation-actions.md b/docs/automation-actions.md index 0bdcafcc0..7dde8c868 100644 --- a/docs/automation-actions.md +++ b/docs/automation-actions.md @@ -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: @@ -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: diff --git a/docs/automations/integrations/LinearBAI/code-review/README.md b/docs/automations/integrations/LinearBAI/code-review/README.md index 70e5ddc95..574ea08db 100644 --- a/docs/automations/integrations/LinearBAI/code-review/README.md +++ b/docs/automations/integrations/LinearBAI/code-review/README.md @@ -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" - ``` -
- - [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review.cm){ .md-button } - -
+=== "For GitHub" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review.cm){ .md-button } + +
+ +=== "For GitLab" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm){ .md-button } + +
+ +=== "For Bitbucket" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm){ .md-button } + +
## Additional Resources diff --git a/docs/automations/integrations/LinearBAI/describe-pr/README.md b/docs/automations/integrations/LinearBAI/describe-pr/README.md index d646ebbfc..c44668457 100644 --- a/docs/automations/integrations/LinearBAI/describe-pr/README.md +++ b/docs/automations/integrations/LinearBAI/describe-pr/README.md @@ -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" - ``` -
- - [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr.cm){ .md-button } - -
+=== "For GitHub" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr.cm){ .md-button } + +
+ +=== "For GitLab" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm){ .md-button } + +
+ +=== "For Bitbucket" + + !!! example "Configuration Example" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm){ .md-button } + +
## Additional Resources diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm new file mode 100644 index 000000000..5b8664813 --- /dev/null +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm @@ -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 diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm new file mode 100644 index 000000000..b69460859 --- /dev/null +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm @@ -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 diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm index bbd213951..2b97d42c0 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm @@ -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 \ No newline at end of file +APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users diff --git a/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm new file mode 100644 index 000000000..703acce0d --- /dev/null +++ b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm @@ -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 diff --git a/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm new file mode 100644 index 000000000..d51ac49a6 --- /dev/null +++ b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm @@ -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 diff --git a/docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm index 9da1d05cc..bc4dd3d55 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm @@ -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: diff --git a/docs/downloads/gitStream-gl.cm b/docs/downloads/gitStream-gl.cm index f23bed214..1aad79ddb 100644 --- a/docs/downloads/gitStream-gl.cm +++ b/docs/downloads/gitStream-gl.cm @@ -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: @@ -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/) }} @@ -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 }} diff --git a/docs/downloads/gitstream-bb.cm b/docs/downloads/gitstream-bb.cm index 030f7dc2b..1edce76b9 100644 --- a/docs/downloads/gitstream-bb.cm +++ b/docs/downloads/gitstream-bb.cm @@ -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 @@ -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 # +----------------------------------------------------------------------------+ @@ -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 }} diff --git a/docs/downloads/gitstream.cm b/docs/downloads/gitstream.cm index 9a8626702..e86f0c5ec 100644 --- a/docs/downloads/gitstream.cm +++ b/docs/downloads/gitstream.cm @@ -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: @@ -24,7 +26,7 @@ automations: - commit if: - {{ not pr.draft }} - - {{ IS_NOT_A_BOT }} + - {{ not is.bot }} run: - action: describe-changes@v1 args: @@ -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/) }} @@ -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 }}