Skip to content

Commit

Permalink
ghub-fetch-repository: Fetch reviewThreads, baseRefOid/headRefOid
Browse files Browse the repository at this point in the history
PullRequestReviewThread object is a threaded list of review comments
for a given pull request.

headRefOid and baseRefOid are the rescpective head and base SHA
reference for a given pull request.

Signed-off-by: Julien Masson <[email protected]>
  • Loading branch information
JulienMasson committed Apr 15, 2020
1 parent fc8a400 commit a044be6
Showing 1 changed file with 79 additions and 1 deletion.
80 changes: 79 additions & 1 deletion ghub-graphql.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ behave as for `ghub-request' (which see)."
body
(baseRef name
(repository nameWithOwner))
baseRefOid
(headRef name
(repository (owner login)
nameWithOwner))
headRefOid
(assignees [(:edges t)]
id)
(reviewRequests [(:edges t)]
Expand All @@ -157,6 +159,82 @@ behave as for `ghub-request' (which see)."
createdAt
updatedAt
body)
;; ERRORS !!!!
;; if: peculiar error: ((type . "MAX_NODE_LIMIT_EXCEEDED") (locations ((line . 232) (column . 3))) (message . "By the time this query traverses to the comments connection, it is requesting up to 1,000,000 possible nodes which exceeds the maximum limit of 500,000."))
;;
;; (reviewThreads [(:edges t)]
;; id
;; line
;; originalLine
;; diffSide
;; (resolvedBy login)
;; (comments [(:edges t)]
;; id
;; databaseId
;; (author login)
;; createdAt
;; updatedAt
;; body
;; (replyTo databaseId)
;; (originalCommit oid)
;; path))
(labels [(:edges t)]
id)))))

(defconst ghub-fetch-repository-review-threads
'(query
(repository
[(owner $owner String!)
(name $name String!)]
(pullRequests [(:edges t)
(:singular pullRequest number)
(orderBy ((field UPDATED_AT) (direction DESC)))]
number
state
(author login)
title
createdAt
updatedAt
closedAt
mergedAt
locked
maintainerCanModify
isCrossRepository
(milestone id)
body
(baseRef name
(repository nameWithOwner))
baseRefOid
(headRef name
(repository (owner login)
nameWithOwner))
headRefOid
(assignees [(:edges t)]
id)
(reviewRequests [(:edges t)]
(requestedReviewer "... on User { id }\n"))
(comments [(:edges t)]
databaseId
(author login)
createdAt
updatedAt
body)
(reviewThreads [(:edges t)]
id
line
originalLine
diffSide
(resolvedBy login)
(comments [(:edges t)]
id
databaseId
(author login)
createdAt
updatedAt
body
(replyTo databaseId)
(originalCommit oid)
path))
(labels [(:edges t)]
id)))))

Expand Down Expand Up @@ -208,7 +286,7 @@ data as the only argument."
Once all data has been collected, CALLBACK is called with the
data as the only argument."
(ghub--graphql-vacuum (ghub--graphql-prepare-query
ghub-fetch-repository
ghub-fetch-repository-review-threads
`(repository pullRequests (pullRequest . ,number)))
`((owner . ,owner)
(name . ,name))
Expand Down

0 comments on commit a044be6

Please sign in to comment.