mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
s
This commit is contained in:
@ -328,13 +328,16 @@ def set_custom_labels(variables):
|
|||||||
variables["custom_labels_examples"] = f" - {list(labels.keys())[0]}"
|
variables["custom_labels_examples"] = f" - {list(labels.keys())[0]}"
|
||||||
|
|
||||||
|
|
||||||
def get_user_labels(current_labels):
|
def get_user_labels(current_labels: List[str] = None):
|
||||||
## Only keep labels that has been added by the user
|
"""
|
||||||
|
Only keep labels that has been added by the user
|
||||||
|
"""
|
||||||
|
try:
|
||||||
if current_labels is None:
|
if current_labels is None:
|
||||||
current_labels = []
|
current_labels = []
|
||||||
user_labels = []
|
user_labels = []
|
||||||
for label in current_labels:
|
for label in current_labels:
|
||||||
if label in ['Bug fix', 'Tests', 'Refactoring', 'Enhancement', 'Documentation', 'Other']:
|
if label.lower() in ['bug fix', 'tests', 'refactoring', 'enhancement', 'documentation', 'other']:
|
||||||
continue
|
continue
|
||||||
if get_settings().config.enable_custom_labels:
|
if get_settings().config.enable_custom_labels:
|
||||||
if label in get_settings().custom_labels:
|
if label in get_settings().custom_labels:
|
||||||
@ -342,6 +345,9 @@ def get_user_labels(current_labels):
|
|||||||
user_labels.append(label)
|
user_labels.append(label)
|
||||||
if user_labels:
|
if user_labels:
|
||||||
get_logger().info(f"Keeping user labels: {user_labels}")
|
get_logger().info(f"Keeping user labels: {user_labels}")
|
||||||
|
except Exception as e:
|
||||||
|
get_logger().exception(f"Failed to get user labels: {e}")
|
||||||
|
return current_labels
|
||||||
return user_labels
|
return user_labels
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user