Auto-tools/Projects/Mozmill/RepoSetup: Difference between revisions

(update to 1.5.1 workflow, correct some statements)
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= Getting Started =
= Getting Started =
* Get a [https://github.com/ github account]
* Get a [https://github.com/ GitHub account]
* Fork the [http://github.com/mozautomation/mozmill mozautomation/mozmill] repo (use the github UI for this)
* Fork the [http://github.com/mozilla/mozmill mozilla/mozmill] repo (use the Github UI for this)
* Install [http://git-scm.com/ git] on your system
* Install [http://git-scm.com/ git] on your system
* Clone your fork using your ssh key URL on github:  
* Clone your fork using your ssh key URL on Github:  
<pre>git clone git@github.com:<your-github-username>/mozmill.git</pre>
<pre>git clone git@github.com:<your-github-username>/mozmill.git</pre>
* If you don't want to get a github account, you can still clone the repository, but you won't be able to push upstream or issue pull requests:
* If you don't want to get a Github account, you can still clone the repository, but you won't be able to push upstream or issue pull requests:
<pre>git clone http://github.com/mozautomation/mozmill.git</pre>
<pre>git clone http://github.com/mozilla/mozmill.git</pre>


= Setting up for Development on Master =
= Setting up for Development on Master =
Master is where the next version of Mozmill comes from.  To get ready to work here, you'll need to be able to pull in changes from the remote mozautomation repo.  To set that up, you add it as a remote repo:
Master is where the next version of Mozmill comes from.  To get ready to work here, you'll need to be able to pull in changes from the remote mozautomation repo.  To set that up, you add it as a remote repo:
<pre>git remote add mozauto git://github.com/mozautomation/mozmill.git</pre>
<pre>cd mozmill; git remote add mozilla git://github.com/mozilla/mozmill.git</pre>
 
If you are going to commit to master:
<pre>git remote add mozilla git@github.com:mozilla/mozmill.git</pre>


Here's how to stay up to date with the remote mozautomation repository:
Here's how to stay up to date with the remote mozautomation repository:
<pre>
<pre>
git pull --rebase mozauto master  // Pulls changes from mozauto to your local machine
git pull --rebase mozilla master  # Pulls changes from mozilla to your local machine
git push origin master            // Pushes any changes from mozauto to your Github fork
git push origin master            # Pushes any changes from mozilla to your Github fork
</pre>
</pre>
Now you're in sync.  Unless you're working on a maintenance release, skip down to "getting stuff done".
Now you're in sync.  Unless you're working on a maintenance release, skip down to "getting stuff done".


= Setting up for Development on 1.5.1 =
= Setting up for Development on 1.5 =
For work on a maintenance release of Mozmill, we'll use the maintenance release branch.  Work for the next major version of Mozmill will be done against the "master" branch, which is already set up.  Here's how to set up the maintenance branch on your system (Assuming you've already added mozautomation as a remote repository).
For work on a maintenance release of Mozmill, we'll use the maintenance release branch.  Work for the next major version of Mozmill will be done against the "master" branch, which is already set up.  Here's how to set up the maintenance branch on your system (Assuming you've already added mozautomation as a remote repository).
Pull the 1.5.1 code into a local branch:
Pull the 1.5 code into a local branch:
<pre>
<pre>
git branch hotfix-1.5.1 mozauto/hotfix-1.5.1
git fetch mozilla
git checkout hotfix-1.5.1
git branch hotfix-1.5 mozilla/hotfix-1.5
git checkout hotfix-1.5
</pre>
</pre>
Now you're on a local branch called "hotfix-1.5.1" with the 1.5.1 code.  Use <tt>git checkout</tt> to switch between local branches.
Now you're on a local branch called "hotfix-1.5" with the 1.5 code.  Use <tt>git checkout</tt> to switch between local branches.
 
To keep your hotfix-1.5.1 branch updated with the changes to mozauto's 1.5.1 branch:
<pre>git pull --rebase mozauto hotfix-1.5.1</pre>


To keep your hotfix-1.5 branch updated with the changes to mozauto's 1.5 branch:
<pre>git pull --rebase mozilla hotfix-1.5</pre>


= Getting Stuff Done =
= Getting Stuff Done =
Line 45: Line 48:


== Push a Feature branch to Github ==
== Push a Feature branch to Github ==
If you want give people a link to your new feature or show someone your code, you can push your local changes to your remote fork on Github so that it appears in that UI:
<pre>
<pre>
git checkout myfeature        // switch to feature branch if not already on it
git checkout myfeature        // switch to feature branch if not already on it
Line 53: Line 57:
We want to diff your feature branch against the master branch.  So ensure your master is up to date and create the diff:
We want to diff your feature branch against the master branch.  So ensure your master is up to date and create the diff:
<pre>
<pre>
git checkout myfeature                 // switch to myfeature branch if not already on it
git checkout myfeature   // switch to myfeature branch if not already on it
git diff -U8 -p master > mypatch.diff   // Create the patch
git rebase -i master    // Rewrite commits to a single one
git format-patch HEAD^   // Create the patch
</pre>
</pre>
Now, attach that patch to a bug in [http://bugzilla.mozilla.org Bugzilla] for review.  Don't forget to set the "Review" flag to "?" and add one of the Mozmill module owners in the text box to the right. When in doubt, put in :ctalbert.
Now, attach the created file to a bug in [http://bugzilla.mozilla.org Bugzilla] for review.  Don't forget to set the "Review" flag to "?" and add one of the Mozmill module owners in the text box to the right. When in doubt, put in :ctalbert.


== Ready to Push ==
== Ready to Push ==
Line 67: Line 72:
</pre>
</pre>


Ok, you've gotten your review, your commits are in good shape, and your commit message is correct, then you're ready to push, let's say you want to push to mozauto/master:
Ok, you've gotten your review, your commits are in good shape, and your commit message is correct, then you're ready to push, let's say you want to push to mozilla/master:
<pre>
<pre>
git checkout master              // Switch to master branch
git checkout master              // Switch to master branch
git pull --rebase mozauto master // Ensure your master is up to date: see below...
git pull --rebase mozilla master // Ensure your master is up to date: see below...
git merge myfeature              // Merges your commits to the master
git merge myfeature              // Merges your commits to the master
git push origin master          // Pushes to your fork
git push origin master          // Pushes to your fork
git push mozauto master          // Pushes to mozautomation master
git push mozilla master          // Pushes to mozilla master
                                 // PARTY!
                                 // PARTY!
</pre>
</pre>
Line 95: Line 100:
This is about writing tests for the Mozmill tool itself, not writing Mozmill tests.  For writing Mozmill tests, please refer to the [https://developer.mozilla.org/en/Mozmill Mozilla Developer Network pages].  
This is about writing tests for the Mozmill tool itself, not writing Mozmill tests.  For writing Mozmill tests, please refer to the [https://developer.mozilla.org/en/Mozmill Mozilla Developer Network pages].  


A test framework for the Mozmill tool itself is being constructed. For now, do the best you can by writing a simple piece of JavaScript or Python to test the feature you're adding. You can also write a Mozmill test to test itself for this as well.  Add your test to the mozmill/test directory. 
A test framework for the Mozmill tool itself has been constructed. See: https://github.com/mozilla/mozmill/tree/master/mutt
 
We'll update here once we have something more complete.
canmove, Confirmed users, Bureaucrats and Sysops emeriti
4,714

edits