简体   繁体   中英

How to set up a code review workflow using gitlab,jenkins,git?

So my question is that i want to set up a code review flow , the tools i have are : git,gitlab,jenkins.. my idea is like to have a kind of forms or checklists that a member of the team need to fill whenever other member want to merge some new code , if the checklist are filled correctly and the new code is approved by the reviewer then the code should be merge, else the merge request is refused.

does everyone have an idea how i can achieve this? or maybe have a better idea than having a checklist?

thank you all,

Best regards

You can use GitLab CI, is like Jenkins, and he can pass the test,compile and do the tasks what you want before the merge. In Gitlab you have automerge, that is completed when you configure. ( https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html )

With GitLab 13.7 (December 2020), you don't need a third-party tool like Gerrit.

You now have officially merge-request reviewers:

Reviewers for Merge Requests

Asking a colleague to review your code should be a routine part of contributing code, but it's often needlessly complex.

A simple task like asking for a review can lead to confusion. For example, how should you ask? An email? Comment? Chat message?

Without a formal process, reviews can be inconsistent and hard to keep track of. Previously, an option was to assign a reviewer to a merge request, but even with this formality, both the author and the reviewer appeared in the same assignee field, making it hard for other team members to know who was doing what.

GitLab 13.7 introduces reviewers for merge requests, which allows authors to request a review from someone.
The new “Reviewers” field allows users to be designated as reviewers in a similar way to assignees. The reviewers receive a notification inviting them to review the merge request.

This provides a formal process for requesting a review and clarifies the roles of each user in a merge request.

Future iterations will include showing the most relevant reviewers for a merge request as well as a streamlined merge request approval flow that puts reviewers at the center.
You can follow along in the merge request reviewer assignment epic for more details.

https://about.gitlab.com/images/13_7/reviewers_sidebar.png -- 合并请求的审阅者

See Documentation and Issue .

And the same GitLab 13.7 (December 2020) facilitates that review process with:

Choose to show one file at a time directly from merge requests

Merge request reviews are an essential task to ensure quality code from contributors, as this is where most of the communication between author and reviewer takes place. However, as merge requests become larger and more files are involved, navigation and performance of merge request diffs can become difficult.

GitLab 13.7 introduces the option to show one file at a time in the merge request view. As you navigate to the Changes tab of the merge request, click the gear icon and check the box labeled Show one file at a time . This will display a single file at a time and enable the Prev and Next buttons to navigate among files.

Single file mode provides a cleaner workspace and enhances the reviewer focus on a single file, while improving the performance and navigation of the merge request diff.

https://about.gitlab.com/images/13_7/singlefile-mode.png -- 直接从合并请求中选择一次显示一个文件

See Documentation and Issue .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM