Alignment Development

Repositories

Alignment software is stored in two gitlab repositories,

The maintainer is Maurizio Martinelli which takes care of merging software updates to master and tags projects and packages for release.

Development

There are many ways to develop software in git, some of them described in Git4LHCb page. Nevertheless a few other development workflows exist, for example the fork and pull.

Fork and Pull Alignment

In this development workflow, the developer forks the project into her/his git area and works on the own version of the software. To do so, one needs to click on the “Fork” button in the gitlab webpage of the project. This will create a copy of the project in the user’s gitlab workspace. Developments of the software happen on this forked version, for example in lxplus:

cd SoftwareDev
git clone ssh://git@gitlab.cern.ch:7999/<user>/Alignment.git
cd Alignment

This is different from $ lb-dev Alignment/master since the Alignment directory from above is not yet ready for compilation. To allow it

lb-project-init

Another important step in the “fork and pull” workflow is to add the original repository to the list of remotes:

git remote add ssh://git@gitlab.cern.ch:7999/lhcb/Alignment.git upstream
This allows to always keep track of the changes on the original repository by calling
git pull upstream master

Before starting to develop, its important to document the issue that the development is aiming to fix. This is done by opening a JIRA task, where the issue is described and solutions are proposed. Alignment issues are discussed at this page: https://its.cern.ch/jira/projects/LHCBALIGN/issues/. Once the issue is documented and a solution proposed, the developer can start working on the solution. It is advised to create a new branch for working on the code by

git checkout -b <new branch name>
For reference, it could be useful to name the new branch after the issue number. Please consider that since you will be working on your own version of the software, as many commit as necessary are allowed. Therefore don’t be afraid of
git add <file names>
git commit -m ‘<a sensible message>'
as often as you can.

Once the code is considered to be ready to be merged in the main project (implies documentation and testing), the code can be pushed to the user’s repository in gitlab

git pull upstream master
git push
and a merge request can be made. This is usually automatically suggested by git. Beware the use of "git pull" before pushing! This is quite helpful to avoid conflicts during the merging. In case you missed the link to open the merge request provided by gitlab, you can open it manually on the gitlab webpage of the forked repository. Please document your changes carefully!

Online Version

It is often needed to apply changes to the software version that runs online on plus. To avoid applying changes directly to the master of the projects, a branch named “satellite-vXrY” dedicated to the online run is created. Please check that this branch is always up-to-date with the master.

On the satellite it may be needed to modify packages from Alignment. Therefore a remote of Alignment is included as described in Git4LHCb:

git lb-use Alignment
git lb-checkout Alignment/master Some/Package
<make changes and test>
git add Some/Package/src/MyStuff.cpp
git commit -m 'fixing feature abc (JIRATICKET-123)’
The problem with this is that by pushing one sends a lot of other meaningless commit to the project, such as
added Alignment/AlignTrTools from Alignment (Alignment/master)

The neat solution is to cherry-pick specific commits and push them to the master in a separate branch. To do so, one should go to a personal area where the repository is cloned, then for AlignmentOnline and the commit with id 'b11ac99...'

git fetch origin
git checkout master
git checkout -b cherry-pick-b11ac99...
git cherry-pick b11ac99...
<solve potential conflicts>
git push
and open the merge request.

In the case of commits that belong to packages in Alignment, the procedure is similar. In a personal area where the Alignment repository is

git remote add AlignmentOnline <AlignmentOnline repo> # if not already done
git fetch AlignmentOnline
git checkout master
git checkout -b cherry-pick-b11ac99...
git cherry-pick b11ac99...
<solve potential conflicts>
git push
and open the merge request.

-- MaurizioMartinelli - 2017-02-24

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2017-07-04 - MaurizioMartinelli
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback