From 39243bd927a9b242126e5f56d3388dce00a06b08 Mon Sep 17 00:00:00 2001 From: Ofer Affias Date: Fri, 23 May 2025 08:10:35 +0300 Subject: [PATCH 1/4] Add JavaScript naming conventions to code review guidelines --- docs/automation-actions.md | 7 ++++--- .../integrations/LinearBAI/code-review/README.md | 1 + .../integrations/LinearBAI/code-review.cm | 11 ++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/automation-actions.md b/docs/automation-actions.md index 7dde8c868..8ef187024 100644 --- a/docs/automation-actions.md +++ b/docs/automation-actions.md @@ -304,14 +304,15 @@ automations: args: approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it guidelines: {{ GUIDELINES | dump }} -... -... + # Define variables APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users GUIDELINES: | - Don't comment on using outdated dependencies - + - In Javascript + - Make sure camelCase is used for variable names + - Make sure PascalCase is used for class names ``` The following files are automatically excluded from the code review. diff --git a/docs/automations/integrations/LinearBAI/code-review/README.md b/docs/automations/integrations/LinearBAI/code-review/README.md index 574ea08db..a43783271 100644 --- a/docs/automations/integrations/LinearBAI/code-review/README.md +++ b/docs/automations/integrations/LinearBAI/code-review/README.md @@ -22,6 +22,7 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti Automation Actions: * Perform an AI-driven code review and append the review comments to the PR. + * Use `guidelines` to add your prompts to the team or org review === "For GitHub" diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm index 2b97d42c0..58d884054 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm @@ -14,5 +14,14 @@ automations: - action: code-review@v1 args: approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it + guidelines: {{ GUIDELINES }} -APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users +# Define variables +# Add conditions for PR approvals. For example - allow approval only for specific users +APPROVE_PR_ON_LGTM: false + +# Add `guideline` to add your prompts to the review, you can have org wide instructions +# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to +# the team repo. +# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` +GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }} From 6d42a24f1b38c7c3430934f311e7e9dc298daebd Mon Sep 17 00:00:00 2001 From: Ofer Affias Date: Fri, 23 May 2025 08:21:18 +0300 Subject: [PATCH 2/4] 1. review before description 2. add guidelines example to GL and BB --- .../integrations/LinearBAI/code-review-bb.cm | 11 ++++++++++- .../integrations/LinearBAI/code-review-gl.cm | 11 ++++++++++- docs/integrations/LB_AI.md | 8 ++++---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm index 5b8664813..28cd6590e 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm @@ -9,5 +9,14 @@ automations: - action: code-review@v1 args: approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it + guidelines: {{ GUIDELINES }} -APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users +# Define variables +# Add conditions for PR approvals. For example - allow approval only for specific users +APPROVE_PR_ON_LGTM: false + +# Add `guideline` to add your prompts to the review, you can have org wide instructions +# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to +# the team repo. +# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` +GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }} diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm index b69460859..1c8160c1e 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm @@ -10,5 +10,14 @@ automations: - action: code-review@v1 args: approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it + guidelines: {{ GUIDELINES }} -APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users +# Define variables +# Add conditions for PR approvals. For example - allow approval only for specific users +APPROVE_PR_ON_LGTM: false + +# Add `guideline` to add your prompts to the review, you can have org wide instructions +# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to +# the team repo. +# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` +GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }} diff --git a/docs/integrations/LB_AI.md b/docs/integrations/LB_AI.md index 0441c4b8a..d6e2e05a4 100644 --- a/docs/integrations/LB_AI.md +++ b/docs/integrations/LB_AI.md @@ -9,14 +9,14 @@ category: [quality, genai, copilot, tests, efficiency] ## Automation Examples -### Add PR Description Using LinearB's AI :material-star-circle: - ---8<-- "docs/automations/integrations/LinearBAI/describe-pr/README.md:example" - ### Use LinearB's AI for a comprehensive Code Review :material-star-circle: --8<-- "docs/automations/integrations/LinearBAI/code-review/README.md:example" +### Add PR Description Using LinearB's AI :material-star-circle: + +--8<-- "docs/automations/integrations/LinearBAI/describe-pr/README.md:example" + ## Additional Resources --8<-- "docs/snippets/general.md" From f7756deb9442046448ec75a3c77e4c0301544a69 Mon Sep 17 00:00:00 2001 From: Ofer Affias Date: Fri, 23 May 2025 10:26:48 +0300 Subject: [PATCH 3/4] fix typo --- docs/automation-actions.md | 5 +++-- .../integrations/LinearBAI/code-review-bb.cm | 2 +- .../integrations/LinearBAI/code-review-gl.cm | 2 +- .../automation-library/integrations/LinearBAI/code-review.cm | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/automation-actions.md b/docs/automation-actions.md index 8ef187024..0d0e1f285 100644 --- a/docs/automation-actions.md +++ b/docs/automation-actions.md @@ -306,8 +306,9 @@ automations: guidelines: {{ GUIDELINES | dump }} # Define variables - -APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users +# Add conditions for PR approvals. For example - allow approval only for specific users +APPROVE_PR_ON_LGTM: false +# Add your prompts to the review GUIDELINES: | - Don't comment on using outdated dependencies - In Javascript diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm index 28cd6590e..bfdc532d2 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm @@ -15,7 +15,7 @@ automations: # Add conditions for PR approvals. For example - allow approval only for specific users APPROVE_PR_ON_LGTM: false -# Add `guideline` to add your prompts to the review, you can have org wide instructions +# Add `guidelines` to add your prompts to the review, you can have org wide instructions # by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to # the team repo. # Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm index 1c8160c1e..f5f3fdee2 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm @@ -16,7 +16,7 @@ automations: # Add conditions for PR approvals. For example - allow approval only for specific users APPROVE_PR_ON_LGTM: false -# Add `guideline` to add your prompts to the review, you can have org wide instructions +# Add `guidelines` to add your prompts to the review, you can have org wide instructions # by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to # the team repo. # Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` diff --git a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm index 58d884054..ca8cbfa61 100644 --- a/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm +++ b/docs/downloads/automation-library/integrations/LinearBAI/code-review.cm @@ -20,7 +20,7 @@ automations: # Add conditions for PR approvals. For example - allow approval only for specific users APPROVE_PR_ON_LGTM: false -# Add `guideline` to add your prompts to the review, you can have org wide instructions +# Add `guidelines` to add your prompts to the review, you can have org wide instructions # by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to # the team repo. # Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md` From a214ea2ae763ae034e2a1560682590eac82213d6 Mon Sep 17 00:00:00 2001 From: Ofer Affias Date: Mon, 26 May 2025 11:50:59 +0300 Subject: [PATCH 4/4] Add example REVIEW_RULES.md content to LinearBAI docs --- .../integrations/LinearBAI/code-review/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/automations/integrations/LinearBAI/code-review/README.md b/docs/automations/integrations/LinearBAI/code-review/README.md index a43783271..cc04fb207 100644 --- a/docs/automations/integrations/LinearBAI/code-review/README.md +++ b/docs/automations/integrations/LinearBAI/code-review/README.md @@ -59,8 +59,21 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm){ .md-button } + +!!! tip "`./REVIEW_RULES.md` example" + + This file should be created in your repo root: + + ``` + 1. Do not comment on missing documentation. + 2. Do not comment on missing tests. + 3. For JavaScript code, enforce using camelCase for variables and functions. + ``` + + + ## Additional Resources --8<-- "docs/snippets/general.md"