From 3b13738943cd6a5b9cff69ed80f09b2868591e42 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 18 Dec 2023 10:04:05 +0200 Subject: [PATCH 1/4] Add docs to custom labels page --- docs/GENERATE_CUSTOM_LABELS.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/GENERATE_CUSTOM_LABELS.md b/docs/GENERATE_CUSTOM_LABELS.md index 127b215e..a0cf84d6 100644 --- a/docs/GENERATE_CUSTOM_LABELS.md +++ b/docs/GENERATE_CUSTOM_LABELS.md @@ -18,12 +18,26 @@ When running the `generate_labels` tool on a PR that includes changes in SQL que Note that in addition to the dedicated tool `generate_labels`, the custom labels will also be used by the `review` and `describe` tools. -#### CLI +#### 1. CLI To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the [custom_labels file](./../pr_agent/settings/custom_labels.toml): -#### GitHub Action and GitHub App +#### 2. GitHub Action and GitHub App To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the local `.pr_agent.toml` file in you repository. +#### 3. Git provider's native labels page (Pr-Agent Pro feature :gem:) +To enable custom labels, you can add/edit the custom labels in the Git provider's native labels page. For example, in GitHub, you can add/edit the labels in the Labels page: +a. Go to the Labels page: +* Github : https://github.com/{owner}/{repo}/labels, or click on the "Labels" tab in the issues or PRs page. +* GitLab : https://gitlab.com/{owner}/{repo}/-/labels, or click on "Manage" -> "Labels" on the left menu. + +b. Add/edit the custom labels. It should be formatted as follows: +* Label name: The name of the custom label. +* Description: Description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`. + + +c. Now the custom labels will be included in the `generate_labels` tool. +*This feature is supported in GitHub and GitLab. + #### Configuration changes - Change `enable_custom_labels` to True: This will turn off the default labels and enable the custom labels provided in the custom_labels.toml file. - Add the custom labels. It should be formatted as follows: From f121a420c9eaf9c7379586f056869001bc24c0e3 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 18 Dec 2023 10:08:29 +0200 Subject: [PATCH 2/4] Add to describe --- docs/DESCRIBE.md | 14 ++++++++++++++ docs/GENERATE_CUSTOM_LABELS.md | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index 777e13a9..ce908e5f 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -13,6 +13,20 @@ For example: The `describe` tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for [GitHub App](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) and [GitHub Action](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-action) +### Git provider's native labels page +> This feature is available only in Pr-Agent Pro :gem: +* Github : https://github.com/{owner}/{repo}/labels, or click on the "Labels" tab in the issues or PRs page. +* GitLab : https://gitlab.com/{owner}/{repo}/-/labels, or click on "Manage" -> "Labels" on the left menu. + +b. Add/edit the custom labels. It should be formatted as follows: +* Label name: The name of the custom label. +* Description: Description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`. + + +c. Now the custom labels will be included in the `generate_labels` tool. +*This feature is supported in GitHub and GitLab. + + ### Configuration options Under the section 'pr_description', the [configuration file](./../pr_agent/settings/configuration.toml#L28) contains options to customize the 'describe' tool: diff --git a/docs/GENERATE_CUSTOM_LABELS.md b/docs/GENERATE_CUSTOM_LABELS.md index a0cf84d6..2f7470e4 100644 --- a/docs/GENERATE_CUSTOM_LABELS.md +++ b/docs/GENERATE_CUSTOM_LABELS.md @@ -24,7 +24,8 @@ To enable custom labels, you need to apply the [configuration changes](#configur #### 2. GitHub Action and GitHub App To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the local `.pr_agent.toml` file in you repository. -#### 3. Git provider's native labels page (Pr-Agent Pro feature :gem:) +#### 3. Git provider's native labels page +> This feature is available only in Pr-Agent Pro :gem: To enable custom labels, you can add/edit the custom labels in the Git provider's native labels page. For example, in GitHub, you can add/edit the labels in the Labels page: a. Go to the Labels page: * Github : https://github.com/{owner}/{repo}/labels, or click on the "Labels" tab in the issues or PRs page. From 75dcb035a76939e5a7ab945b390cbcfc30d136f9 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 18 Dec 2023 13:41:50 +0200 Subject: [PATCH 3/4] Update --- docs/DESCRIBE.md | 16 ++++++++-------- docs/GENERATE_CUSTOM_LABELS.md | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index ce908e5f..53ee4cdc 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -13,19 +13,19 @@ For example: The `describe` tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for [GitHub App](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) and [GitHub Action](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-action) -### Git provider's native labels page -> This feature is available only in Pr-Agent Pro :gem: -* Github : https://github.com/{owner}/{repo}/labels, or click on the "Labels" tab in the issues or PRs page. -* GitLab : https://gitlab.com/{owner}/{repo}/-/labels, or click on "Manage" -> "Labels" on the left menu. +### Handle custom labels from the Repo's labels page :gem: +> This feature is available only in PR-Agent Pro +* GitHub : `https://github.com/{owner}/{repo}/labels`, or click on the "Labels" tab in the issues or PRs page. +* GitLab : `https://gitlab.com/{owner}/{repo}/-/labels`, or click on "Manage" -> "Labels" on the left menu. b. Add/edit the custom labels. It should be formatted as follows: * Label name: The name of the custom label. -* Description: Description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`. - - +* Description: Start the description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`.
+The description should be comprehensive and detailed, indicating when to add the desired label. + c. Now the custom labels will be included in the `generate_labels` tool. -*This feature is supported in GitHub and GitLab. +*This feature is supported in GitHub and GitLab. ### Configuration options diff --git a/docs/GENERATE_CUSTOM_LABELS.md b/docs/GENERATE_CUSTOM_LABELS.md index 2f7470e4..17e0f279 100644 --- a/docs/GENERATE_CUSTOM_LABELS.md +++ b/docs/GENERATE_CUSTOM_LABELS.md @@ -14,29 +14,29 @@ If we wish to add detect changes to SQL queries in a given PR, we can add the fo When running the `generate_labels` tool on a PR that includes changes in SQL queries, it will automatically suggest the custom label: +Note that in addition to the dedicated tool `generate_labels`, the custom labels will also be used by the `describe` tool. + ### How to enable custom labels +There are 3 ways to enable custom labels: -Note that in addition to the dedicated tool `generate_labels`, the custom labels will also be used by the `review` and `describe` tools. +#### 1. CLI (local configuration file) +When working from CLI, you need to apply the [configuration changes](#configuration-changes) to the [custom_labels file](./../pr_agent/settings/custom_labels.toml): -#### 1. CLI -To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the [custom_labels file](./../pr_agent/settings/custom_labels.toml): - -#### 2. GitHub Action and GitHub App +#### 2. Repo configuration file To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the local `.pr_agent.toml` file in you repository. -#### 3. Git provider's native labels page -> This feature is available only in Pr-Agent Pro :gem: -To enable custom labels, you can add/edit the custom labels in the Git provider's native labels page. For example, in GitHub, you can add/edit the labels in the Labels page: -a. Go to the Labels page: -* Github : https://github.com/{owner}/{repo}/labels, or click on the "Labels" tab in the issues or PRs page. -* GitLab : https://gitlab.com/{owner}/{repo}/-/labels, or click on "Manage" -> "Labels" on the left menu. +#### 3. Handle custom labels from the Repo's labels page :gem: +> This feature is available only in PR-Agent Pro +* GitHub : `https://github.com/{owner}/{repo}/labels`, or click on the "Labels" tab in the issues or PRs page. +* GitLab : `https://gitlab.com/{owner}/{repo}/-/labels`, or click on "Manage" -> "Labels" on the left menu. b. Add/edit the custom labels. It should be formatted as follows: * Label name: The name of the custom label. -* Description: Description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`. - - +* Description: Start the description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`.
+The description should be comprehensive and detailed, indicating when to add the desired label. + c. Now the custom labels will be included in the `generate_labels` tool. + *This feature is supported in GitHub and GitLab. #### Configuration changes From 6c80fde6df3923d71da81284487566a6dcd0d4ad Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 18 Dec 2023 13:44:37 +0200 Subject: [PATCH 4/4] fix --- docs/DESCRIBE.md | 1 + docs/GENERATE_CUSTOM_LABELS.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index 53ee4cdc..c4106008 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -23,6 +23,7 @@ b. Add/edit the custom labels. It should be formatted as follows: * Description: Start the description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`.
The description should be comprehensive and detailed, indicating when to add the desired label. + c. Now the custom labels will be included in the `generate_labels` tool. *This feature is supported in GitHub and GitLab. diff --git a/docs/GENERATE_CUSTOM_LABELS.md b/docs/GENERATE_CUSTOM_LABELS.md index 17e0f279..a9ed4ae7 100644 --- a/docs/GENERATE_CUSTOM_LABELS.md +++ b/docs/GENERATE_CUSTOM_LABELS.md @@ -35,6 +35,7 @@ b. Add/edit the custom labels. It should be formatted as follows: * Description: Start the description of with prefix `pr_agent:`, for example: `pr_agent: Description of when AI should suggest this label`.
The description should be comprehensive and detailed, indicating when to add the desired label. + c. Now the custom labels will be included in the `generate_labels` tool. *This feature is supported in GitHub and GitLab.