return get("/repos/{repo_slug}/pulls/{number}").as(nullable PullRequest)
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)
+ end
+
# Get the Github label with `name`.
#
# Returns `null` if the label cannot be found.
return get("/repos/{repo_slug}/issues/comments/{id}").as(nullable IssueComment)
end
- # Get the Github diff comment with `id`.
- #
- # Returns `null` if the comment cannot be found.
- #
- # ~~~nitish
- # var api = new GithubAPI(get_github_oauth)
- # var repo = api.get_repo("nitlang/nit")
- # assert repo != null
- # var comment = api.get_review_comment(repo, 21010363)
- # assert comment.path == "src/modelize/modelize_property.nit"
- # assert comment.original_position == 26
- # assert comment.pull_number == 945
- # ~~~
- fun get_review_comment(repo_slug: String, id: Int): nullable ReviewComment do
- return get("/repos/{repo_slug}/pulls/comments/{id}").as(nullable ReviewComment)
- end
-
private fun pagination(page, per_page: nullable Int): String do
return "page={page or else 1}&per_page={per_page or else 30}"
end
assert pull.body == "Raise dead on `nitc`.\nIt's super effective...\n"
end
+ fun test_get_pull_comment is test do
+ var comment = api.get_pull_comment("nitlang/nit", 21010363)
+ assert comment isa ReviewComment
+ assert comment.path == "src/modelize/modelize_property.nit"
+ assert comment.original_position == 26
+ assert comment.pull_number == 945
+ # TODO other fields
+ end
+
fun test_get_label is test do
var labl = api.get_label("nitlang/nit", "ok_will_merge")
assert labl isa Label
assert comment.body == "For testing purposes...\n"
assert comment.commit_id == "7eacb86d1e24b7e72bc9ac869bf7182c0300ceca"
end
-
- fun test_get_review_comments is test do
- var comment = api.get_review_comment("nitlang/nit", 21010363)
- assert comment isa ReviewComment
- assert comment.path == "src/modelize/modelize_property.nit"
- assert comment.original_position == 26
- assert comment.pull_number == 945
- end
end