diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index ded1b52c..d5e1a3c6 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -343,7 +343,7 @@ def set_custom_labels(variables): labels = get_settings().custom_labels if not labels: # set default labels - labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Refactoring', 'Enhancement', 'Documentation', 'Other'] + labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Enhancement', 'Documentation', 'Other'] labels_list = "\n - ".join(labels) if labels else "" labels_list = f" - {labels_list}" if labels_list else "" variables["custom_labels"] = labels_list @@ -367,7 +367,7 @@ def get_user_labels(current_labels: List[str] = None): current_labels = [] user_labels = [] for label in current_labels: - if label.lower() in ['bug fix', 'tests', 'refactoring', 'enhancement', 'documentation', 'other']: + if label.lower() in ['bug fix', 'tests', 'enhancement', 'documentation', 'other']: continue if get_settings().config.enable_custom_labels: if label in get_settings().custom_labels: diff --git a/pr_agent/git_providers/github_provider.py b/pr_agent/git_providers/github_provider.py index ab4acb9a..7e13e0ee 100644 --- a/pr_agent/git_providers/github_provider.py +++ b/pr_agent/git_providers/github_provider.py @@ -442,7 +442,7 @@ class GithubProvider(GitProvider): def publish_labels(self, pr_types): try: label_color_map = {"Bug fix": "1d76db", "Tests": "e99695", "Bug fix with tests": "c5def5", - "Refactoring": "bfdadc", "Enhancement": "bfd4f2", "Documentation": "d4c5f9", + "Enhancement": "bfd4f2", "Documentation": "d4c5f9", "Other": "d1bcf9"} post_parameters = [] for p in pr_types: diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 34a01d3d..259383d7 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -55,7 +55,7 @@ final_update_message = true use_description_markers=false include_generated_by_header=true -#custom_labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Refactoring', 'Enhancement', 'Documentation', 'Other'] +#custom_labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Enhancement', 'Documentation', 'Other'] [pr_questions] # /ask # diff --git a/pr_agent/settings/custom_labels.toml b/pr_agent/settings/custom_labels.toml index 9c751d0e..ee45fb19 100644 --- a/pr_agent/settings/custom_labels.toml +++ b/pr_agent/settings/custom_labels.toml @@ -8,10 +8,8 @@ enable_custom_labels=false #description = """Adds or modifies tests""" #[custom_labels."Bug fix with tests"] #description = """Fixes a bug in the code and adds or modifies tests""" -#[custom_labels."Refactoring"] -#description = """Code refactoring without changing functionality""" #[custom_labels."Enhancement"] -#description = """Adds new features or functionality""" +#description = """Adds new features or modifies existing ones""" #[custom_labels."Documentation"] #description = """Adds or modifies documentation""" #[custom_labels."Other"] diff --git a/pr_agent/settings/pr_custom_labels.toml b/pr_agent/settings/pr_custom_labels.toml index 46ee0684..d9a5e004 100644 --- a/pr_agent/settings/pr_custom_labels.toml +++ b/pr_agent/settings/pr_custom_labels.toml @@ -24,7 +24,6 @@ The output must be a YAML object equivalent to type $Labels, according to the fo class Label(str, Enum): bug_fix = "Bug fix" tests = "Tests" - refactoring = "Refactoring" enhancement = "Enhancement" documentation = "Documentation" other = "Other" diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index b11af105..fe669819 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -20,7 +20,6 @@ The output must be a YAML object equivalent to type $PRDescription, according to class PRType(str, Enum): bug_fix = "Bug fix" tests = "Tests" - refactoring = "Refactoring" enhancement = "Enhancement" documentation = "Documentation" other = "Other" @@ -39,8 +38,8 @@ class FileWalkthrough(BaseModel): {%- if enable_semantic_files_types %} class SemanticFileLabels(BaseModel): - label: str = Field(description="a semantic label that represents a type of code changes that occurred in the PR. Possible values (partial list): 'bug fix', 'tests', 'enhancement', 'documentation', 'error handling', 'configuration changes', 'logging', 'dependencies', 'new feature', ...") - files: List[str] = Field(description="a list of file names related to the chosen semantic label. A file may appear in multiple labels. Present the file full path, and nothing else. Make sure the semantic label properly describes the type of changes in each file") + label: str = Field(description="a semantic label that represents a type of code changes that occurred in the PR. Possible values (partial list): 'bug fix', 'tests', 'enhancement', 'documentation', 'error handling', 'configuration changes', 'logging', 'dependencies', 'new feature', 'other', ...") + files: List[str] = Field(description="a list of file names related to the chosen semantic label. Present the file full path, and nothing else.") {%- endif %} Class PRDescription(BaseModel): @@ -54,7 +53,7 @@ Class PRDescription(BaseModel): main_files_walkthrough: List[FileWalkthrough] = Field(max_items=10) {%- endif %} {%- if enable_semantic_files_types %} - pr_files_labels[List[SemanticFileLabels]] = Field(min_items=3, description="A list of semantic labels that describe the type of changes in the PR files.") + pr_files_labels[List[SemanticFileLabels]] = Field(min_items=2, description="A list of semantic labels that describe the type of changes in the PR files. A file should appear only in a single label, that best describes the type of changes in the file.") {%- endif %} ===== diff --git a/pr_agent/settings/pr_reviewer_prompts.toml b/pr_agent/settings/pr_reviewer_prompts.toml index d38dc287..ce32bfc9 100644 --- a/pr_agent/settings/pr_reviewer_prompts.toml +++ b/pr_agent/settings/pr_reviewer_prompts.toml @@ -57,7 +57,6 @@ PR Analysis: enum: - Bug fix - Tests - - Refactoring - Enhancement - Documentation - Other