Jetpack/Integration Process: Difference between revisions

→‎Checking changes: mention build files which need to be updated.
(→‎Checking changes: mention build files which need to be updated.)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page should include instructions on updating mozilla-inbound with the latest version of the SDK code.
This page includes instructions on updating fx-team with the latest version of the SDK code.


= From Git... =
= Setting up the mercurial tree =


== Create a new version branch ==
When you don't yet have a mercurial clone dedicated for doing uplifts do this:
 
hg clone https://hg.mozilla.org/integration/fx-team/ fx-team
cd fx-team/addon-sdk/source
git init
git remote add origin git@github.com:mozilla/addon-sdk.git
git fetch origin
git checkout -f <i>firefoxXX</i> #where XX is the current version you're uplifting to
 
This will give you the latest fx-team code and update the SDK files to the latest versions from the <i>firefoxXX</i> branch, in some cases that might be newer than those already in fx-team.
 
= Performing the uplift =
 
== Check for changes requiring uplift to git ==
 
Sometimes SDK code is changed directly in mercurial. We have to make sure we aren't clobbering those when we uplift.
 
# Look at http://hgchanges.fractalbrew.com/fx-team/file/addon-sdk/source and see if there are any non-uplift changesets listed since the last uplift.
# If there are check if they have been uplifted to git yet, there will normally be a comment in the bug from the githubbot.
# If not you need to land the SDK part of that changes into master before doing anything else. Make sure to copy the commit message and author from the original mercurial patch.
 
== Updating the version branches ==
 
We track the code uplifted to Firefox in branches in git, one for each version of Firefox. Each week when uplifting we merge master into the release branch for the release it will land in.
 
If the release branch for the current nightly version doesn't exist (the first week after a merge to aurora) then do this:


From your SDK repository:
From your SDK repository:
Line 9: Line 34:
  git checkout master
  git checkout master
  git pull origin master
  git pull origin master
  git checkout -b <i>firefoxXX</i> #where XX is the new Firefox version number on inbound
  git checkout -b <i>firefoxXX</i> #where XX is the new Firefox version number on fx-team
  git push -u origin <i>firefoxXX</i>
  git push -u origin <i>firefoxXX</i>


This creates a new <i>firefoxXX</i> branch in git and pushes it to the upstream repository for use. This new branch will track whatever code is in the SDK's folder in mercurial.
This creates a new <i>firefoxXX</i> branch in git and pushes it to the upstream repository for use. This new branch will track whatever code is in the SDK's folder in mercurial.


== Updating that branch ==
Any other week when the branch already exists:
 
Pick up new changes from the master branch every week or as needed:
Pick up new changes from the master branch every week or as needed:
  # merge master to <i>firefoxXX</i> directly:
  # merge master to <i>firefoxXX</i> directly:
Line 23: Line 49:
  git push origin <i>firefoxXX</i>
  git push origin <i>firefoxXX</i>


= From Mercurial =
== Creating a bug ==


== If you haven't checked out from mercurial before ==
The first step is to create a bug to track the uplift. It should be in Add-on SDK::General, P1 and contain the list of changes included in the uplift, a github link works well for this. {{bug|947501}} is an example. This should also be used in the commit message, see https://hg.mozilla.org/integration/fx-team/rev/9ece804de146


hg clone https://hg.mozilla.org/integration/mozilla-inbound/ inbound
== Updating the SDK code inside mercurial ==
cd inbound/addon-sdk/source
git init
git remote add origin git@github.com:mozilla/addon-sdk.git
git fetch origin
git checkout -f <i>firefoxXX</i> #where XX is the current version you're uplifting to


This will give you the latest mozilla-inbound code and update the SDK files to the latest versions from the <i>firefoxXX</i> branch, in some cases that might be newer than those already in mozilla-inbound.
  cd fx-team
 
  hg pull -u # updates to the latest version of fx-team
== If you have previously done the above ==
 
  cd inbound
  hg pull -u
  cd addon-sdk/source
  cd addon-sdk/source
  git reset --hard <i>firefoxXX</i> # undoes any backouts that happened in hg, XX is current m-i version number
  git reset --hard <i>firefoxXX</i> # undoes any backouts that happened in hg, XX is current m-i version number
  git pull origin <i>firefoxXX</i>  
  git pull origin <i>firefoxXX</i>  
cd ../..


Updates the Firefox and SDK files to the latest versions from the integration branch.
Updates the Firefox and SDK files to the latest versions from the integration branch.
== Checking changes ==
After updating the git and hg repositories you should add any new files from git and verify you haven't accidentally changed anything outside the add-on SDK tree. From the fx-team source directory:
hg addremove addon-sdk/source
hg status -X addon-sdk/source  # Should show no results
hg status -ur addon-sdk/source # Should show no results
hg status # Shows you all the changes you're about to land
=== addon-sdk/moz.build ===
Make sure that the addon-sdk/moz.build file is correct, you can use this script to update it:
./mach generate-addon-sdk-moz-build
This is not a perfect script though, it may have bugs so if you notice something file something.
=== addon-sdk/source/test/jetpack-package.ini ===
There is no script to update this at the moment, this is bug 1119600, so updates must be done by hand.
=== addon-sdk/source/test/addons/jetpack-package.ini ===
There is no script to update this at the moment, this is bug 1119601, so updates must be done by hand.


== Testing changes ==
== Testing changes ==


Before committing you can test your changes by pushing to the try server. You need to have mercurial queues enabled for this to work.
Before committing you may want to test your changes by pushing to the try server. You need to have mercurial queues enabled for this to work.


hg addremove addon-sdk/source
  hg qnew -f -e testpatch
  hg qnew -f -m "<commit message>" testpatch


Creates a temporary commit that can be pushed to try. Include the output of [http://trychooser.pub.build.mozilla.org/ TryChooser] to restrict builds and tests.
Creates a temporary commit that can be pushed to try. Include the output of [http://trychooser.pub.build.mozilla.org/ TryChooser] to restrict builds and tests.
Line 59: Line 101:
Pushes the temporary commit to the try server, depending on your TryChooser string you should get an email telling you where to look for results.
Pushes the temporary commit to the try server, depending on your TryChooser string you should get an email telling you where to look for results.


Once you're done the following converts the temporary commit to a real commit that can be pushed to the project branch:
=== Failure ===
 
If the try push fails, you'll have to investigate why, and make some changes, once you've made some changes, try
 
hg status
 
This should show you only the files which you have changed, they should only be changes to the addon-sdk folder normally.
 
hg addremove addon-sdk
 
Then, you'll need to update your patch
 
hg qrefresh -e
 
You can test that this worked with
 
hg status
 
Which should have no results
 
hg log -l 2
 
Should show your one patch in a queue, now you may push to try again
 
hg push -f ssh://hg.mozilla.org/try/
 
=== Success ===
 
Once you're done the following converts the temporary commit in to a real commit that can be pushed to the project branch:


hg qrefresh -e # Edit the commit message to remove the try: syntax
  hg qfinish -a
  hg qfinish -a


== Viewing and committing changes ==
== Viewing and committing changes ==


If you haven't done the commit by the above method then you can do it like this:
If you aren't testing the changes on try then you can just commit them:
 
hg commit
 
== Reverting a local commit ==
 
If you made a commit, and the tree you want to push to updates before you are able to push, then you need to revert your local commit and save it as a patch, update your local branch, and then put your patch back on top.  This is basically a git rebase.


  hg diff
  hg qimport -r tip
hg qpop
hg pull -u
hg qpush testpatch


Shows the list of changes waiting to land in larch
Now you'll have a queue with one patch, which is the patch you are rebasing.


hg addremove
Finalize the patch when you are ready, before doing this though you may which you push to try again..
hg commit -m "..."


Commits the changes
hg qfin -a
 
Now you have a real commit again.


== Pushing the changes to the project branch ==
== Pushing the changes to the project branch ==


  hg push ssh://hg.mozilla.org/integration/mozilla-inbound/
hg outgoing --stat # Check that only one changeset is listed and it only modifies addon-sdk/source
  hg push ssh://hg.mozilla.org/integration/fx-team/
 
Pushes the changes to fx-team.
 
=== Backouts ===


Pushes the changes to mozilla-inbound.
If you missed something when doing your try pushes, then it is likely that you will be backed out, if this happens then repeat the process.
Confirmed users
250

edits