The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Contribution in detail

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
(Describe re-submit and add some headings)
(remove -A from osc commands. Refer to image creation and rename/clarify the Mer MDS stuff)
Line 3: Line 3:
 
= Preparation =
 
= Preparation =
  
You'll need git and osc setup and an ssh key on the Mer gerrit server.
+
You'll need git and osc setup and an [[Contribution#Initial_setup|ssh key on the Mer gerrit server]].  You also need to be able to access a [[Mer Delivery System|Mer.MDS]] project linked to a current Mer release on an OBS. This is called Mer:fake: on the MeeGo Community OBS.
  
 
= Submit a change =
 
= Submit a change =
Line 23: Line 23:
 
== Branch the package to work on it ==
 
== Branch the package to work on it ==
  
  osc -A https://obs branch Mer.org:Core:i586 systemd
+
  osc branch Mer.MDS:Core:i586 systemd
  
 
A bug in the OBS means that the new branch project will not have
 
A bug in the OBS means that the new branch project will not have
 
the correct repos so add them manually. Even if you add them through the OBS web interface they will miss the arch field.
 
the correct repos so add them manually. Even if you add them through the OBS web interface they will miss the arch field.
  
  osc -A https://obs meta prj home:YOURNAME -e
+
  osc meta prj home:YOURNAME -e
  
 
   <repository name="Mer_Core_i586">
 
   <repository name="Mer_Core_i586">
     <path repository="Core_i586" project="Mer.org:Core:i586"/>
+
     <path repository="Core_i586" project="Mer.MDS:Core:i586"/>
 
     <arch>i586</arch>
 
     <arch>i586</arch>
 
   </repository>
 
   </repository>
Line 39: Line 39:
 
Checkout:
 
Checkout:
  
   osc -A https://obs co home:Admin:branches:Mer.org:Core:i586/systemd
+
   osc co home:Admin:branches:Mer.MDS:Core:i586/systemd
   cd home:Admin:branches:Mer.org:Core:i586/systemd
+
   cd home:Admin:branches:Mer.MDS:Core:i586/systemd
 
   osc build i586
 
   osc build i586
  
Line 47: Line 47:
 
Clone the git repo metadata into your OSC checkout using git's --bare option :
 
Clone the git repo metadata into your OSC checkout using git's --bare option :
  
   cd home:Admin:branches:Mer.org:Core:i586/systemd
+
   cd home:Admin:branches:Mer.MDS:Core:i586/systemd
 
   git clone -o gerrit --bare ssh://your_username@review.merproject.org:29418/mer-core/systemd .git
 
   git clone -o gerrit --bare ssh://your_username@review.merproject.org:29418/mer-core/systemd .git
 
   git config -f .git/config core.bare false
 
   git config -f .git/config core.bare false
Line 72: Line 72:
  
 
Use a suitable [[:Category:kickstart|.ks]] with [[:Category:mic2|mic2]]
 
Use a suitable [[:Category:kickstart|.ks]] with [[:Category:mic2|mic2]]
 
  
 
If you use [[:Category:IMG|IMG]], it supports a feature called "Extra repositories and packages".
 
If you use [[:Category:IMG|IMG]], it supports a feature called "Extra repositories and packages".
Line 80: Line 79:
 
Select the OBS and enter the repository/repo eg:  
 
Select the OBS and enter the repository/repo eg:  
  
   home:Admin:branches:Mer.org:Core:i586/Mer_Core_i586
+
   home:Admin:branches:Mer.MDS:Core:i586/Mer_Core_i586
 
+
Build a suitable image, install and test
+
  
  DEVICE=/dev/sdh
+
Build a [[:Category:image|suitable image]], install and test
  curl http://imgw1/images/web/root/1-20111110-090037/meego-nemo-trial-1.2.90.20111110.1000.iso | sudo dd of=$DEVICE bs=4M oflag=direct && sudo eject $DEVICE
+
  
 
== Push for review ==
 
== Push for review ==
  
 
In the obs/mer package directory:
 
In the obs/mer package directory:
   cd home:Admin:branches:Mer.org:Core:i586
+
   cd home:Admin:branches:Mer.MDS:Core:i586
  
 
If this is a new change (ie it hasn't been rejected and corrected) then:
 
If this is a new change (ie it hasn't been rejected and corrected) then:
Line 132: Line 128:
  
 
The commit should now be committed using:
 
The commit should now be committed using:
   git commit -a -s --amend
+
  git add <changed files>
 +
   git commit -s --amend
 
and the commit message should have the "Change-Id:" as the last line after the signed-off line.
 
and the commit message should have the "Change-Id:" as the last line after the signed-off line.
  

Revision as of 18:43, 26 January 2012

This page describes how to contribute a patch to a Mer package and how to resubmit corrected patches.

Contents

Preparation

You'll need git and osc setup and an ssh key on the Mer gerrit server. You also need to be able to access a Mer.MDS project linked to a current Mer release on an OBS. This is called Mer:fake: on the MeeGo Community OBS.

Submit a change

Summary

  1. Branch the OBS package in either your local OBS or the community OBS using the MDS remote link.
  2. Checkout the package from OBS
  3. Incorporate a bare clone mer/git package from Mer master repo into the osc directory.
  4. Clone the mer/git package from Mer master repo (The OBS and mer/git package should be identical.)
  5. Unpack the source and apply patches (usually in a local build root)
  6. Optionally take a snapshot of chroot (for later diff)
  7. Hack in chroot until ready (potentially needing to install new pkgs for new BRs)
  8. Create a patch
  9. Modify packaging
  10. Submit to OBS to verify build
  11. Build and test and image or other appropriate QA
  12. Submit to gerrit for CI and review

Branch the package to work on it

osc branch Mer.MDS:Core:i586 systemd

A bug in the OBS means that the new branch project will not have the correct repos so add them manually. Even if you add them through the OBS web interface they will miss the arch field.

osc meta prj home:YOURNAME -e
  <repository name="Mer_Core_i586">
   <path repository="Core_i586" project="Mer.MDS:Core:i586"/>
   <arch>i586</arch>
  </repository>

The repository needs to be set to publish too.

Checkout:

  osc co home:Admin:branches:Mer.MDS:Core:i586/systemd
  cd home:Admin:branches:Mer.MDS:Core:i586/systemd
  osc build i586

Pull the latest Mer version from the gerrit git repo

Clone the git repo metadata into your OSC checkout using git's --bare option :

  cd home:Admin:branches:Mer.MDS:Core:i586/systemd
  git clone -o gerrit --bare ssh://your_username@review.merproject.org:29418/mer-core/systemd .git
  git config -f .git/config core.bare false

Check out the latest content from git:

  git reset --hard

Hack

You can now edit the code and packaging

Build

Of course you'll need to do one or more builds to verify the code in a cycle like this:

 specify *yaml
 osc build i586 *.spec
 osc chroot i586 *.spec

Then a server-side build:

 osc ar
 osc ci

Create image

Use a suitable .ks with mic2

If you use IMG, it supports a feature called "Extra repositories and packages". This allows you to use a standard kickstart and add a specific repository to use for overrides.

Select the OBS and enter the repository/repo eg:

 home:Admin:branches:Mer.MDS:Core:i586/Mer_Core_i586

Build a suitable image, install and test

Push for review

In the obs/mer package directory:

  cd home:Admin:branches:Mer.MDS:Core:i586

If this is a new change (ie it hasn't been rejected and corrected) then:

  git commit -s

When you're satisfied:

  git push gerrit HEAD:refs/for/master

You should get back a message like:

remote: New Changes:
remote:   http://review.merproject.org/XXX

This will now be scheduled for a CI build and test; then it will be manually reviewed and hopefully, accepted.

Re-submit if original change was rejected

If your changes is rejected for some reason (a frequent occurence) then you should address the issues and resubmit.

Summary

For Mer this is done by:

  1. Address the issue
  2. Finding the Change-Id
  3. amending the commit
  4. adding a Change-Id: line
  5. resending the change

Address review issues

The gerrit tool is used to permit reviews of your code. If the change is rejected then the tool should have a comment explaining what needs to be done to resolve the issue. Make these changes and re-test your code.

Obtain Change-Id:

When you are ready to submit go to the gerrit page for your change

 http://review.merproject.org/XXX

In the top left is gerrit's Change-Id: field. Adding this to the commit message will allow gerrit to replace the original commit and retain a history of reviews and responses.

Copy the Change-Id: value including the text "Change-Id:"

Prepare an amended commit

The commit should now be committed using:

 git add <changed files>
 git commit -s --amend

and the commit message should have the "Change-Id:" as the last line after the signed-off line.

Push commit for re-review

Now push the commit to gerrit using

 git push gerrit HEAD:refs/for/master

New Packages

Occasionally a new package is required in Mer.

Summary

The process is similar to the normal contribution with some minor variations.

  1. Build your package in the community OBS
  2. Propose a new package on irc, mailing list or via a bug to Mer Core/.Project-core
  3. Wait for the git repo to be created
  4. Checkout your package from your OBS project
  5. Prepare a git repo and add your code. Then do a signed-off commit.
  6. Link your local git repository to the remote mer-core/gerrit repository
  7. Push your code for review and CI

Prepare your new package

So having prepared and built your package on OBS, go to the osc package directory

osc co <PRJ> <PKG>
cd <PRJ>/<PKG>

Prepare a git repo

Then prepare the git repo (skipping the .osc/ dir)

git init .
git add *
git commit -s

Now add the Mer git repository (using your name/package)

git remote add gerrit ssh://<yourlogin>@review.merproject.org:29418/mer-core/<packagename>

A quick way to check all is well is

git remote update

Send for review

Finally, to push the new code and start a CI run:

git push gerrit HEAD:refs/for/master

You should get back a message like:

remote: New Changes:
remote:   http://review.merproject.org/XXX

This will now be scheduled for a CI build and test; then it will be manually reviewed and hopefully, accepted.

Handling rejection

If changes are needed at this point, the code is already in gerrit so it follows the normal modification process above.

Personal tools