Open Source Hacking
Getting Access to and Using the Mozilla Try Server
There are obviously some guidelines available on the Mozilla Developer Network to help with all of this already, but I figure I’ll help with a nice abridged version that will cut through the fat to get at the meat and bones.
First things first. You will need a Mozilla hg account
- File a bug in the Repository Account Requests component. Okay okay, TECHNICALLY you are supposed to read the Commit Access Policy. It talks about the reasoning behind why they chose this kind of system and what each level entails. And since I doubt anyone reading this post needs above level 1 access (probably can’t skip levels too I guess) there isn’t much of a need.
- Fill out the ticket. This includes an appropriate bug title/name (E.G. Commit Access Level 1 for FirstName LastName). You will also need to include your public ssh key attached as a plain text file. Since I’m guessing you, the reader, use git then good! You can just use that very same one. Copy it to somewhere more accessible than you ~/.ssh directory and attach it to the bug. Finally, add the email you want to use as your account name.
- Next you need to send in a completed Committer’s Agreement. You have a couple of options here. You can print out the PDF and physically mail it to them (How old fashioned….), send them an email using the plain text versions in that link (Must be a S/MIME-signed email. I have no clue what that means so don’t ask), OR, like I chose, print the PDF fill it out and scan it onto a machine and then attach that to them in an email.
- If you followed the steps properly you will be notified when you have gained an account along with appropriate information. If something went wrong, you will get notified as well.
Now on to pushing patches!
Yeah, now your forced to use hg/Mercurial. I know it sucks. Thankfully you can avoid it in all other aspects and this part isn’t too painful.
- Obviously you will need this installed in some fashion. Mercurial can be downloaded here.
You will need to clone mozilla-central to somewhere on your system. Fairly simple:
hg clone http://hg.mozilla.org/mozilla-central/
Switch to the mozilla-central directory when you are done.
Like Git you can create custom aliases to make frequently used commands less painful. Create a file called .hgrc in your root (~/) and open it. I borrowed these from Jon Buckley:
username = FirstName LastName
git = 1
showfunc = 1
unified = 8
diff=-U 8 -p
try = ssh://hg.mozilla.org/try
nuke = strip 'roots(outgoing())'
- Next you will want to create a file called try in your repo. In there you will want to add the options that tell the try server what systems/types of builds you want to use. You can figure that out here. However most of the time using the defaults is perfect. Copy the text from the textbox on the page and place it in the try file you made. hg add that file and then hg commit -m “Some message, best to use the options you put in the file”.
You will need to add the mozilla try server to a hosts config at your .ssh directory. Chances are you might not have a config file in that directory already to do touch ~/.ssh/config. Open it now and add this to it:
- Now you will want to ensure your mozilla-central repo is up to date and need to do a pull. hg pull will do.
- Now you get to import your patch. Once again this is pretty simple: hg import ~/Path/To/Your/Patch
- Use one of your handy dandy little aliases and simply use the following command: hg push -f try
- If all goes well you shouldn’t have any problems as I’m fairly certain I included all the steps I missed that gave me problems. After that use another one of our handy aliases that helps return repo back to normal: hg nuke . You should receive an email shortly containing a link to your builds information.
Yay, you can push your patches now to the try server to have all the 600000+ tests run against it on multiple platforms at once! No more doing it yourself (although if you did this before, well, you’re probably insane).