end
# Get a specific pull request comment
- fun get_pull_comment(repo_slug: String, id: Int): nullable ReviewComment do
- return get("/repos/{repo_slug}/pulls/comments/{id}").as(nullable ReviewComment)
+ fun get_pull_comment(repo_slug: String, id: Int): nullable PullComment do
+ return get("/repos/{repo_slug}/pulls/comments/{id}").as(nullable PullComment)
end
# Get the Github label with `name`.
#
# * `CommitComment` are made on a commit page.
# * `IssueComment` are made on an issue or pull request page.
-# * `ReviewComment` are made on the diff associated to a pull request.
+# * `PullComment` are made on the diff associated to a pull request.
abstract class Comment
serialize
# Should be accessed from `GithubAPI::get_diff_comment`.
#
# See <https://developer.github.com/v3/pulls/comments/>.
-class ReviewComment
+class PullComment
super Comment
serialize
map["{pattern_base}/repos/[^/]*/[^/]*/issues/comments/[0-9]+$".to_re] = "IssueComment"
map["{pattern_base}/repos/[^/]*/[^/]*/issues/events/[0-9]+$".to_re] = "IssueEvent"
map["{pattern_base}/repos/[^/]*/[^/]*/pulls/[0-9]+$".to_re] = "PullRequest"
- map["{pattern_base}/repos/[^/]*/[^/]*/pulls/comments/[0-9]+$".to_re] = "ReviewComment"
+ map["{pattern_base}/repos/[^/]*/[^/]*/pulls/comments/[0-9]+$".to_re] = "PullComment"
map["{pattern_base}/repos/[^/]*/[^/]*/comments/[0-9]+$".to_re] = "CommitComment"
map["{pattern_base}/repos/[^/]*/[^/]*/commits/[a-f0-9]+$".to_re] = "Commit"
map["{pattern_base}/repos/[^/]*/[^/]*/commits/[a-f0-9]+/status$".to_re] = "CommitStatus"
end
# Triggered when a comment is created on a pull request diff.
-class PullRequestReviewCommentEvent
+class PullRequestPullCommentEvent
super GithubEvent
serialize
# The `Comment` itself.
- var comment: ReviewComment is writable
+ var comment: PullComment is writable
# `PullRequest` the `comment` belongs to.
var pull: PullRequest is writable
else if json_object.has_key("action") and json_object.has_key("number") then
return "PullRequestEvent"
else if json_object.has_key("action") and json_object.has_key("pull") and json_object.has_key("comment") then
- return "PullRequestReviewCommentEvent"
+ return "PullRequestPullCommentEvent"
else if json_object.has_key("head_commit") and json_object.has_key("commits") then
return "PushEvent"
else if json_object.has_key("action") and json_object.has_key("branches") then
else if kind == "pull_request" then
return api.deserialize(json).as(PullRequestEvent)
else if kind == "pull_request_review_comment" then
- return api.deserialize(json).as(PullRequestReviewCommentEvent)
+ return api.deserialize(json).as(PullRequestPullCommentEvent)
else if kind == "push" then
return api.deserialize(json).as(PushEvent)
else if kind == "status" then
fun test_get_pull_comment is test do
var comment = api.get_pull_comment("nitlang/nit", 21010363)
- assert comment isa ReviewComment
+ assert comment isa PullComment
assert comment.path == "src/modelize/modelize_property.nit"
assert comment.original_position == 26
assert comment.pull_number == 945