-
Notifications
You must be signed in to change notification settings - Fork 51
/
code-review-interfaces.el
112 lines (80 loc) · 4.26 KB
/
code-review-interfaces.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
;;; code-review-interfaces.el --- Main APIs you need to provide to add a new forge -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 Wanderson Ferreira
;;
;; Author: Wanderson Ferreira <https://github.com/wandersoncferreira>
;; Maintainer: Wanderson Ferreira <[email protected]>
;; Version: 0.0.7
;; Homepage: https://github.com/wandersoncferreira/code-review
;; This file is not part of GNU Emacs.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Description
;;
;;; Code:
(cl-defgeneric code-review-pullreq-infos (obj fallback? callback)
"Return infos Pull Request from a OBJ, use FALLBACK? to minimal query, run CALLBACK.")
(cl-defgeneric code-review-infos-deferred (obj fallback?)
"Run OBJ and set if minimal query should be run using FALLBACK?.")
(cl-defgeneric code-review-pullreq-diff (obj callback)
"Return diff for OBJ running CALLBACK with results.")
(cl-defgeneric code-review-diff-deferred (obj)
"Run OBJ with deferred.")
(cl-defgeneric code-review-commit-diff (obj callback)
"Return diff for OBJ running CALLBACK with results.")
(cl-defgeneric code-review-commit-comments (obj callback)
"Return commit comments for OBJ running CALLBACK with results.")
(cl-defgeneric code-review-commit-comments-deferred (obj)
"Run OBJ with deferred.")
(cl-defgeneric code-review-commit-diff-deferred (obj)
"Run OBJ with deferred.")
(cl-defgeneric code-review-send-review (obj callback)
"Send review stored in OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-send-comments (obj callback)
"Send comments stored in OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-send-replies (obj callback)
"Send review comment replies stored in OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-get-labels (obj)
"Sync call to get a list of labels from OBJ.")
(cl-defgeneric code-review-send-labels (obj callback)
"Sync call to set a list of labels for an OBJ and call CALLBACK afterward..")
(cl-defgeneric code-review-get-assignees (obj)
"Sync call to get a list of assignees from OBJ.")
(cl-defgeneric code-review-send-assignee (obj callback)
"Set an assignee for an OBJ and call CALLBACK afterward..")
(cl-defgeneric code-review-get-milestones (obj)
"Sync call to get a list of milestones from OBJ.")
(cl-defgeneric code-review-send-milestone (obj callback)
"Set a milestone for an OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-send-title (obj callback)
"Set a pullrequest title for an OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-send-description (obj callback)
"Set a pullrequest description for an OBJ and call CALLBACK afterward.")
(cl-defgeneric code-review-merge (obj strategy)
"Merge a PR for an OBJ using a given STRATEGY.")
(cl-defgeneric code-review-send-reaction (obj context-name comment-id reaction)
"Set a REACTION to a COMMENT-ID in OBJ given a CONTEXT-NAME.")
(cl-defgeneric code-review-delete-reaction (obj context-name comment-id reaction-id)
"Delete a REACTION to a COMMENT-ID in OBJ given a CONTEXT-NAME.")
(cl-defgeneric code-review-get-assignable-users (obj)
"Get users that can review a PR for OBJ.")
(cl-defgeneric code-review-request-review (obj user-ids callback)
"Request for OBJ a list of USER-IDS to review a PR and call CALLBACK afterward.")
(cl-defgeneric code-review-new-issue (obj body title callback)
"Create new issue in OBJ with BODY and TITLE and call CALLBACK.")
(cl-defgeneric code-review-new-issue-comment (obj comment-msg callback)
"Create a new comment issue for OBJ sending the COMMENT-MSG and call CALLBACK.")
(cl-defgeneric code-review-new-code-comment (obj local-comment callback)
"Create a new diff comment for OBJ given a LOCAL-COMMENT and call CALLBACK.")
(provide 'code-review-interfaces)
;;; code-review-interfaces.el ends here