11# Merge requests
22## Introduction
33Since introducing GitLab to our workflow, we've been using it as our primary
4- tool for reviewing code.
5- While issues still reside in Jira the actual merging, deploying, commenting
6- and discussing code is handled through GitLab.
4+ tool for reviewing code. While issues still reside in JIRA the actual merging,
5+ deploying, commenting and discussing code is handled through GitLab.
76
87## Prerequisite
98The following instructions assume you have a working GitLab account. If you
109don't yet have access to the web interface of GitLab, contact Operations.
1110
1211## Lifecycle of a merge request
1312### Creation procedure
14- Let's assume you've worked on an issue enough to set the status to "Review" ,
13+ Let's assume you've worked on an issue enough to set the status to review ,
1514which would put it into the review's queue.
1615
17- Before you set the status to "Review" , make sure that there's a Merge Request
16+ Before you set the status to review , make sure that there's a Merge Request
1817(henceforth referred to as "MR") available in GitLab.
1918
2019These are the steps necessary:
@@ -27,49 +26,48 @@ These are the steps necessary:
27265 . Click the green "New Merge Request" button, located in the top right part of
2827 the page.
29286 . Here you'll need to provide the ** source** branch and the ** target** branch.
30- The source branch should be the branch which you wish to have reviewed, while
31- the target branch should be what you want to merge into.
32- Unless you've been asked to set it to something else, you'll want the target
33- branch to be set to ` master ` .
29+ The source branch should be the branch which you wish to have reviewed,
30+ while the target branch should be what you want to merge into. Unless
31+ you've been asked to set it to something else, you'll want the target branch
32+ to be set to ` master ` .
34337 . Press the blue "Compare branches" button.
35348 . Enter title and description, following the guidelines written in the
3635 ** Title and Description guidelines** section.
37- 9 . Set label "Ready for review".
38- 10 . Assign it to another developer.
39369 . At this point you can review the MR one final time before pressing the
4037 "Submit merge request" button.
4138
42- This should take you to the page with the now created MR.
43- All that is necessary from here is to ** add a link to the MR in the Jira ticket** .
39+ This should take you to the page with the now created MR.
40+
41+ All that is necessary from here is to ** add a link to the MR in the JIRA ticket** .
4442
4543#### Title and Description guidelines
4644The title should always look something like this:
4745
4846 #12345: Adjust constant in warpcore configuration to prevent overheating
4947
50- Notice the issue number at the start, including the # character.
51- Following the issue number should be general description of what the MR changes.
48+ Notice the issue number at the start, including the # character. Following the
49+ issue number should be general description of what the MR changes.
5250
5351The description should include the following:
5452
55- * A direct link to the Jira ticket, in the form of: ` refs [#12345](https://jira.server/12345) `
56- * What the MR changes, being a bit more descriptive than the title.
57- * If there's something you're unsure of how it should be done, point this out so
53+ * A direct link to the JIRA ticket, in the form of: ` refs [#12345](https://jira.server/12345) `
54+ * What the MR changes, being a bit more descriptive than the title. If there's
55+ * something you're unsure of how it should be done, point this out so
5856 that the reviewer can help you out.
5957* If necessary, include information that would help the reviewer understand
6058 * why* you made certain changes. This information should already be present in
6159 the form of [ well written commit messages] ( ../../style/git ) , but it doesn't
6260 hurt including this in the MR description.
6361* If there are parts of the changeset that can be ignored (you added a library
64- to vendor, resulting in thousands of lines of code), you should point this out
65- so the reviewer doesn't waste time sifting through vendor code.
62+ to vendor, resulting in thousands of lines of code), you should point this
63+ out so the reviewer doesn't waste time sifting through vendor code.
6664* If the merge will require some additional deploy instructions, include these
6765 so that they too can be reviewed.
6866
6967
7068### Working with merge requests
7169#### Git
72- The process of working and commiting when working in conjunction with MRs
70+ The process of working and committing when working in conjunction with MRs
7371doesn't differ much from how work has been handled when we only used Redmine,
7472but there's one major difference:
7573
@@ -81,13 +79,12 @@ What does this mean?
8179Let's say you've submitted your MR and the reviewer wants you to change
8280something in a previous commit.
8381
84- If you previously had the habit of creating
85- a commit, rebasing and squashing right away: refrain from doing so. The
86- preferred way of doing things in this system [ is to create fixup commits] [ fixup ]
87- that are squashed at the very end of the life cycle of the MR, so pretty much
88- when the reviewer approves the MR for merging.
89- The rebase process would be done by the author when asked from the reviewer, depending
90- on the MR's complexity.
82+ If you previously had the habit of creating a commit, rebasing and squashing
83+ right away: refrain from doing so. The preferred way of doing things in this
84+ system [ is to create fixup commits] [ fixup ] that are squashed at the very end of
85+ the life cycle of the MR, so pretty much when the reviewer approves the MR for
86+ merging. The rebase process would be done by the author when asked from the
87+ reviewer, depending on the MR's complexity.
9188
9289 [ fixup ] : http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html
9390
@@ -97,8 +94,8 @@ If there's no need to rewrite history, for instance if you start adding new
9794features after the MR is submitted, just keep working as you always have.
9895
9996#### The merge request interface
100- If you make an adjustment (e.g. to address a comment that was left by
101- a reviewer) and push the resulting code, this will immediately be reflected in
97+ If you make an adjustment (e.g. to address a comment that was left by a
98+ reviewer) and push the resulting code, this will immediately be reflected in
10299the MR. This way, the reviewer will always see the latest version of the branch
103100in the MR.
104101
@@ -117,17 +114,12 @@ become easier to if you surround it with backticks.
117114 [ GFMD ] : http://doc.gitlab.com/ce/markdown/markdown.html
118115
119116### Closing a merge request
120- When the reviewer considers the code ready to merge, he'll say so, and a label
121- with the name ` Ready for release ` will be applied, indicating that the branch is
122- ready to merge and deploy.
123- It's up to the reviewer applying the label and unassigning the MR.
124-
125117Do not close the MR, it will be closed automatically when the branch is merged
126118into ` next ` (or whatever other branch was set as the target branch).
127119
128120## Finding merge requests
129121As stated at the end of the "Creation procedure" section, if an issue in
130- Jira has code that should be reviewed, a link to the corresponding MR in
122+ JIRA has code that should be reviewed, a link to the corresponding MR in
131123GitLab * must* be posted. This link will probably be the easiest way to find the
132124MR in GitLab.
133125
0 commit comments