OpenMRS resources: Difference between revisions

From OpenHatch wiki
Content added Content deleted
imported>Hypotext
imported>Hypotext
 
(60 intermediate revisions by 4 users not shown)
Line 8: Line 8:
* learning this workflow will serve you very well when contributing to other open source projects, or even just working on a team of software engineers.
* learning this workflow will serve you very well when contributing to other open source projects, or even just working on a team of software engineers.


Here is a [https://photos-5.dropbox.com/t/1/AAAAYoZcyOdcpW-q2FdsrAjD6waykEdpsOAzY8zpJGRlPQ/12/110243113/png/1024x768/3/1416646800/0/2/Capture%20d%27%C3%A9cran%202014-11-21%2015.34.34.png/8UfRRfbN2rbiRiztoMIyZ7wCf_uKZbgKEZjfTov0TBE screenshot]! (please ignore the French)
= What to install before the workshop =


= Relevant Links =
If your computer has at least 10 GB of hard disk space free and at least 3 GB of RAM, it's recommended to download and install the following:
Here are all the relevant links for future use:
* [http://en.flossmanuals.net/_booki/openmrs-developers-guide/openmrs-developers-guide.pdf Developer's Guide]


* [https://drive.google.com/folderview?id=0B47JK2xjSdD0WC1KUWlPSUU2MXM&usp=sharing Google Drive with VMs] Just download OpenMRS.tar.gz
Install VirtualBox: https://www.virtualbox.org/wiki/Downloads


* [https://docs.google.com/presentation/d/1Wa3TqRJSJgXLOt_rehlGa6NK6uh_2oW8Y04xjagywPY/edit?usp=sharing Wintersession Presentation]
and Vagrant: http://downloads.vagrantup.com/



This allows you to use a virtual machine at the workshop that already has everything set up. Otherwise, you'll need to perform a manual installation. The manual installation guide can be found here: https://wiki.openmrs.org/display/docs/Getting+Started+as+a+Developer, but will be covered in more depth at the workshop.

= Getting OpenMRS up and running on your computer =

The short version:

* Install git and IRC.
* Manual setup (clone the code from GitHub) OR VM setup (follow VM instructions).
* Review the workflow of getting your code merged
* Configure your git remotes.
* Compile the code.
* Start the web server.
* Go through the web app set up process.
* You should now have a running local version of OpenMRS on your machine!
* If you want to get a feel for how one would fix a bug in the code, GOTO "OpenMRS bug walkthrough." If you want to fix an actual bug in the code, GOTO "new beginner tasks."

Here are all the relevant links:
* [http://opensourceprinceton.wikidot.com/ OSAP wiki] (which has even MORE links!)
* [http://opensourceprinceton.wikidot.com/ OSAP wiki] (which has even MORE links!)
* [http://opensourceprinceton.wikidot.com/openmrs-getting-started Background OpenMRS reading] (more links to check out in your free time)
* [http://opensourceprinceton.wikidot.com/openmrs-getting-started Background OpenMRS reading] (more links to check out in your free time)
Line 44: Line 28:
* [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Running-the-OpenMRS-webapp-and-viewing-changes-in-code Running the webapp and viewing changes in code]
* [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Running-the-OpenMRS-webapp-and-viewing-changes-in-code Running the webapp and viewing changes in code]


= Git setup =
See steps below.


See [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Setting-up-git,-plus-workflow-tutorial here]. (Not necessary for Full Virtual Machine Setup)
= Manual setup =


= OpenMRS setup =
Scroll down to "MANUAL INSTALLATION" [http://en.flossmanuals.net/openmrs-developers-guide/get-set-up/ here].
It's highly recommended you choose one of the VM based setups. If that's not possible (often because of memory constraints) or if you'd simply prefer to do the manual setup, follow the guide here: https://wiki.openmrs.org/display/docs/Getting+Started+as+a+Developer and make sure to talk to Chris, Katherine, and/or Vibhaa about this setup.


Talk to Katherine and Chris about this setup.


'''1) Full Virtual Machine Setup (Recommended)'''
= VM setup =
* This setup uses a virtual machine that has the full OpenMRS setup already configured for you. You would be working within the virtual machine to both write code and to run/test it. Features snapshots of the VM that allow you to very easily rewind to a previous state.
* Pros: Quick and easy to do. You only need to install VirtualBox and download the VM to work on the project.
* Cons: Might be sluggish if you don't have enough RAM.
* Requirements: 7GB hard disk space and 3GB RAM (preferably 4+GB). Requires you to install VirtualBox and to download/copy over the VM.
Installation: Download and install [https://www.virtualbox.org/wiki/Downloads VirtualBox]. Download the [https://drive.google.com/file/d/0B47JK2xjSdD0ckZPdnUwaFJXOG8/view?usp=sharing Virtual Machine] (the OpenMRS.tar.gz file). Then extract the folder from this link. Add the downloaded machine in VirtualBox (Machine->Add Machine and navigate to the OpenMRS.vbox file within the folder extracted from the VM link). Install the VirtualBox Extension Pack from the previous VirtualBox link. If working on the sample bug, click on snapshots in the top right of the VirtualBox window and restore the top snapshot. Then just run the machine and begin!


git clone -b express-setup https://github.com/cpschuster/OpenMRS-dev-setup


Then follow the README there.


'''2) Partial Virtual Machine Setup'''
If you've ever used the express setup before, you'll want to do
* This quick setup allows you to communicate with a virtual machine (VM) that has all OpenMRS related setup requirements already installed. You will be working in your machine and running/testing the code by using the command line to control the VM.
* Pros: Allows you to use your preferred text editor/work environment.
* Cons: Less intuitive of what's going on unless you are very comfortable with working from the command line.
* Requirements: 10GB of hard disk space and 3GB RAM. Requires you to install VirtualBox and Vagrant.
* Once VirtualBox and Vagrant are installed, follow the rest of the setup in the README here: https://github.com/cpschuster/OpenMRS-dev-setup/tree/express-setup . Issue this command to clone it to your machine:
git clone -b express-setup https://github.com/cpschuster/OpenMRS-dev-setup
Then come look for Danni or Nicole to get a flash drive to load the VM more quickly!!!!
Then follow the "Happy Path Usage Instructions" in the README at https://github.com/cpschuster/OpenMRS-dev-setup/tree/express-setup


Note: If you've ever used the express setup before, you'll want to do
vagrant box remove OpenMRS-dev-setup-clone
vagrant box remove OpenMRS-dev-setup-clone
before issuing "vagrant up".


before you do


'''3) Manual Setup'''
vagrant up.
* This setup fully configures your machine to be able to contribute to OpenMRS.
* Pros: Lowest hardware requirements.
* Cons: Slowest and most error prone setup (especially if you run Windows)


= Sample Bug Walkthrough =
Talk to Nicole and Danni about this setup.
Before working on a current bug, you might like to try completing [https://openhatch.org/wiki/OpenMRS_sample_bug the walkthrough of this older one] in order to get a feel for the workflow.


= Git setup =
= General Workflow =


git: version control system.
See [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Setting-up-git,-plus-workflow-tutorial here].


= Workflow =

See [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Setting-up-git,-plus-workflow-tutorial here].

git: version control system.
GitHub: visual interface for git. Lets you view repositories, pull requests (requests from other people to add original code), etc. online.
GitHub: visual interface for git. Lets you view repositories, pull requests (requests from other people to add original code), etc. online.


* First, clone the "official version" from GitHub (happens only once): https://github.com/openmrs/openmrs-core
* First, fork the "official version" from GitHub to your own Github repository (happens only once). Here's the offical code base: https://github.com/openmrs/openmrs-core
* Set up your remotes so you get new code and push your original code to the right places
* Set up your remotes so you get new code and push your original code to the right places (setting an "origin" remote for your fork and an "upstream" remote for the official code base)
* Pull new changes from upstream (the "official" version of OpenMRS on GitHub, linked above)
* Pull new changes from the the "upstream" remote
* Make a new branch for the ticket you'd like to work on
* Make local changes on your machine
* Make local changes on your machine to fix the bug/implement the feature
* Push to origin (your "fork" of OpenMRS on your GitHub account). e.g. here is [https://github.com/hypotext/openmrs-core- mine]
* Push to your "origin" remote
* When done, make a pull request on upstream, which will be reviewed. [https://github.com/openmrs/openmrs-core/pulls Current OpenMRS pull requests]
* When done, make a pull request on upstream, which will be reviewed. [https://github.com/openmrs/openmrs-core/pulls Current OpenMRS pull requests]
* Repeat
* Repeat
* Hopefully get your pull request merged into upstream! [https://github.com/openmrs/openmrs-core/pull/1160 Looks like this].
* Hopefully get your pull request merged into upstream! [https://github.com/openmrs/openmrs-core/pull/1160 Looks like this].


[https://github.com/hypotext/OpenMRS-dev-setup/wiki/Setting-up-git,-plus-workflow-tutorial See here for a more detailed walkthrough].
= Running the OpenMRS webapp =


= New Beginner Tickets =
... and seeing if your additions actually changed things. You'll likely want to do this many times during step 3 ("make local changes on your machine") above.
Pair programming is great!


If you're working on one of these, please tell Chris, Katherine, and/or Vibhaa (or edit the wiki and add your name next to it).
See [https://github.com/hypotext/OpenMRS-dev-setup/wiki/Running-the-OpenMRS-webapp-and-viewing-changes-in-code here].


= OpenMRS bug walkthrough =

Talk to Chris Hay and Katherine Ye.

Check out code from here: https://github.com/hypotext/openmrs-core

We'll be walking you through fixing [https://issues.openmrs.org/browse/TRUNK-3780 this bug], testing changes in the webapp, writing tests, and submitting a pull request!

= New beginner tasks =

Talk to Danni Yu and Nicole Quah (ThoughtWorks).

* Pair programming is great!
* Have Vagrant and VirtualBox installed with at least 10 GB of hard disk space.

If you're working on one of these, please edit the wiki and put your name next to it!

* [https://issues.openmrs.org/browse/TRUNK-3895 TRUNK-3895] Filter daemon user from user-related API methods
* [https://issues.openmrs.org/browse/TRUNK-3479 TRUNK-3479] Concept Validator should ignore short names
* [https://issues.openmrs.org/browse/TRUNK-3274 TRUNK-3274] Voided person addresses and names should be ignored by the short patient form validator
* [https://issues.openmrs.org/browse/TRUNK-3274 TRUNK-3274] Voided person addresses and names should be ignored by the short patient form validator
* [https://issues.openmrs.org/browse/TRUNK-2660 TRUNK-2660] Validate field lengths of domain objects in management pages
* [https://issues.openmrs.org/browse/TRUNK-4539 TRUNK-4539] Support validation in the UI for the database characters set for a field or column
* [https://issues.openmrs.org/browse/TRUNK-3849 TRUNK-3849] Move Address and Name layout support classes from web layer to api layer
* [https://issues.openmrs.org/browse/TRUNK-2941 TRUNK-2941] Find+Move mediawiki archive pages in confluence
* [https://issues.openmrs.org/browse/TRUNK-2941 TRUNK-2941] Find+Move mediawiki archive pages in confluence
* [https://issues.openmrs.org/browse/TRUNK-3709 TRUNK-3709] Secret answer should be encrypted
* [https://issues.openmrs.org/browse/TRUNK-209 TRUNK-209] MRNgen Duplicate Global Properties 1
* [https://issues.openmrs.org/browse/TRUNK-3638 TRUNK-3638] Separate liquibase file into separate files per version
* [https://issues.openmrs.org/browse/TRUNK-3657 TRUNK-3657] Delete clob data storage when deleting a form resource
* [https://issues.openmrs.org/browse/TRUNK-4575 TRUNK-4575] TestData - Duration Unit not usable
* [https://issues.openmrs.org/browse/TRUNK-3746 TRUNK-3746] Error adding a ConvSet in a second form schema
* [https://issues.openmrs.org/browse/TRUNK-4473?filter=10068 TRUNK-4473] Form Resource (Long-Text) causes error with binary file upload

List of all intro tickets:
* https://tickets.openmrs.org/secure/IssueNavigator.jspa?mode=hide&requestId=10068

Latest revision as of 01:42, 21 February 2015

What is OpenMRS?

OpenMRS is an open-source electronic medical records platform often used in developing countries. ThoughtWorks contributes to it as part of their Humanitarian Software Program.

It might look like there's an intimidatingly large amount of stuff to do below, but

  • you only have to set things up once!
  • it'll be second nature to you in no time
  • learning this workflow will serve you very well when contributing to other open source projects, or even just working on a team of software engineers.

Here is a screenshot! (please ignore the French)

Relevant Links

Here are all the relevant links for future use:

Git setup

See here. (Not necessary for Full Virtual Machine Setup)

OpenMRS setup

It's highly recommended you choose one of the VM based setups. If that's not possible (often because of memory constraints) or if you'd simply prefer to do the manual setup, follow the guide here: https://wiki.openmrs.org/display/docs/Getting+Started+as+a+Developer and make sure to talk to Chris, Katherine, and/or Vibhaa about this setup.


1) Full Virtual Machine Setup (Recommended)

  • This setup uses a virtual machine that has the full OpenMRS setup already configured for you. You would be working within the virtual machine to both write code and to run/test it. Features snapshots of the VM that allow you to very easily rewind to a previous state.
  • Pros: Quick and easy to do. You only need to install VirtualBox and download the VM to work on the project.
  • Cons: Might be sluggish if you don't have enough RAM.
  • Requirements: 7GB hard disk space and 3GB RAM (preferably 4+GB). Requires you to install VirtualBox and to download/copy over the VM.

Installation: Download and install VirtualBox. Download the Virtual Machine (the OpenMRS.tar.gz file). Then extract the folder from this link. Add the downloaded machine in VirtualBox (Machine->Add Machine and navigate to the OpenMRS.vbox file within the folder extracted from the VM link). Install the VirtualBox Extension Pack from the previous VirtualBox link. If working on the sample bug, click on snapshots in the top right of the VirtualBox window and restore the top snapshot. Then just run the machine and begin!


2) Partial Virtual Machine Setup

  • This quick setup allows you to communicate with a virtual machine (VM) that has all OpenMRS related setup requirements already installed. You will be working in your machine and running/testing the code by using the command line to control the VM.
  • Pros: Allows you to use your preferred text editor/work environment.
  • Cons: Less intuitive of what's going on unless you are very comfortable with working from the command line.
  • Requirements: 10GB of hard disk space and 3GB RAM. Requires you to install VirtualBox and Vagrant.
  • Once VirtualBox and Vagrant are installed, follow the rest of the setup in the README here: https://github.com/cpschuster/OpenMRS-dev-setup/tree/express-setup . Issue this command to clone it to your machine:
  git clone -b express-setup https://github.com/cpschuster/OpenMRS-dev-setup   

Then come look for Danni or Nicole to get a flash drive to load the VM more quickly!!!! Then follow the "Happy Path Usage Instructions" in the README at https://github.com/cpschuster/OpenMRS-dev-setup/tree/express-setup

Note: If you've ever used the express setup before, you'll want to do

  vagrant box remove OpenMRS-dev-setup-clone 

before issuing "vagrant up".


3) Manual Setup

  • This setup fully configures your machine to be able to contribute to OpenMRS.
  • Pros: Lowest hardware requirements.
  • Cons: Slowest and most error prone setup (especially if you run Windows)

Sample Bug Walkthrough

Before working on a current bug, you might like to try completing the walkthrough of this older one in order to get a feel for the workflow.

General Workflow

git: version control system.

GitHub: visual interface for git. Lets you view repositories, pull requests (requests from other people to add original code), etc. online.

  • First, fork the "official version" from GitHub to your own Github repository (happens only once). Here's the offical code base: https://github.com/openmrs/openmrs-core
  • Set up your remotes so you get new code and push your original code to the right places (setting an "origin" remote for your fork and an "upstream" remote for the official code base)
  • Pull new changes from the the "upstream" remote
  • Make a new branch for the ticket you'd like to work on
  • Make local changes on your machine to fix the bug/implement the feature
  • Push to your "origin" remote
  • When done, make a pull request on upstream, which will be reviewed. Current OpenMRS pull requests
  • Repeat
  • Hopefully get your pull request merged into upstream! Looks like this.

See here for a more detailed walkthrough.

New Beginner Tickets

Pair programming is great!

If you're working on one of these, please tell Chris, Katherine, and/or Vibhaa (or edit the wiki and add your name next to it).

  • TRUNK-3274 Voided person addresses and names should be ignored by the short patient form validator
  • TRUNK-2941 Find+Move mediawiki archive pages in confluence
  • TRUNK-209 MRNgen Duplicate Global Properties 1
  • TRUNK-3638 Separate liquibase file into separate files per version
  • TRUNK-3657 Delete clob data storage when deleting a form resource
  • TRUNK-4575 TestData - Duration Unit not usable
  • TRUNK-3746 Error adding a ConvSet in a second form schema
  • TRUNK-4473 Form Resource (Long-Text) causes error with binary file upload

List of all intro tickets: