Sheriffing/How To/Landing patches: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 1: Line 1:
{{Sheriffing How To|Landing check-needed patches}}
{{Sheriffing How To|Landing check-needed patches}}
Sheriffs have the responsibility for landing checkin-needed patches on behalf of others who do not have the needed commit access to do so themselves or those who do not have the ability to watch their pushes afterwards.
Sheriffs have the responsibility for landing checkin-needed patches on behalf of others who do not have the needed commit access to do so themselves or those who do not have the ability to watch their pushes afterwards.<br />
Usually, patches should be landed after the merges and after the nightly builds started running. Of course, it can also be done when requested.


= Bugzilla queries for patches requiring check-in =
= Bugzilla queries for patches requiring check-in =
Line 20: Line 21:
*** Format should be something like "Bug 123456 - Add a null check to XYZ to avoid a crash. r=somebody"
*** Format should be something like "Bug 123456 - Add a null check to XYZ to avoid a crash. r=somebody"
* If a patch is missing commit information, remind the patch author to include it for future patches with a link to the [https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F Mercurial FAQ page] that describes how to set it.
* If a patch is missing commit information, remind the patch author to include it for future patches with a link to the [https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F Mercurial FAQ page] that describes how to set it.
The patches can be landed in 2 ways:
'''Automatically''', from <span style="color:#14866d">'''mozreview'''</span> – and the patches will land on '''AUTOLAND'''
'''Manually''', from the <span style="color:#14866d">'''console'''</span> – and the patches will land on '''INBOUND'''
== Landing patches via mozreview (reviewboard) - Autoland ==
*These patches will have an additional section on the bug, right above '''“Attachments”''', called <span style="color:#14866d">'''“MozReview Requests”'''</span>
[[File:Mozreview.png|frame|center]]
*'''Click the link''' under '''“MozReview Requests”''' and you will be redirected to another page, from where the commit can be landed:
[[File:Land1.jpg|frame|center]]
*Click on the '''dropdown menu''' from <span style="color:#14866d">'''Automation'''</span>, and then click on <span style="color:#14866d">'''Land Commits'''</span>.
<span style="color:#b32425">'''Note:  If you cannot land the patch from GUI:'''</span>
# '''Comment''' this message on the bug: ''“The patch doesn't meet the review requirements in MozReview needed for Autoland to push it - see http://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview/autoland.html#landing-commits“''
# '''Needinfo''' the developer
# '''Remove''' the checkin-needed tag
== Landing patches from the console - Inbound ==
We will have to identify the person that added the patch, and the one that reviewed the patch. For this, you can use: https://wiki.mozilla.org/Modules/All or https://phonebook.mozilla.org/ or https://mozillians.org/en-US/
These are the steps that you should follow:
# '''cd mozilla-unified'''
# '''hg pull inbound'''
# '''hg update inbound'''
# '''hg qimport bz://<bugnumber>''' <span style="color:#14866d">''//to import the patches from the chosen bug''</span>
# '''hg qseries'''  <span style="color:#14866d">''//check the patches in the queue''</span>
# '''hg qpush''' <span style="color:#14866d">''//apply patch. Use hg qpush -a if there are multiple patches''</span>
# '''hg log''' <span style="color:#14866d">''//check the commit message''</span>
# If in hg log, the name or e-mail of the reviewer are '''not correct''', use '''hg qref –u “Name <email>”'''
# '''hg qref -e''' <span style="color:#14866d">//to add the reviewer and/ or edit the commit message</span>
# '''hg qfinish -a''' <span style="color:#14866d">//turn all into permanent changesets</span>
# '''hg push -r . inbound'''
<span style="color:#b32425">'''Note: If you get the following error when pushing to inbound:  "abort: push creates new remote head ..." run:'''</span>
# '''hg pull --rebase inbound'''
# '''hg push -r . inbound'''
=== Deleting a patch from the tip ===
If you encounter any errors when applying a patch, you will have to:
* '''delete''' the patch from the queue
* '''needinfo''' the dev
* '''delete''' the checkin-needed tag
* '''leave a comment''' on the bug with the issue that stopped you from landing the bug.
And furthermore to :
* '''hg qpop'''
* '''hg qdelete <span style="color:#14866d"><patch_name></span>'''
* '''hg purge''' <span style="color:#14866d">''(--only if there are .rej files)''</span>
* '''hg update -C'''
== Relanding a revision ==
If requested, one or more revisions can be relanded after, for example, being backed out.
# '''hg graft -er/-esr <span style="color:#14866d"><revision number> OR <revision>::<revision></span>'''
# '''hg import <span style="color:#14866d"><revision link></span>'''
# '''hg commit --amend''' <span style="color:#14866d">//to update the commit message</span>'
# '''hg push -r . <span style="color:#14866d"><tree></span>'''
== Landing bugs with multiple patches, out of which one is a zip file ==
If there are other patches, except the zip file, do the following:
# '''hg qimport''' all the patches <span style="color:#b32425">UP TO</span> the zip file
# '''hg push -a''' <span style="color:#14866d">// if there are multiple patches</span>
# '''hg qfinish -a'''
# '''hg histedit''' <span style="color:#14866d">// if you need to edit the reviewers</span>
# '''hg finish -a'''
Then:
# Go to the bug in your VM, '''download''' the zip file, then '''unzip''' it <span style="color:#14866d">''(in your home directory to be easier)''</span>
# Go to your console and run h'''g qimport ~/bug.'''<span style="color:#14866d">'''patch'''</span> <span style="color:#14866d">''// bug.patch is the file from the zip; ~/ = home = path where you extracted the file''</span>
# '''hg qpush'''
# '''hg qref -e''' <span style="color:#14866d">// to edit reviewer when it's just one patch</span>
# '''hg finish -a'''
# '''hg qimport bz:<span style="color:#14866d">//bug</span>''' <span style="color:#14866d">// import the rest of the missing patches, the ones that are not zip or other formats</span>
# '''hg qpush -a'''
# '''hg qfinish -a'''
# '''hg histedit''' <span style="color:#14866d">// edit reviewers if necessary</span>
# '''hg push -r . inbound'''
== What to do in case you forget to update to inbound before importing patches ==
Landing Patches (rebasing your revision to the right tree in case you forgot to update to inbound before importing patches)
Example: Let's say you are on the top of Autoland and you want to land some patches on Inbound, but you forgot to update to inbound, so you already imported a few patches and you realize you are on Autoland instead of inbound.
What to do in order to rebase to the right tree:
# '''hg log -fr.'''  <span style="color:#14866d">// to force show the log and check how many revisions you have created - how many patches you have imported. Also you will need this later for the revision.</span>
[[File:Landing paches1.png|frame|center]]
# '''hg pull inbound'''
# '''hg rebase -s <span style="color:#14866d"><revision/changeset number of the bottom most patch></span> -d inbound'''
<span style="color:#b32425">Note:
revision number of the bottom most patch = in the case above is 19212c6d7051, we only need the second string of characters from the changeset.
-s = source;  -d = destination </span> Good to know: When running this command, hg will '''move(cut)''' all the patches from Autoland to Inbound, starting from the source (e.g:19212c6d7051) to the last patch. (top most patch).
[[File:Landing paches2.png|frame|center]]
# '''hg log''' <span style="color:#14866d">''// to check if the commands had the desired effect'' </span>
# '''hg update tip''' <span style="color:#14866d">''// this command will activate the rebase, will make sure that the changesets that were imported from the other tree are going to be in your tip for this specific tree. In this case inbound.'' </span>
[[File:Tip.png|frame|center]]
# '''hg out -r . inbound''' <span style="color:#14866d">''// check to see that the two patches rebased to inbound and are active in the tip'' <span>
# Once the patches are where they should, you can go ahead and push.
# '''hg push -r . inbound'''
Confirmed users
79

edits

Navigation menu