Services/Sync/Getting Started
Using Bugzilla
Every code change starts out as a bug in Bugzilla where the general approach can be discussed. The bug should eventually be assigned to somebody who will upload one or more patches for review. Code can only be reviewed by module owners and their peers, see code review policy for more information. If the review has been granted and all review comments have been addressed, the patches may be checked into services-central, which is the Mercurial repository used for Services client work.
On rare occasions it will make more sense to land work on mozilla-central instead — for example, if a change needs to propagate upstream before the regular merge from services-central to mozilla-central. This might involve additional procedures (e.g., you need to request approval in addition to review.)
Using Mercurial
Mozilla's development process is very much patch driven. Mercurial Patch Queues, although a bit awkward to use at times, fit this process rather well. It is recommended you familiarize yourself with them and use them.
Configuration
Marco Bonardo has some general purpose tips for Mozilla developers on how to format patches before uploading them to Bugzilla.
Essentially it is recommended you put the following in your ~/.hgrc:
[ui] username = Your Name <you@mozilla.com> [extensions] hgext.mq = [diff] git = 1 unified = 8 [defaults] diff = -pU8 qdiff = -pU8 qnew = -U qseries = -sv
If you find yourself mixing up `hg qpush` (push a patch onto your queue) and `hg push` (irreversibly push your changes out into the world) try adding this:
[hooks] preoutgoing.confirm = read -p 'Are you sure you want to push to remote? (y/n): '; echo $REPLY | grep -q 'y'
Repositories
services-central
services-central is the clone of mozilla-central in which Sync (and other stable Services projects) are developed.
Things that live there:
- The Services client libraries in services/crypto/ and services/sync.
- Built-in UI in browser/base/content/.
fx-sync
Sync was primarily developed in the fx-sync repository. The code there includes support for the Sync add-on; it's deprecated since Firefox 4.
Things that live there:
- The Services client libraries in services/crypto/ and services/sync.
- The Firefox Sync add-on in addon/*
- The Firefox 3.x and Fennec 1.x UIs for the Sync add-on in ui/*
mozilla-central
mozilla-central is the repository for Firefox and the base repository for other Mozilla-based applications. How mozilla-central is relevant to Sync:
- services-central is periodically merged into mozilla-central.
- The integrated UI for Firefox Sync lives in browser/base/*, along with the rest of the Firefox UI.
- Firefox releases are spun from mozilla-central. Changes made to services-central don't directly reach users.
Try server
Because Sync is developed in a clone of mozilla-central, you can use ordinary "try build" procedures to test your changes. (You don't always need to, though; one of the advantages of having an integration branch like services-central is that we're at liberty to break it!)
To push to try, teave your changes as applied mq patches. Then run:
hg push -f ssh://hg.mozilla.org/try/