mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 03:40:38 +08:00
feat: Remove 'Refactoring' label from custom labels and update related descriptions
This commit is contained in:
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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 #
|
||||
|
||||
|
@ -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"]
|
||||
|
@ -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"
|
||||
|
@ -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 %}
|
||||
=====
|
||||
|
||||
|
@ -57,7 +57,6 @@ PR Analysis:
|
||||
enum:
|
||||
- Bug fix
|
||||
- Tests
|
||||
- Refactoring
|
||||
- Enhancement
|
||||
- Documentation
|
||||
- Other
|
||||
|
Reference in New Issue
Block a user