Developer FAQ: Difference between revisions
m (→* Jedi) |
m (→* Yoda) |
||
| Line 207: | Line 207: | ||
== * Yoda == | == * Yoda == | ||
There is about 1 to 5 '''Yoda'''. It's the overall management of project development. This ranking is obtained by inheritance, following the departure of a Yoda who withdraws, or by direct appointment by the vote after a Yoda retirement. | |||
== * And Darth Vader? == | == * And Darth Vader? == | ||
Revision as of 16:29, 29 April 2009
Get/update a developer CVS version
Make a backup of your configuration file and data
If you have already a working installation, backup your file htdocs/conf/conf.php and your documents directory. It more secure if you make a mistake later.
Get last version of sources by download
This method allows you to get CVS version of main development branch (called HEAD). This operation consist to get last version of Dolibarr files that are packaged each night into a zip file. For this, go on page with last CVS version of the day.
New files will overwrite old ones.
Get last version of sources using CVS
Another way to get last CVS version is to go use CVS tools. You can use the CVS server in anonymous mode, if you have a CVS client (CVS command line tool with Linux, or TortoiseCVS for example with Windows).
The command to get a full snapshot (with no CVS hidden files) in working directory is:
CVSROOT=:pserver:anonymous@cvs.savannah.nongnu.org:/cvsroot/dolibarr export CVSROOT cvs -q checkout -r HEAD dolibarr
HEAD means we want last version of files (so last development files).
The command to update files that was caught with previous CVS command: With linux (script shell):
CVSROOT=:pserver:anonymous@cvs.savannah.nongnu.org:/cvsroot/dolibarr export CVSROOT cvs -q update -P -d
With Windows and Tortoise cvs
"C:\Program Files\CVSNT\cvs.exe" -q update -P -d CVSROOT=:pserver:anonymous@cvs.savannah.nongnu.org:/cvsroot/dolibarr
And to set back all your working directory with same files than on CVS server repository (canceling your local changes): With linux (script shell):
CVSROOT=:pserver:anonymous@cvs.savannah.nongnu.org:/cvsroot/dolibarr export CVSROOT cvs -q update -P -C -d
With Windows and Tortoise cvs
"C:\Program Files\CVSNT\cvs.exe" -q update -P -C -d CVSROOT=:pserver:anonymous@cvs.savannah.nongnu.org:/sources/dolibarr
May be, you will have to change permissions on directories or files after to make then readable by users of your Dolibarr web server.
Get files for a CVS branch
If you want to work on a particular version (with its patches), you must follow same process but you must replace HEAD by name of the branch. For example DOLIBARR_2_2_BRANCH for branch 2.2 or DOLIBARR_2_4_BRANCH for branch 2.4.
Restore your configuration
Restore configuration file (./htdocs/conf/conf.php) with backup made previously if file has been erased/removed.
Update database
Next step is ti upgrade your database. For this, all you have to do is call page http://myrootdolibarr/install/ and choose option "Update".
This process was built to work whatever is start step and can be run and rerun several times with no risks.
Other repository
A CVS repository for non officials modules is also available on Sourceforge:
:ext:youlogin@dolibarr.cvs.sourceforge.net:/cvsroot/dolibarr
Start a development
Read first completely the Developer documentation to know all rules a developer must respect. You can also read following FAQ.
How to create a new skin
For this, see page Skins
For this, see page Menus system
How to develop my own feature module
For this, see page Module development
How to add/complete a translation
For this, see page Translator documentation
Change my numbering system after start
Si le nouveau système de numérotation n'entre pas en conflit avec l'ancien, il suffit d'aller dans le menu Configuration - Modules - Configuration factures et prendre un nouveau modèle dans la liste. Si le nouveau système rentre en conflit, il est nécessaire de renuméroter vos références existantes. Cela peut-être fait avec une requête SQL. Par exemple, pour passer de Jupiter (FYYYYMM99) à Terre (FAYYMM-999), vous pouvez exécuter la requête suivante:
update llx_facture set facnumber=concat('FA',substr(facnumber,4,4),'-',substr(facnumber,8))
where facnumber like 'F%' and facnumber not like 'FA%';
Par exemple, pour passer d'un modele FAYYMM999 à Terre (FAYYMM-999), vous pouvez exécuter la requête suivante:
update llx_facture set facnumber=concat('FA',substr(facnumber,3,4),'-',substr(CONCAT('0000',substr(facnumber,7)),-4))
where facnumber like 'FA%' and facnumber not like '%-%';
Submit a patch, work and help on development
- Avec accès CVS en écriture
A ce jour, les accès en écriture au CVS sont restreints (le nombre de commit étant déjà suffisamment dynamique). Si vous bénéficiez à l'heure actuelle d'un accès CVS en écriture, utilisez-le et à condition que ce qui est commité corresponde bien à votre grade de développeur Dolibarr (Voir FAQ Développeur - Devenir développeur officiel pour les différents grades). Si, vous n'avez pas accès au CVS (vous êtes donc au grade de membre ou chasseur de l'alliance Dolibarr), il est nécessaire de suivre la procédure qui suit...
- Sans accès CVS en écriture
Sans accès CVS en écriture (sans compte développeur savannah), il est nécessaire de fournir par mail, votre fichier patch.
Sous tout OS:
Voici la méthode Pro selon laquelle travailler pour pouvoir générer un tel fichier patch:
- Avoir un répertoire qui contient la version de Dolibarr de référence (résultat de la mise à jour CVS ou bien tout simplement l'arborescence résultant de la décompression d'un snapshot tgz de Dolibarr). On appellera ce répertoire ancien_rep. Vous pouvez récupérer le snapshot de la version de dev en cours sur le site officiel de Dolibarr.
- Avoir un autre répertoire qui contient l'arborescence de Dolibarr mais dans laquelle vous faites ou avez fait vos modifications. On appellera ce répertoire nouveau_rep.
Pour générer le fichier patch, il suffit alors de lancer la commande diff (en standard sous Linux, fourni dans cygwin sous Windows) de la manière suivante:
diff -Naur --exclude=CVS --exclude="*.patch" --exclude=".#*" --exclude="*~" --exclude="*.rej"
--exclude="*.orig" --exclude="*.bak" --exclude=conf.php --exclude=documents
ancien_rep nouveau_rep > mypatch.patch
Un script ksh réalisant cette commande est disponible dans le répertoire build/patch. Envoyer votre patch sur la ML à l'adresse dolibarr-dev@nongnu.org. L'intégration de votre patch n'est toutefois pas garantie, pas plus que le délai, mais si le patch est réalisé en suivant rigoureusement cette procédure, il a de forte chance d'être au moins testé (dans le cas contraire les chances sont proches de 0).
Sous Windows:
Si vous êtes sous Windows, une méthode moins Pro mais qui donne le même résultat est la suivante. Installer l'excellent outil open source de comparaison Winmerge qui sait fabriquer des patchs au format diff -Naur. Pour cela, comparer avec Winmerge le fichier référence et le fichier modifié et choisir dans le menu "Tools - Generate patch" (Générer des retouches en version française). Saisir un nom de fichier comme "resultat.patch", cocher la case "Append" et choisir l'option "Format Unified" (Style : unifié en version française). Cliquer sur "Ok". Éventuellement recommencer pour chaque fichier modifié. Au final, on obtient un beau fichier resultat.patch qui contient toutes les modifications au bon format.
Au lieu de rechercher manuellement vos fichiers, si vous avez installé conjointement TortoiseCVS et Winmerge, vous pouvez vous contenter de votre version modifiée sur votre ordinateur, et de la version CVS en ligne. Sous l'explorateur Windows, faites un clic droit sur le fichier qui doit être patché, et choisissez "CVS comparer" (pas WinMerge qui se trouve quelques lignes plus bas). Tortoise va lui-même lancer WinMerge. Puis reprenez la procédure décrite ci-dessus.
Appliquer un patch Si votre patch n'a pas encore été appliqué, mais que vous souhaitez de votre coté l'appliquer sur votre serveur linux fraichement mis à jour depuis la CVS, cela est possible grace à l'utilitaire patch. En admettant que vous avez créé votre patch à partir du répertoire htdocs de votre copie locale du cvs modifiée par vos soins, et que vous avez envoyé votre patch (monfichier.patch) sur le serveur dans le dossier patchs situé au meme niveau que votre dossier htdocs distant, la commande suivante devrait faire l'affaire (executée depuis le dossier patchs):
patch -u -p0 -d ../htdocs < monfichier.patch
Pour information: -p0 permet d'utiliser le chemin entier tel que mentionné dans le fichier de patch (-pn en retire les n premiers niveau de l'arborescence) -d permet de préciser le chemin relatif vers le dossier htdocs à patcher. < permet de donner le chemin vers le fichier source à utiliser (le patch en mode unifié) -u permet de préciser que le patch est en mode unifié
How to package/deploy a module for using it
See page Developpement_module
How to be an official developer
In the galaxy of the project Dolibarr, there are several stakeholders at different levels / grades. The number of developers is important and contributions and changes, for any project that wants to reach a certain level of quality, must be controlled and validated (both for functional needs and for code). For this reason, the write access on the source (CVS) is limited and governed by an organization that is described in the following. Each developer has a grade depending on seniority and the past. The level of authorization of a person on the project increases with the stages of promotion in grade.
The course of a Dolibarr developer passes through these steps, which are classified by a title familiar to fans of science fiction. Here are the steps. It is important to understand that this organization has the sole purpose of improving the quality of Dolibarr and it is necessary that it is rigorously used. So do not be offended if, as a developer, you can not have a CVS write access for some time.
The ranks of contributors to the project Dolibarr are:
* Soldier
The first thing that a person willing to help is to be familiar with the rules and standards developments. Reading the Developer documentation, you have shown sufficient willingness to become automatically Soldier (grade level Soldier). And just read is not the easiest ...
This grade is obtained without validation higher. It is a grade of principle, to start.
* Hunter
The next step is to submit your first patch, starting with simple, on the dev Mailing List (see Developer FAQ for the procedure) or on the forum (Preferred Mailing List).
At your first bid accepted (included in CVS by an Admiral, Jedi or Yoda), you automatically enter into the family of Fighters' of the Dolibarr alliance.
The number of hunters is not limited. The more we are, the more we will be strong. The hunters are the main force of the alliance Dolibarr.
* Z-6PO
If you are fluent in a language not or poorly translated into Dolibarr, a Jedi or Yoda will give you CVS access so you can make commits to the CVS of the project. But commits must be limited to changes for translations purposes. This grade can be obtained quickly enough. Just ask it on mailing list.
* Admiral
Only after a variable time (which can be very long) to the rank of a Fighter, and many patches of suitable quality had been sent, a Yoda in place allows you to make CVS commits extended for cause of any patch. You have become a Admiral of the alliance Dolibarr.
This title can't be asked, it is obtained by a decision or proposal of a Jedi or Yoda who believes that you have submitted enough patch to be a serious Admiral. An Admiral CVS access, however, must be used to commit translations or bug fixes reported on Savannah or forum (such as personal fixes or fixes submitted by a Hunter). So all CVS commits made must necessarily include in the description (the commit log field), the issue of Savannah bug corrected or the title of the forum message indicating the problem. Only a translation escapes this constraint (no restrictions for translations). Failure to observe this constraint may lead to downgrade to the rank of Hunter. For submission of new features, an Admiral must necessarily proceed on the principle of patches sent to the ML.
Obtaining the rank of Admiral is as rare as limited. Dolibarr quality can not be achieved by a controlled number of Admirals, but this is compatible with having a very high number of developers (Hunters) contributing (through patches).
* Jedi
This is even after a variable time (probably the longest of all) to the rank of Admiral, and the quality of the patch that was sent is satisfactory, that a Yoda will tell you that you are authorized to perform commits without restrictions, included new features, however you will still have to explain to all Yoda what you want to do to give back a "go". You will then become a Jedi. There may be temporary restrictions on commits, defined by a Yoda, for example due to a close release.
This title can't be asked, it is obtained by a proposal of another Jedi or by a Yoda.
This privilege is exceptional. Dolibarr quality can not be achieved without a limited number of Jedi, but this is not compatible with a high number developers (Hunters) contributing with patches.
* Yoda
There is about 1 to 5 Yoda. It's the overall management of project development. This ranking is obtained by inheritance, following the departure of a Yoda who withdraws, or by direct appointment by the vote after a Yoda retirement.
* And Darth Vader?
There are unfortunately. Members of the empire are the parasites that pollute the forum or mailing-list messages or constructive criticism, which slows the development of Dolibarr rather than offering constructive criticism to help improve. Some are very very strong bad liver and bad tone. These are Darth Vader. Fortunately, statistically, there does not appear and the death of one Dark Vador per year ...
Current team
See page Dolibarr Project to know list of current people that work on Dolibarr, with their current grade.