From 0ca3c074ca21a8c98c331509b86614a73498b9ff Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 6 Nov 2023 15:01:22 +0100 Subject: [PATCH] Improve reviewers check method naming and comments --- Dangerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dangerfile b/Dangerfile index 515d89a83..a86d1754b 100644 --- a/Dangerfile +++ b/Dangerfile @@ -12,16 +12,18 @@ def gemfile_lock_version gemfile_lock.scan(/fastlane-plugin-wpmreleasetoolkit \((\d+.\d+.\d+)\)/).last.first end -def finished_reviews? +# these are reviewers actively providing feedback and potentially changing the state of the PR (approved, changes-requested) +def active_reviewers? repo_name = github.pr_json['base']['repo']['full_name'] pr_number = github.pr_json['number'] !github.api.pull_request_reviews(repo_name, pr_number).empty? end +# requested_teams / requested_reviewers are users initially requested to review a PR, who haven't reacted yet def requested_reviewers? has_requested_reviews = !github.pr_json['requested_teams'].to_a.empty? || !github.pr_json['requested_reviewers'].to_a.empty? - has_requested_reviews || finished_reviews? + has_requested_reviews || active_reviewers? end return if github.pr_labels.include?('Releases')