Module: Octokit::Client::Reviews
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/reviews.rb
Overview
Methods for the Reviews API
Instance Method Summary collapse
-
#create_pull_request_review(repo, number, options = {}) ⇒ Sawyer::Resource
Create a pull request review.
-
#delete_pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Delete a pending review.
-
#delete_pull_request_review_request(repo, id, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Delete a review request.
-
#dismiss_pull_request_review(repo, number, review, message, options = {}) ⇒ Sawyer::Resource
Dismiss a pull request review.
-
#pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Get a single review.
-
#pull_request_review_comments(repo, number, review, options = {}) ⇒ Array<Sawyer::Resource>
Get comments for a single review.
-
#pull_request_review_requests(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List review requests.
-
#pull_request_reviews(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List reviews on a pull request.
-
#request_pull_request_review(repo, number, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Create a review request.
-
#submit_pull_request_review(repo, number, review, event, options = {}) ⇒ Sawyer::Resource
Submit a pull request review.
-
#update_pull_request_review(repo, number, review, body, options = {}) ⇒ Sawyer::Resource
Update a review request comment.
Instance Method Details
#create_pull_request_review(repo, number, options = {}) ⇒ Sawyer::Resource
Create a pull request review
92 93 94 |
# File 'lib/octokit/client/reviews.rb', line 92 def create_pull_request_review(repo, number, = {}) post "#{Repository.path repo}/pulls/#{number}/reviews", end |
#delete_pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Delete a pending review
49 50 51 |
# File 'lib/octokit/client/reviews.rb', line 49 def delete_pull_request_review(repo, number, review, = {}) delete "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end |
#delete_pull_request_review_request(repo, id, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Delete a review request
193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/octokit/client/reviews.rb', line 193 def delete_pull_request_review_request(repo, id, reviewers = {}, = {}) # TODO(5.0): remove deprecated behavior if !reviewers.empty? && !.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'. = .merge(reviewers) delete "#{Repository.path repo}/pulls/#{id}/requested_reviewers", end |
#dismiss_pull_request_review(repo, number, review, message, options = {}) ⇒ Sawyer::Resource
Dismiss a pull request review
129 130 131 132 |
# File 'lib/octokit/client/reviews.rb', line 129 def dismiss_pull_request_review(repo, number, review, , = {}) = .merge(message: ) put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/dismissals", end |
#pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Get a single review
34 35 36 |
# File 'lib/octokit/client/reviews.rb', line 34 def pull_request_review(repo, number, review, = {}) get "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end |
#pull_request_review_comments(repo, number, review, options = {}) ⇒ Array<Sawyer::Resource>
Get comments for a single review
64 65 66 |
# File 'lib/octokit/client/reviews.rb', line 64 def pull_request_review_comments(repo, number, review, = {}) paginate "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/comments", end |
#pull_request_review_requests(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List review requests
144 145 146 |
# File 'lib/octokit/client/reviews.rb', line 144 def pull_request_review_requests(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/requested_reviewers", end |
#pull_request_reviews(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List reviews on a pull request
19 20 21 |
# File 'lib/octokit/client/reviews.rb', line 19 def pull_request_reviews(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/reviews", end |
#request_pull_request_review(repo, number, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Create a review request
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/octokit/client/reviews.rb', line 160 def request_pull_request_review(repo, number, reviewers = {}, = {}) # 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.' ) = .merge(reviewers: reviewers) else = .merge(reviewers) end post "#{Repository.path repo}/pulls/#{number}/requested_reviewers", end |
#submit_pull_request_review(repo, number, review, event, options = {}) ⇒ Sawyer::Resource
Submit a pull request review
112 113 114 115 |
# File 'lib/octokit/client/reviews.rb', line 112 def submit_pull_request_review(repo, number, review, event, = {}) = .merge(event: event) post "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/events", end |
#update_pull_request_review(repo, number, review, body, options = {}) ⇒ Sawyer::Resource
Update a review request comment
221 222 223 224 |
# File 'lib/octokit/client/reviews.rb', line 221 def update_pull_request_review(repo, number, review, body, = {}) [:body] = body put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end |