Skip to content

Commit

Permalink
Improve reviewers check method naming and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Feb 1, 2024
1 parent 9b1d5e3 commit 0ca3c07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 0ca3c07

Please sign in to comment.