From 12df526c150af42af0ca01009971fb1f1d867b05 Mon Sep 17 00:00:00 2001 From: Vincent Lussenburg Date: Thu, 4 Dec 2025 11:51:10 -0800 Subject: [PATCH 1/2] Refactor automation settings in gitstream-bb.cm Updated automation configurations to enhance code review and PR description processes. --- docs/downloads/gitstream-bb.cm | 83 +++++++++++++--------------------- 1 file changed, 32 insertions(+), 51 deletions(-) diff --git a/docs/downloads/gitstream-bb.cm b/docs/downloads/gitstream-bb.cm index 8a9756bd..37a93386 100644 --- a/docs/downloads/gitstream-bb.cm +++ b/docs/downloads/gitstream-bb.cm @@ -1,82 +1,63 @@ # -*- mode: yaml -*- -# This example configuration provides basic automations to get started with gitStream. -# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/ manifest: version: 1.0 - automations: - # Use LinearB's AI service to review the changes - linearb_ai_review: + linearb_ai_codereview: if: - - {{ not pr.draft }} - - {{ not (is.bot_author or is.bot_branch) }} + - {{ not is.bot }} run: - action: code-review@v1 args: - approve_on_LGTM: {{ calc.safe_changes }} + guidelines: | + - Highlight **critical issues** only (correctness/logic, performance, security, maintainability blockers). + - Skip nitpicks; ignore null-reference risks that are known to be validated earlier in this code path. + - Keep suggestions short and actionable. - # Use LinearB's AI service to add a description to the PR - linearb_ai_description: + pr_policy_low_noise: if: - {{ not pr.draft }} - - {{ not (is.bot_author or is.bot_branch) }} + - {{ not is.bot }} run: + # AI description (updates PR body; not a comment) - 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 - run: - - action: add-comment@v1 + # Assign reviewers silently + - action: add-reviewers@v1 args: - comment: "{{ calc.etr }} min review" + reviewers: {{ who.experts }} - # Request changes by PR authors when they fail to reference Jira tickets in the PR title or description. - request_missing_jira_info: - if: - - {{ not (has.jira_ticket_in_title or has.jira_ticket_in_desc) }} - run: - - action: request-changes@v1 + # ONE consolidated, updatable comment + - action: add-comment@v1 args: 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 - args: - gt: 10 + ## gitStream Summary — Low Noise (Staff Engineer focus) + **AI PR Description:** Updated in the PR body above. + **ETR:** {{ calc.etr }} min review + **Unresolved threads:** {{ pr.unresolved_threads | default(value=0) }} + **JIRA:** {{ '✅ Found in title/description.' if (has.jira_ticket_in_title or has.jira_ticket_in_desc) else '⚠️ Missing Jira ticket. Please add one (e.g., `ABC-123` or an `atlassian.net/browse/...` link).' }} -# +----------------------------------------------------------------------------+ -# | Custom Expressions | -# | https://docs.gitstream.cm/how-it-works/#custom-expressions | -# +----------------------------------------------------------------------------+ + ### Suggested Reviewers (auto-assigned) + {{ who.experts }} +# ----------------- config ----------------- 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}/) }} + jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z][A-Za-z0-9_]+-\d+\b/) }} + jira_ticket_in_desc: {{ pr.description | includes(regex=r/\b[A-Za-z][A-Za-z0-9_]+-\d+\b/) }} -colors: - red: 'b60205' - yellow: 'fbca04' - green: '0e8a16' +who: + experts: {{ repo | codeExperts(gt=10, top=5) }} is: - formatting: {{ source.diff.files | isFormattingChange }} - docs: {{ files | allDocs }} - tests: {{ files | allTests }} - image: {{ files | allImages }} - bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }} - bot_branch: {{ branch.name | match(list=['renovate/']) | some }} + bot: {{ pr.author | match(list=['github-actions','_bot_','[bot]','dependabot','gitstream-cm','prvalidation','aida-bot']) | some }} + +colors: + red: 'b60205' + yellow: 'fbca04' + green: '0e8a16' From 359ae8310cc5eca7e6419fbfcb3feca586b36b6f Mon Sep 17 00:00:00 2001 From: Vincent Lussenburg Date: Thu, 4 Dec 2025 11:51:55 -0800 Subject: [PATCH 2/2] Refactor AI service actions and comments in config Updated AI service actions and added consolidated comments for PRs. --- docs/downloads/gitStream-gl.cm | 85 +++++++++++++--------------------- 1 file changed, 31 insertions(+), 54 deletions(-) diff --git a/docs/downloads/gitStream-gl.cm b/docs/downloads/gitStream-gl.cm index 2557eeba..37a93386 100644 --- a/docs/downloads/gitStream-gl.cm +++ b/docs/downloads/gitStream-gl.cm @@ -1,86 +1,63 @@ # -*- mode: yaml -*- -# This example configuration provides basic automations to get started with gitStream. -# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/ manifest: version: 1.0 - automations: - # Use LinearB's AI service to review the changes - linearb_ai_review: + linearb_ai_codereview: if: - - {{ not pr.draft }} - {{ not is.bot }} run: - action: code-review@v1 args: - approve_on_LGTM: {{ calc.safe_changes }} + guidelines: | + - Highlight **critical issues** only (correctness/logic, performance, security, maintainability blockers). + - Skip nitpicks; ignore null-reference risks that are known to be validated earlier in this code path. + - Keep suggestions short and actionable. - # Use LinearB's AI service to add a description to the PR - linearb_ai_description: + pr_policy_low_noise: if: - {{ not pr.draft }} - - {{ not (is.bot_author or is.bot_branch) }} + - {{ not is.bot }} run: + # AI description (updates PR body; not a comment) - 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 - run: - - action: add-label@v1 + # Assign reviewers silently + - action: add-reviewers@v1 args: - label: "{{ calc.etr }} min review" - color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }} - # Inform PR authors when they fail to reference Jira tickets in the PR title or description. - label_missing_jira_info: - if: - - {{ not (has.jira_ticket_in_title or has.jira_ticket_in_desc) }} - run: - - action: add-label@v1 - args: - label: "missing-jira" - color: {{ colors.red }} + reviewers: {{ who.experts }} + + # ONE consolidated, updatable comment - action: add-comment@v1 args: 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 - args: - gt: 10 + ## gitStream Summary — Low Noise (Staff Engineer focus) + **AI PR Description:** Updated in the PR body above. + **ETR:** {{ calc.etr }} min review + **Unresolved threads:** {{ pr.unresolved_threads | default(value=0) }} + **JIRA:** {{ '✅ Found in title/description.' if (has.jira_ticket_in_title or has.jira_ticket_in_desc) else '⚠️ Missing Jira ticket. Please add one (e.g., `ABC-123` or an `atlassian.net/browse/...` link).' }} -# +----------------------------------------------------------------------------+ -# | Custom Expressions | -# | https://docs.gitstream.cm/how-it-works/#custom-expressions | -# +----------------------------------------------------------------------------+ + ### Suggested Reviewers (auto-assigned) + {{ who.experts }} +# ----------------- config ----------------- 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}/) }} + jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z][A-Za-z0-9_]+-\d+\b/) }} + jira_ticket_in_desc: {{ pr.description | includes(regex=r/\b[A-Za-z][A-Za-z0-9_]+-\d+\b/) }} -colors: - red: 'b60205' - yellow: 'fbca04' - green: '0e8a16' +who: + experts: {{ repo | codeExperts(gt=10, top=5) }} is: - formatting: {{ source.diff.files | isFormattingChange }} - docs: {{ files | allDocs }} - tests: {{ files | allTests }} - image: {{ files | allImages }} - bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }} - bot_branch: {{ branch.name | match(list=['renovate/']) | some }} + bot: {{ pr.author | match(list=['github-actions','_bot_','[bot]','dependabot','gitstream-cm','prvalidation','aida-bot']) | some }} + +colors: + red: 'b60205' + yellow: 'fbca04' + green: '0e8a16'