module Octokit::Client::Reviews

def create_pull_request_review(repo, number, options = {})

Returns:
  • (Sawyer::Resource) - ] Hash respresenting the review

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review -

Options Hash: (**comments)
  • :body (String) -- Body of the comment
  • :position (Integer) -- The position in the file to be commented on
  • :path (String) -- The path to the file being commented on
  • :comments (Array) -- Comments part of the review
  • :body (String) -- The body text of the pull request review
  • :event (String) -- The review action (event) to perform;

Parameters:
  • options (Hash) -- Method options
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def create_pull_request_review(repo, number, options = {})
  post "#{Repository.path repo}/pulls/#{number}/reviews", options
end

def delete_pull_request_review(repo, number, review, options = {})

Returns:
  • (Sawyer::Resource) - Hash representing the deleted review

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review -

Parameters:
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def delete_pull_request_review(repo, number, review, options = {})
  delete "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end

def delete_pull_request_review_request(repo, id, reviewers = {}, options = {})

Returns:
  • (Sawyer::Resource) - ] Hash representing the pull request

Other tags:
    See: https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request -

Parameters:
  • options (Hash) -- :team_reviewers [Array] An array of team slugs
  • reviewers (Hash) -- :reviewers [Array] An array of user logins
  • id (Integer) -- The id of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def delete_pull_request_review_request(repo, id, reviewers = {}, options = {})
  # TODO(5.0): remove deprecated behavior
  if !reviewers.empty? && !options.empty?
    octokit_warn(
      'Deprecated: Octokit::Client#delete_pull_request_review_request ' \
      "no longer takes a separate :reviewers argument.\n" \
      'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.'
    )
  end
  # For backwards compatibility, this endpoint can be called with a separate reviewers hash.
  # If not called with a separate hash, then 'reviewers' is, in fact, 'options'.
  options = options.merge(reviewers)
  delete "#{Repository.path repo}/pulls/#{id}/requested_reviewers", options
end

def dismiss_pull_request_review(repo, number, review, message, options = {})

Returns:
  • (Sawyer::Resource) - Hash representing the dismissed review

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review -

Parameters:
  • message (String) -- The message for the pull request review dismissal
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def dismiss_pull_request_review(repo, number, review, message, options = {})
  options = options.merge(message: message)
  put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/dismissals", options
end

def pull_request_review(repo, number, review, options = {})

Returns:
  • (Sawyer::Resource) - Hash representing the review

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#get-a-single-review -

Parameters:
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def pull_request_review(repo, number, review, options = {})
  get "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end

def pull_request_review_comments(repo, number, review, options = {})

Returns:
  • (Array) - Array of Hashes representing the review comments

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review -

Parameters:
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def pull_request_review_comments(repo, number, review, options = {})
  paginate "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/comments", options
end

def pull_request_review_requests(repo, number, options = {})

Returns:
  • (Array) - Array of Hashes representing the review requests

Other tags:
    See: https://developer.github.com/v3/pulls/review_requests/#list-review-requests -

Parameters:
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def pull_request_review_requests(repo, number, options = {})
  paginate "#{Repository.path repo}/pulls/#{number}/requested_reviewers", options
end

def pull_request_reviews(repo, number, options = {})

Returns:
  • (Array) - Array of Hashes representing the reviews

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request -

Parameters:
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def pull_request_reviews(repo, number, options = {})
  paginate "#{Repository.path repo}/pulls/#{number}/reviews", options
end

def request_pull_request_review(repo, number, reviewers = {}, options = {})

Returns:
  • (Sawyer::Resource) - ] Hash respresenting the pull request

Other tags:
    See: https://developer.github.com/v3/pulls/review_requests/#request-reviewers-for-a-pull-request -

Parameters:
  • options (Hash) -- :team_reviewers [Array] An array of team slugs
  • reviewers (Hash) -- :reviewers [Array] An array of user logins
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def request_pull_request_review(repo, number, reviewers = {}, options = {})
  # TODO(5.0): remove deprecated behavior
  if reviewers.is_a?(Array)
    octokit_warn(
      'Deprecated: Octokit::Client#request_pull_request_review ' \
      "no longer takes a separate :reviewers argument.\n" \
      'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.'
    )
    options = options.merge(reviewers: reviewers)
  else
    options = options.merge(reviewers)
  end
  post "#{Repository.path repo}/pulls/#{number}/requested_reviewers", options
end

def submit_pull_request_review(repo, number, review, event, options = {})

Returns:
  • (Sawyer::Resource) - Hash respresenting the review

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review -

Options Hash: (**options)
  • :body (String) -- The body text of the pull request review

Parameters:
  • options (Hash) -- Method options
  • event (String) -- The review action (event) to perform; can be one of
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def submit_pull_request_review(repo, number, review, event, options = {})
  options = options.merge(event: event)
  post "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/events", options
end

def update_pull_request_review(repo, number, review, body, options = {})

Returns:
  • (Sawyer::Resource) - Hash representing the review comment

Other tags:
    See: https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review -

Parameters:
  • options (Hash) -- Method options
  • body (String) -- body text of the pull request review.
  • review (Integer) -- The id of the review
  • number (Integer) -- Number ID of the pull request
  • repo (Integer, String, Hash, Repository) -- A GitHub repository
def update_pull_request_review(repo, number, review, body, options = {})
  options[:body] = body
  put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end