Skip to content

Commit

Permalink
add changelog and change :loop to :parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
wandersoncferreira committed Oct 11, 2021
1 parent 069dc68 commit e4e85ab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# Unreleased

- [#81](https://github.com/charignon/github-review/pull/81): Allow reply to code comments. Enable via `github-review-reply-inline-comments`. See README.
- [#87](https://github.com/charignon/github-review/pull/87): Enable `outline-mode` by default to allow hide/show hunks. See `outline-*` commands.
43 changes: 22 additions & 21 deletions github-review.el
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,28 @@ CALLBACK will be called back when done"
(defun github-review-post-review-replies (pr-alist replies callback)
"Submit replies to review comments inline."
(deferred:$
(deferred:loop
replies
(lambda (comment)
(let-alist pr-alist
(let* ((path (a-get comment 'path))
(position (a-get comment 'position))
(comment-id (alist-get (s-concat path
":"
(number-to-string position))
github-review-pos->databaseid
nil nil 'equal))
(body (a-get comment 'body)))
(ghub-post (format "/repos/%s/%s/pulls/%s/comments/%s/replies"
.owner .repo .num comment-id)
nil
:payload (a-alist 'body body)
:headers github-review-diffheader
:auth 'github-review
:host (github-review-api-host pr-alist)
:callback (lambda (&rest _))
:errorback #'github-review-errback)))))
(deferred:parallel
(-map (lambda (comment)
(lambda ()
(let-alist pr-alist
(let* ((path (a-get comment 'path))
(position (a-get comment 'position))
(comment-id (alist-get (s-concat path
":"
(number-to-string position))
github-review-pos->databaseid
nil nil 'equal))
(body (a-get comment 'body)))
(ghub-post (format "/repos/%s/%s/pulls/%s/comments/%s/replies"
.owner .repo .num comment-id)
nil
:payload (a-alist 'body body)
:headers github-review-diffheader
:auth 'github-review
:host (github-review-api-host pr-alist)
:callback (lambda (&rest _))
:errorback #'github-review-errback)))))
replies))

(deferred:nextc it
(lambda (x)
Expand Down

0 comments on commit e4e85ab

Please sign in to comment.