Skip to content

Commit

Permalink
Update label comparison logic in pr_reviewer.py and pr_description.py…
Browse files Browse the repository at this point in the history
… to consider unordered lists
  • Loading branch information
mrT23 committed Mar 12, 2024
1 parent 8b29c3a commit 78cabf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pr_agent/tools/pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def run(self):
user_labels = get_user_labels(original_labels)
new_labels = pr_labels + user_labels
get_logger().debug(f"published labels", artifact=new_labels)
if new_labels != original_labels:
if sorted(new_labels) != sorted(original_labels):
self.git_provider.publish_labels(new_labels)
else:
get_logger().debug(f"Labels are the same, not updating")
Expand Down
2 changes: 1 addition & 1 deletion pr_agent/tools/pr_reviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def set_review_labels(self, data):
else:
current_labels_filtered = []
new_labels = review_labels + current_labels_filtered
if (current_labels or review_labels) and new_labels != current_labels:
if (current_labels or review_labels) and sorted(new_labels) != sorted(current_labels):
get_logger().info(f"Setting review labels:\n{review_labels + current_labels_filtered}")
self.git_provider.publish_labels(new_labels)
else:
Expand Down

0 comments on commit 78cabf2

Please sign in to comment.