From e558654bf9ff499baa7282fc3a66e303a6801253 Mon Sep 17 00:00:00 2001 From: tguler Date: Tue, 21 Jan 2025 11:38:11 +0100 Subject: [PATCH] change in down- and upvotes --- .../src/source_collectors/azure_devops/merge_requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/collector/src/source_collectors/azure_devops/merge_requests.py b/components/collector/src/source_collectors/azure_devops/merge_requests.py index 2c22c63bb0..9d2d7a5a97 100644 --- a/components/collector/src/source_collectors/azure_devops/merge_requests.py +++ b/components/collector/src/source_collectors/azure_devops/merge_requests.py @@ -76,9 +76,9 @@ def _include_entity(self, entity: Entity) -> bool: @staticmethod def _downvotes(merge_request) -> int: """Return the number of downvotes the merge request has.""" - return len([r for r in merge_request.get("reviewers", []) if r.get("vote", 0) < 0]) + return len([r for r in merge_request.get("reviewers", []) if r.get("approved") is False]) @staticmethod def _upvotes(merge_request) -> int: """Return the number of upvotes the merge request has.""" - return len([r for r in merge_request.get("reviewers", []) if r.get("vote", 0) > 0]) + return len([r for r in merge_request.get("reviewers", []) if r.get("approved") is True])