Handle an OpenMRS Ticket (Activity)

From Foss2Serve
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''OpenMRS Tickets''' |p2in|p4in| Description & Use git and Eclipse to handle an OpenMRS ticket.<br />Source & Ben Coleman<br />Prerequisite Knowledge & A working...")
 
(Handle a Ticket)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''OpenMRS Tickets'''
+
{{Learning Activity Overview
 
+
|title=
|p2in|p4in| Description &amp; Use git and Eclipse to handle an OpenMRS ticket.<br />Source &amp; Ben Coleman<br />Prerequisite Knowledge &amp; A working github account, Eclipse configured for OpenMRS<br />Estimate Time to Completion &amp; 60 minutes plus time to solve the ticket<br />Learning Objective &amp; Ability to
+
Handle an OpenMRS Ticket
 
+
|overview=
 +
Use git and Eclipse to handle an OpenMRS ticket.
 +
|prerequisites=
 +
A working github account, Eclipse configured for OpenMRS
 +
|objectives=
 
* fork, clone, checkout, and commit code using git and github.
 
* fork, clone, checkout, and commit code using git and github.
 
* follow the process defined by OpenMRS for tickets.
 
* follow the process defined by OpenMRS for tickets.
 +
|process skills=
 +
}}
  
<br />Materials/Environment &amp; Access to Internet / Web and web browser, git, Eclipse<br />Additional Information &amp; N/A<br />Rights &amp; Licensed CC BY-SA FIXME check that this license is appropriate<br />Turn In &amp; None<br />
+
== Video ==
 +
 
 +
Watch the OpenMRS University video, http://www.youtube.com/watch?v=SbbDvMVgRWo entitled, “OpenMRS University: Contributing Code.”
 +
 
 +
== Handle a Ticket ==
 +
 
 +
The following steps are followed in the video:
  
 
# Claim the ticket
 
# Claim the ticket
Line 12: Line 24:
 
#* The project name is in the upper-left corner of the ticket next to the ticket id.
 
#* The project name is in the upper-left corner of the ticket next to the ticket id.
 
# Clone the repository to your local machine.
 
# Clone the repository to your local machine.
#* git clone <math><</math>repository url<math>></math>
+
#: <pre>git clone <repository url></pre>
 
#* The repository url should point to the forked copy on ''your'' github account.
 
#* The repository url should point to the forked copy on ''your'' github account.
 
# Set the upstream repository
 
# Set the upstream repository
#* git remote add upstream <math><</math>repository url<math>></math>
+
#: <pre>git remote add upstream <repository url></pre>
 
#* The repository url should point to the original copy of the project on github.
 
#* The repository url should point to the original copy of the project on github.
 
#* You must be in the project directory for this command to succeed.
 
#* You must be in the project directory for this command to succeed.
 
# Fetch all the current branches of the project.
 
# Fetch all the current branches of the project.
#* get fetch –all
+
#: <pre>git fetch –all</pre>
 
#* FIXME I don’t quite understand why this is necessary. What did we have after the clone?
 
#* FIXME I don’t quite understand why this is necessary. What did we have after the clone?
 
# Pull all changes from the upstream master
 
# Pull all changes from the upstream master
#* git pull –rebase upstream master
+
#: <pre>git pull –rebase upstream master</pre>
 
#* FIXME In the video and on my sample ticket, there were no changes. I don’t understand how there could be after the fetch (much less after the clone).
 
#* FIXME In the video and on my sample ticket, there were no changes. I don’t understand how there could be after the fetch (much less after the clone).
 
# Create a branch to work in
 
# Create a branch to work in
#* git checkout -b <math><</math>branch name<math>></math>
+
#: <pre>git checkout -b <branch name></pre>
 
#* Use the ticket identifier as the branch name.
 
#* Use the ticket identifier as the branch name.
 
# Import the project into Eclipse
 
# Import the project into Eclipse
Line 34: Line 46:
 
# Handle the issue described in the ticket...
 
# Handle the issue described in the ticket...
 
# Add your changes to the staging area of your local repository.
 
# Add your changes to the staging area of your local repository.
#* git add -i for an interactive add.
+
#* for an interactive add
#* git add <math><</math>filename<math>></math> to add specific files
+
#: <pre>git add -i</pre>  
 +
#* to add specific files
 +
#: <pre>git add <filename></pre>  
 
# Commit your changes to your local repository
 
# Commit your changes to your local repository
#* git commit -m &quot;<math><</math>ticket id<math>></math>: <math><</math>commit message<math>></math>&quot;
+
#: <pre>git commit -m "<ticket id>: <commit message>"</pre>
 
# Push the changes in your branch back to the origin on github.
 
# Push the changes in your branch back to the origin on github.
#* git push origin <math><</math>branch id<math>></math>
+
#: <pre>git push origin <branch id></pre>
 
# Change to the branch on github, and make a pull request
 
# Change to the branch on github, and make a pull request
 
#* Include the URL of the ticket.
 
#* Include the URL of the ticket.
Line 46: Line 60:
 
#* Include the URL of the pull request in the comment for the code review.
 
#* Include the URL of the pull request in the comment for the code review.
 
# Wait. Someone from OpenMRS will respond to the pull request.
 
# Wait. Someone from OpenMRS will respond to the pull request.
 +
 +
{{Learning Activity Info
 +
|acm unit=
 +
|acm topic=
 +
|difficulty=
 +
|time=
 +
60 minutes plus time to solve the ticket
 +
|environment=
 +
Access to Internet / Web and web browser, git, Eclipse
 +
|author=
 +
Ben Coleman
 +
|source=
 +
|license=
 +
{{License CC BY SA}}
 +
FIXME check that this license is appropriate
 +
}}
 +
 +
[[Category:Learning Activity]]
 +
[[Category:OpenMRS]]
 +
[[Category:Good Draft]]

Latest revision as of 17:47, 8 March 2017

Title

Handle an OpenMRS Ticket

Overview

Use git and Eclipse to handle an OpenMRS ticket.

Prerequisites

A working github account, Eclipse configured for OpenMRS

Learning
Objectives
After successfully completing this activity, the learner should be able to:
  • fork, clone, checkout, and commit code using git and github.
  • follow the process defined by OpenMRS for tickets.
Process Skills
Practiced


Video

Watch the OpenMRS University video, http://www.youtube.com/watch?v=SbbDvMVgRWo entitled, “OpenMRS University: Contributing Code.”

Handle a Ticket

The following steps are followed in the video:

  1. Claim the ticket
  2. Fork the appropriate repository on github.
    • The project name is in the upper-left corner of the ticket next to the ticket id.
  3. Clone the repository to your local machine.
    git clone <repository url>
    • The repository url should point to the forked copy on your github account.
  4. Set the upstream repository
    git remote add upstream <repository url>
    • The repository url should point to the original copy of the project on github.
    • You must be in the project directory for this command to succeed.
  5. Fetch all the current branches of the project.
    git fetch –all
    • FIXME I don’t quite understand why this is necessary. What did we have after the clone?
  6. Pull all changes from the upstream master
    git pull –rebase upstream master
    • FIXME In the video and on my sample ticket, there were no changes. I don’t understand how there could be after the fetch (much less after the clone).
  7. Create a branch to work in
    git checkout -b <branch name>
    • Use the ticket identifier as the branch name.
  8. Import the project into Eclipse
    • Use the “Browse..” button to point at the directory containing the project.
  9. Tell Eclipse that the project uses git.
    • Select all the projects, and then right click. Select “Team” and then “Share Project...” The default opens are correct.
    • Do not use “Share Projects” (plural). This is for adding a new form of sharing.
  10. Handle the issue described in the ticket...
  11. Add your changes to the staging area of your local repository.
    • for an interactive add
    git add -i
    • to add specific files
    git add <filename>
  12. Commit your changes to your local repository
    git commit -m "<ticket id>: <commit message>"
  13. Push the changes in your branch back to the origin on github.
    git push origin <branch id>
  14. Change to the branch on github, and make a pull request
    • Include the URL of the ticket.
    • Be sure to check the “Commits” and “Files Changed” tabs to be sure you are sending the correct changes.
  15. Request a code review on the ticket page
    • Include the URL of the pull request in the comment for the code review.
  16. Wait. Someone from OpenMRS will respond to the pull request.
ACM BoK
Area & Unit(s)
ACM BoK
Topic(s)
Difficulty
Estimated Time
to Complete

60 minutes plus time to solve the ticket

Environment /
Materials

Access to Internet / Web and web browser, git, Eclipse

Author(s)

Ben Coleman

Source
License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

CC license.png

FIXME check that this license is appropriate

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox