Skip to content

Latest commit

 

History

History
223 lines (144 loc) · 5.87 KB

File metadata and controls

223 lines (144 loc) · 5.87 KB

OSEHRA VistA Contributor Instructions

This page documents how to develop and submit a change to the OSEHRA VistA repository. See our repository page for repository URLs and mirrors.

Setup

Before you begin, perform initial setup:

Workflow

Our collaboration workflow, based on topic branches, consists of three main steps:

  1. Local Development
  1. Update
  2. Create a Topic
  1. Code Review
  1. Share a Topic
  2. Revise a Topic
  1. Integrate Changes
  1. Merge a Topic (requires authorization by OSEHRA)
  2. Delete a Topic

Update

Update your local master branch:

$ git checkout master
$ git pull

Create a Topic

All new work must be committed on topic branches. Name topics like you might name functions: concise but precise. A reader should have a general idea of the feature or fix to be developed given just the branch name.

To start a new topic branch:

$ git fetch origin
$ git checkout -b my-topic origin/master

Edit files and create commits (repeat as needed):

$ edit file1 file2 file3
$ git add file1 file2 file3
$ git commit

Share a Topic

When a topic is ready for review and possible inclusion, share it by pushing to your GitHub fork of OSEHRA/VistA.

Checkout the topic if it is not your current branch:

$ git checkout my-topic

Check what commits will be pushed to GitHub for review:

$ git prepush

Push commits in your topic branch for review by the community:

$ git push origin HEAD

Generate Pull Request

Visit the web page of the forked repository and click the "Pull Requests" tab

Screenshot of website with Pull Request tab highlighted

and then click on "New pull request" button.

Screenshot of website with new pull request button highlighted

Once the page loads, select the proper forks and branches for the pull request:

Option Value
base fork OSEHRA/VistA
base master
head fork <username>/VistA
compare my-topic

A properly set up branch would look as follows:

Screenshot of website highlights on needed objects to create pull request

Clicking on "Create pull request" will send an email to the administrators and kick off a CI build of the incoming branch.

Revise a Topic

If a topic is approved during code review, skip to the next step. Otherwise, revise the topic and push it back to code for another review.

Checkout the topic if it is not your current branch:

$ git checkout my-topic

To revise the 3rd commit back on the topic:

$ git rebase -i HEAD~3

(Substitute the correct number of commits back, as low as 1.)

Follow Git's interactive instructions. Preserve the Change-Id: line at the bottom of each commit message.

Return to the previous step to share the revised topic.

Merge a Topic

After a topic has been reviewed and approved in GitHub it may be submitted to the upstream repository.

Only developers authorized by OSEHRA may perform this step.

Use the "Merge pull request" button that appears on the change review page.

Delete a Topic

After a topic has been merged upstream, delete your local branch for the topic.

Checkout and update the master branch:

$ git checkout master
$ git pull

Delete the local topic branch:

$ git branch -d my-topic

The branch -d command works only when the topic branch has been correctly merged. Use -D instead of -d to force the deletion of an unmerged topic branch (warning - you could lose commits).