-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code review support #266
Code review support #266
Commits on Apr 5, 2021
-
Save more informations in some forge objects
In order to improve user experience and support new features like code-review or replies, some informations need to be added in issue / pullrequest objects and a new object pullreq-version has been created. * issue-post object: -> thread-id: id of a thread discussion -> reply-to: id of the initial post in reply to * pullreq object: -> versions: list of version object * pullreq-post object: -> thread-id: id of a thread discussion -> diff-p: describe if this post is a diff post -> resolved-by: the user who resolved this thread -> reply-to: id of the initial post in reply to -> head-ref: head SHA for this post -> commit-ref: commit SHA for this post -> base-ref: base SHA for this post -> path: file path where the diff is posted -> old-line: the line where the diff is posted before changes -> new-line: the line where the diff is posted after changes * pullreq-version: contains informations like the base and head SHA reference of a pullreq version. These informations are needed for eg. when we want to know for which version of a pullreq are diff posts. If an old forge database is detected, it will be upgraded to the new version 8. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e0e2c57 - Browse repository at this point
Copy the full SHA e0e2c57View commit details -
gitlab: use discussions API for issue/pullreq posts
The discussions API provide more informations for each issue/pullreq post. We can use this API to retrieve the following informations: - Issue: thread-id, reply-to - Pullreq: thread-id, diff-p, reply-to, head/commit/base ref, path, old-line, new-line Source: https://docs.gitlab.com/ee/api/discussions.html Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 830d1f9 - Browse repository at this point
Copy the full SHA 830d1f9View commit details -
gitlab: fetch pullreq versions
The gitlab API give the possibility to fetch versions for each diff from a pullreq. Source: https://docs.gitlab.com/ee/api/merge_requests.html#get-mr-diff-versions Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 32fb522 - Browse repository at this point
Copy the full SHA 32fb522View commit details -
github: fill issue/pullreq/version objects
With PullRequest and PullRequestReviewThread graphql object, we can set some fields of issue, pull-request and version objects. In order to access to some elements of PullRequestReviewThread, we need to toggle "Multi-Line Comments Preview": https://developer.github.com/v4/previews/#multi-line-comments-preview Source: https://developer.github.com/v4/object/pullrequest/ https://developer.github.com/v4/object/pullrequestreviewthread/ Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7ec4933 - Browse repository at this point
Copy the full SHA 7ec4933View commit details -
pullreq: display version sections
In the pullreq view, the version sections are now displayed instead of commits. These sections contains commits and diff changes for each version. The number of comments per commits or diff changes are also displayed. Example: Diff changes --> Latest Version: (6 comments) Commits --> 3634ab3 commit-A (4 comments) Commits --> 0df0d75 commit-B (1 comments) Commits --> 441de84 commit-C (1 comments) Press RET on "Diff changes" will show the diff of all the commits. Press RET on "Commits" will show the corresponding commit. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 04f9931 - Browse repository at this point
Copy the full SHA 04f9931View commit details -
Refactor and don't display diff posts in topic view
In the topic view the diff posts should not be displayed. We only display posts/replies related to the topic conversation. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b06cb7 - Browse repository at this point
Copy the full SHA 8b06cb7View commit details -
Display replies in thread section
The replies are now inserted in the correct thread section and are indented. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for aacb2ee - Browse repository at this point
Copy the full SHA aacb2eeView commit details -
After RET in version section, the diff posts are now displayed in the magit diff buffer. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 795a4e2 - Browse repository at this point
Copy the full SHA 795a4e2View commit details -
Use forge-diff-visit-file in hunk section
Originally when pressing RET in a hunk section, it opens the file at the right position in the buffer. With a magit-diff buffer which contains diff posts, this feature is broken, the position in the file buffer is not correct. This patch handle this case when the magit-diff buffer contains diff posts. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e77e9ff - Browse repository at this point
Copy the full SHA e77e9ffView commit details -
forge-create-diff-post: New command
This new command allow the user to create a diff post from a magit-diff buffer. The diff buffer has to be generated from a pullreq. This command is only supported by Gitlab and Github. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cecd093 - Browse repository at this point
Copy the full SHA cecd093View commit details -
This new command allow the user to reply to any post. This command is only supported by Gitlab and Github. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a41f705 - Browse repository at this point
Copy the full SHA a41f705View commit details -
gitlab: support pull single topic
With a gitlab repo, it's now possible to pull a single topic. It can be either a pullreq or issue topic. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 49c72a8 - Browse repository at this point
Copy the full SHA 49c72a8View commit details -
In the code all the "comment" are treated as a post object. A post object can be found in a pull-request or an issue for eg. To avoid confusion it makes more sense to use "post" instead of "comment" in the function name when handling post object. Also forge-comment-at-point function has been removed since it's not used. Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cfa9e4d - Browse repository at this point
Copy the full SHA cfa9e4dView commit details -
github: handle diff post when deleting post
Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b89bd57 - Browse repository at this point
Copy the full SHA b89bd57View commit details -
github: support edition of diff post
When editing a diff post, the URL must be the following format: /repos/:owner/:repo/pulls/comments/:comment_id Source: https://developer.github.com/v3/pulls/comments/#edit-a-comment Signed-off-by: Julien Masson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for db7aeca - Browse repository at this point
Copy the full SHA db7aecaView commit details