Selecting your initial task depends on your personal preferences and expertise. We recommend you work on at least a few introductory tickets so that you can better understand our development workflow when you start.
OpenMRS uses Atlassian's JIRA software for issue tracking purposes. The OpenMRS JIRA installation can be found at https://tickets.openmrs.org/.
JIRA allows you to search for suitable tickets using a number of criteria. When choosing a ticket, identify one based on a programming language or task that you are already familiar with to reducing the learning curve involved.
You may also want to work on issues or limitations that you identified yourself. First, create a ticket for this task in JIRA by clicking on the "Create Issue" link. Next, wait for your issue to be reviewed by a core OpenMRS developer. Begin work on the issue after it has been assessed and discussed, and a core developer changes its status to "Ready for Work".
If you are selecting an existing ticket to work on, please make sure that:
We assume that you have already installed git on your computer, and that you are able to access it using the command line, which is often easier to interact with than IDE integration plugins.
Log in to JIRA with your OpenMRS credentials, and then claim the ticket by clicking on the "Claim Issue" button. This will indicate to others that you are working on this issue, so that they do not duplicate your work. You should also identify the OpenMRS version affected by this particular issue, and make sure to check out the appropriate version of the source code to complete your task. For most cases, you will need to check out the master branch. If you are not sure, just put a comment on the ticket asking for guidance.
Use the following steps to check out source code onto your local machine:
Step 1: If you don't have a GitHub account, create one here: https://github.com/signup/free
Step 2: On GitHub, fork a project you want to work on. You may use the tutorial http://help.github.com/fork-a-repo
Step 3: Clone the project repository from your fork
git clone https://github.com/{yourusername}/openmrs-core.git
Step 4: Now, go into the folder just created and set up the "upstream" remote so you can eventually pull changes from the main repository.
git remote add upstream https://github.com/openmrs/openmrs-core.git
You should use a separate branch for your development work on each JIRA issue. The following steps describe how to do so.
Step 1: Check out out a new local branch based on your master/tag recommended for the fix and update it to the latest. The convention is to name the branch after the JIRA issue key, for example, "TRUNK-123".
To create a new branch, use the following commands:
git checkout -b TRUNK-123 master git clean -df git pull --rebase upstream master
Step 2: Push the branch to your fork:
git push origin TRUNK-123
Now you may begin work on your task on the newly created branch.
In addition to basic Java coding conventions, use the following steps to ensure the quality of your code:
Managing deprecation:
Security:
Code formatting style:
git status
This will return a list of all new or modified files which you can review to ensure that no unintentional changes made it into your commit.
git add -A
git add -i
Using this command displays a summary of changed and new files along with a list of options which you can carry out. To stage selected files, you need to choose the 'update' option. Choose the files which you want to stage, marking them either by entering their file id (as listed in the console). You may also specify a file range such as 1-3, or simply enter * to select all. Confirm your selections by pressing the ENTER key twice. Choose option '7' (quit) to complete the process.
Now these files are staged, and ready to be committed. To commit your code into your branch, use the command:
git commit -m "TRUNK-123: Put change summary here (can be a ticket title)"
git pull --rebase upstream master
Step 3: Make sure all unit tests still pass by running:
mvn clean install
git push
OpenMRS migrated from Subversion to GitHub in mid-2012. Before that time, we used Subversion for version control for over seven years. As a result, some of our older and infrequently-used modules are still be hosted in our Subversion repository.
We encourage the hosting and migration of OpenMRS modules into GitHub, although your module's source code may be hosted wherever you prefer. If you are planning to work on a legacy module hosted in Subversion, you will need appropriate knowledge to use this version control system.
A senior developer will review your code, and may suggest revisions. You may be asked to make changes to your patch, and re-submit it for review. Code review is an iterative process, and multiple review cycles may be required. Additional changes made to your patch can be built on the same branch used previously.
Review happens on GitHub, which allows your code to be evaluated by multiple developers, and detailed review comments added.
In other cases, reviewing a ticket may involve significant discussion which may lead to further refinement or redesign work. We believe that healthy discussions around our code will contribute towards identifying the best solution for a given task.
Ultimately, once all reviews have been completed, a patch will be accepted and merged into the OpenMRS core system. After this, the status of the JIRA issue will be changed to "Closed". Assuming your task represents a change in the current workflow, you should update the existing documentation to reflect these changes.
Closing a JIRA issue ends the official workflow, and now you are free to begin work on other tickets. Sit back, relax, and find a new ticket!
A closed JIRA issue might be reopened if it causes the current build to fail, needs more work, or triggers a significant disruption of the existing system.
If further improvements to your work are identified at a later stage, these will be listed under a separate ticket which would be linked to the previous one. In such a case, you are welcome to either claim or ignore the new ticket. You may be contacted for your thoughts.
General questions regarding the task you are working on can be asked by adding comments to the issue on JIRA. Such comments are seen by the issue's requester and other people who specifically are "watching" the issue. You may also request help for your work by asking questions using the community discussion channels discussed previously in this book. The OpenMRS community is very extensive, and greatly encourages and assists newcomers, so feel free to ask constructive questions.
Check out the Support chapter of this book for more about how and where to get help.
We highly encourage developers to publicize their work so other community members are able to learn from and re-use their work. You should do so using one or more of these methods:
OpenMRS provides contributor licenses to community members in good standing who can demonstrate need for using these tools. Licenses may be available for a number of tools including IntelliJ IDEA and the YourKit profiler, among others. If you are able to demonstrate sufficient need to obtain such a license, please contact the OpenMRS help desk at http://go.openmrs.org/helpdesk.
What goes into a release?
Release timelines and supported features are largely decided upon by the OpenMRS leadership group. Larger goals are discussed, agreed upon, and documented under the OpenMRS technical road-map, which is a set of predefined milestones for the core OpenMRS platform and sponsored modules.
More detailed on the release process can be found at: http://go.openmrs.org/newdev-release
The latest technical road-map can be found at: http://go.openmrs.org/newdev-techmap
The release process is managed by a release manager who is responsible for getting the source code stabilized, packaged, and released to the general public.
Alpha release
An alpha release is a feature-complete release which has not yet been verified as bug free.
Beta release
A beta release is made after obvious bugs found in the alpha release have been fixed. Therefore, a beta release is ready to be tested by a larger group of people.
Release candidate
A release candidate is only needed when non-trivial changes were required during the beta phase. If the beta release was tested and no significant changes were detected, developers may proceed directly to a full release.
Major release
A major release is deemed tested and worthy of production environments.
Maintenance release
A maintenance release contains bug fixes and security patches for use between major releases, e.g., from 1.8.0 to 1.8.1. For maintenance releases, no additional branches are created. Developers simply begin where development work was left off in the current minor version series release branch.
Release branch
A new release branch is created for each new major and minor release. As an example, a new release branch is created when preparing to release version 2.0.0, or version 1.3.0. However, when preparing to release 1.3.1 (a maintenance-version increment), the release branch created at the time of 1.3.0 is simply re-used.
Continuous Integration Systems play an integral role in software development. OpenMRS adopted the CI tool Bamboo following our shift into the agile development process.
The use of CI has brought OpenMRS a number of benefits including:
The OpenMRS continuous integration tools can be accessed at http://ci.openmrs.org/.
You should now have an understanding of how to develop with OpenMRS. In the next chapter we will put these skills to use by getting your local development environment set up.
There has been error in communication with Booktype server. Not sure right now where is the problem.
You should refresh this page.