Promote PI to Main
Contents |
Prerequisite
- Make sure the taken revision has passed the continuous builds and tests in erp/devel/pi.
- Specially, make sure the taken revision has passed the database consistency test.
Promote Steps
- Clone the repositories
$ hg clone https://code.openbravo.com/erp/devel/main main $ hg clone https://code.openbravo.com/erp/devel/pi pi $ cd /path/to/main/
- Edit the .hgrc file to have the push credentials (some thing like sed -i "s/code.openbravo.com/user:passwd@code.openbravo.com )
- Pull the changesets from pi to main
$ hg pull -u /path/to/pi
- Check for hg pull results/output for heads and conflicts on conflicts
Do hg merge Do hg resolve Commit the changes to repo using hg commit -m "merge from pi"
- Push the changeset to main "code.openbravo.com"
- Generate an e-mail to the RM and OB-devel MLs
How Integrated to builds.openbravo.com
Objective
Main aim is to archive automatic promotion of "good" revisions to main. what do we mean with "good"? We measure this as a set of builds and tests that are run successfully on a specific code revision on the pre-integration repo. When this happens then all the code up to that revision is selected to be promoted to the stable repository main.
Criteria for the process
- Logical order: if an incremental job fails a full build will not be triggered. Because the full job is polling for changes from int-3, but as the job failed no push to int-3 has happened.
- The revision tested by the last job has been tested in all the jobs. So we have the guarantee that it has passed all the tests. And we can push it to main.
- The short-time jobs do not have to wait for the long time jobs. Not all the revisions tested by job 1 are tested by job 2. But the opposite is always true. All the jobs tested by 2 have been tested by 1.
- The model does not depend on a specific Continuous Integration software.
Work flow
This is the proposed workflow in the *integration* stage:
- Each job/test will have its own local repo (int-1, int-2 .. int-<N>)
- Have top/first job that will
- Get the last stable revision of pi from pi related jobs
- Pull the changeset from pi into int till the last successful revision/changeset.
- Clone int locally in the system as int-1
- Execute on other test below in sequence, such that each test/build on success will push the changeset to next local repo int-x
Example: 1. Incremental build for PostgreSQL (erp_devel_int-inc-pgsql). * This job polls from int-1. If there are changes it runs the job. * If the job is successful, it pushes the changesets to a new repository, int-2. 2. Incremental build for Oracle (erp_devel_int-inc-oracle). * This job polls from int-2. If there are changes it runs the job. * If the job is successful, it pushes the changesets to a new repository, int-3. 3. Full build for PostgreSQL (erp_devel_int-full-pgsql). * This job polls from int-3. If there are changes it runs the job. * If the job is successful, it pushes the changesets to a new repository, int-4. (...) N. Sanity test upgrade from 2.40 (erp_devel_int-sanity-tests) * This job polls from int-X. If there are changes it runs the job.
- If the last job is successful, it pushes the changesets to *main*
Job specification
Job titile | Sequence | Tied to | Pull changes from | Update repo | Estimate (hh.mm.ss) |
erp_pi_to_main_promotion_check | 1 | master | https://code.openbravo.com/erp/devel/pi | https://code.openbravo.com/erp/devel/int and int-1(local) | 00.10.00 |
erp_devel_int-inc-pgsql | 2 | slave-2 | int-1 | int-2 | 00.10.00 |
erp_devel_int-inc-oracle | 3 | master | int-2 | int-3 | 00.10.00 |
erp_devel_int-full-pgsql | 4 | master | int-3 | int-4 | 00.20.00 |
erp_devel_int-pgsql-db-full-consistency-test | 5 | master | int-4 | int-5 | 00.30.00 |
erp_devel_int-full-oracle | 6 | master | int-5 | int-6 | 00.25.00 |
erp_devel_int-module-installation-test | 7 | slave-2 | int-6 | int-7 | 01.05.00 |
erp_devel_int-module-integrity-test | 8 | master | int-7 | int-8 | 00.20.00 |
erp_devel_int-pgsql-smoke-test | 9 | slave-2 | int-8 | int-9 | 03.30.00 |
erp_devel_int-oracle-smoke-test | 10 | slave-2 | int-9 | int-10 | 03.40.00 |
erp_devel_int-sanity-tests | 11 | master | Refers to workspace of full build (/srv/hudson/jobs/erp_devel_int-full-pgsql/workspace) | push from int-10 to int-11 | 00.00.05 |
erp_upgrade_to_latest_obx | 12 | slave1 | int-11 | int-12 | 00.00.05 |
erp_promote_pi_to_main | 13 | master | int-12 | http://code.openbravo.com/erp/devel/main | 00.02.00 |
erp_devel_main_obx | 14 | master | http://code.openbravo.com/erp/devel/main | copy the obx file to http://builds.openbravo.com/erp | 00.05.00 |
Above jobs that trigger test/build with respect to pi main integration can be seen here
Notification
Mail Formate:
Subject : 2.50MPX ready for QA, Notifying about:
- The merge is done, from changeset xxxxxxxxxxxx of erp/devel/pi to erp/devel/main
- It's build/compilation status.
- The database consistency status.
Note: we can use hudson-cli for the same. eg: java -jar hudson-cli.jar -s http://builds[dot]openbravo[dot]com mail