From 3b13738943cd6a5b9cff69ed80f09b2868591e42 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 18 Dec 2023 10:04:05 +0200 Subject: [PATCH] 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: