diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index 777e13a9..c4106008 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -13,6 +13,21 @@ 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) +### 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: 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 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 127b215e..a9ed4ae7 100644 --- a/docs/GENERATE_CUSTOM_LABELS.md +++ b/docs/GENERATE_CUSTOM_LABELS.md @@ -14,16 +14,32 @@ 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): -#### 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. 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. 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: 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 - 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: