Pygithub: PullRequest์— ๋Œ€ํ•ด ๋ฐ˜ํ™˜ ๋œ ๋Œ“๊ธ€ ์—†์Œ

์— ๋งŒ๋“  2012๋…„ 08์›” 21์ผ  ยท  7์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: PyGithub/PyGithub

์•ˆ๋…•ํ•˜์„ธ์š”, ์—ฌ๊ธฐ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
๋ฐ˜ํ™˜ ๋œ ๋Œ“๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋Œ“๊ธ€์€ ์ ์ ˆํ•œ ๊ฐ€์น˜๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

p = z.pulls [1]
ํ”ผ
์‚ฐ์ถœ:
์ถœ๋ ฅ : u '\ u041d \ u0435 \ u043f \ u0440 \ u0438 \ u043d \ u0438 \ u043c \ u0430 \ u0442 \ u044c =)'
p.comments
์ถœ๋ ฅ : 1
p.get_comments ()
์‚ฐ์ถœ:
๋ชฉ๋ก (p.get_comments ())
์ถœ๋ ฅ : []

์–ด๋–ค ์•„์ด๋””์–ด?

bug feature request

๋ชจ๋“  7 ๋Œ“๊ธ€

์•ˆ๋…•ํ•˜์„ธ์š”!

๋‹ค์Œ ์ฝ”๋“œ์— ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์Œ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

import github

g = github.Github()
r = g.get_user( "jacquev6" ).get_repo( "PyGithub" )
p = r.get_pull( 57 )
print p.title, "has", p.comments, "comments"
print [ c.body[ :15 ] for c in p.get_comments() ]

๋‹ค์Œ์„ ์ธ์‡„ํ•ฉ๋‹ˆ๋‹ค.

Allows connection to GitHub Enterprise installs on local URLs has 2 comments
[]

์ด ๋งˆ์ง€๋ง‰ ์ค„์€ http://developer.github.com/v3/pulls/comments/#list -comments์— ์„ค๋ช… ๋œ๋Œ€๋กœ API https://api.github.com/repos/jacquev6/PyGithub/pulls/57/comments๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค. -on-a-pull-request, ๊ทธ๋Ÿฌ๋‚˜ API๋Š” ๋นˆ ๋ชฉ๋ก์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์‹  https://api.github.com/repos/jacquev6/PyGithub/issues/57/comments ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๋Œ“๊ธ€์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค. ๋ฌธ์ œ๋Š” Github ์ธก์— ์žˆ์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.

์ž„์‹œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์œผ๋กœ ๋‹ค์Œ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ pull ์š”์ฒญ์ด ๋ฌธ์ œ์ธ ๊ฒƒ์ฒ˜๋Ÿผ ์ˆ˜ํ–‰ํ•˜๊ณ  ๋‹ค๋ฅธ API๋ฅผ ํ˜ธ์ถœ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

print [ c.body[ :15 ] for c in r.get_issue( p.number ).get_comments() ]

์ง€๊ธˆ ๋‹น์žฅ์€์ด ๋ฌธ์ œ๋ฅผ ์ฒ˜๋ฆฌ ํ•  ์‹œ๊ฐ„์ด ์ถฉ๋ถ„ํ•˜์ง€ ์•Š์ง€๋งŒ 9 ์›” ์ดˆ์—๋„ ์—ฌ์ „ํžˆ ๋ฌธ์ œ๊ฐ€์žˆ๋Š” ๊ฒฝ์šฐ Github์— ์—ฐ๋ฝํ•˜๊ฑฐ๋‚˜ PyGithub๋ฅผ ํŒจ์น˜ ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ฆ๊ฒจ,

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์กฐ๊ธˆ ํ–ฅ์ƒ์‹œํ‚ค๊ธฐ ์œ„ํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฌธ์ œ๊ฐ€ PR์ธ์ง€ ์•„๋‹Œ์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค (๋ชจ๋“  PR๋„ ๋ฌธ์ œ์ด๊ธฐ ๋•Œ๋ฌธ).

        if myIssue.pull_request.diff_url:
            PR=True
        else:
            PR=False

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ์ด๋ฅผ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ฌธ์ œ๋กœ Github์— ๋ฌธ์˜ํ–ˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ์€ Github์—์„œ๋ฐ›์€ ๋‹ต์žฅ์ž…๋‹ˆ๋‹ค.

From: Wynn Netherland
Subject: API v3, list comments on pull requests

Hi, Vincent. I know it's confusing but we actually have three types of comments on GitHub, so there are
three different spots in the API to grab them. Be sure you're looking in the right spot for the data you expect.

Pull Request comments are the top-level comments found on the Pull Request page. These are retrieved via
the Issues API [1] since PRs are essentially specialized Issues. Pull Request review comments are those made
against the diff on the PR. You can grab these with the Review Comments API [2]. Finally, line comments made
outside the context of a PR on a raw commit can be retrieved via the Commit Comments API [3].

Armed with that info, let me know if you're not seeing the data you expect and the API call you're making, and I
can dig a bit deeper.

[1] http://developer.github.com/v3/issues/comments/
[2] http://developer.github.com/v3/pulls/comments/
[3] http://developer.github.com/v3/repos/comments/

Cheers,

๋”ฐ๋ผ์„œ PullRequest.get_comments ๋Š” Pull Requests API๋ฅผ ์‚ฌ์šฉํ•˜๋ฏ€๋กœ https://github.com/jacquev6/PyGithub/pull/57 ์—์„œ ๋ณผ ์ˆ˜์žˆ๋Š” ๊ฒƒ๊ณผ ์ผ๊ด€์„ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. @ nixoz2k7 ์›๋ž˜ ๋ฌธ์ œ์™€๋„ ์ผ๊ด€์„ฑ์ด ์žˆ์Šต๋‹ˆ๊นŒ?

์–ด์จŒ๋“  ์ด๊ฒƒ์€ ์˜คํ•ด์˜ ์†Œ์ง€๊ฐ€ ์žˆ์œผ๋ฏ€๋กœ get_issue_comments (Issues API ์‚ฌ์šฉ) ๋ฐ get_review_comments (Pull Requests API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ get_comments ๋™์˜์–ด)๋ผ๋Š” ๋‘ ๊ฐ€์ง€ ๋ฉ”์„œ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ์ฃผ ์ค‘์ˆœ์—์ด๋ฅผ ์˜ˆ์ƒํ•˜์‹ญ์‹œ์˜ค.

๋ฐฉ๊ธˆ https://github.com/jacquev6/PyGithub/tree/develop ์—์„œ ์ƒˆ๋กœ์šด ๋ฐฉ๋ฒ•์„ ํ‘ธ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค @ nixoz2k7 , ๋งํ•œ ๋‚ด์šฉ์— ์—ฌ์ „ํžˆ ๋ฌธ์ œ๊ฐ€ ์žˆ์œผ๋ฉด ์ฃผ์ €ํ•˜์ง€ ๋ง๊ณ  ๋‹ค์‹œ์—ฌ์‹ญ์‹œ์˜ค.

์ •๋ง ๊ณ ๋ง™์Šต๋‹ˆ๋‹ค ;)
btw, "๋ฌธ์ œ"ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์œผ๋กœ ์ž˜ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฏธ 2 ์ฃผ ๋™์•ˆ ์•ˆ์ •์ ์ž…๋‹ˆ๋‹ค.

๋‹ค์‹œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.
์„ธ๋ฅด๊ฒŒ์ด.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰