Google summer of code 2018— Final Report

Proposal Title : Updater for Libre EHR using Github API

Mentors : Tony McCormick, Nilesh Prasad

Proposal Link : https://docs.google.com/document/d/1vr0t87jfFcwI-dZ-kXrRXB3ZGO7sub8jkON_Sw5ezjk

Description : This project aims to build a new updating system for Libre EHR application using the github API.The major idea behind the necessity of this project is patching the security vulnerabilities in the application.Because whenever a security vulnerability gets discovered and patched in the github repo, the user need to update the application manually, so it is essential to create this module and integrate it with this application

Deliverables :

  1. User Mode (The mode for the normal users)
  2. Developer Mode(The mode for contributors, by which repo owners can test the PRs easily)

PULL REQUEST OF MY WORK :

PATCH PRs:

CONFIGURABLES : these are some configurables for updater which can be found on updater/settings.json

PARAMETERS:

host : The host which the updater is making pull requests to, currently it is only using github API, but updater is built in way that it can adopt any API.

owner : The owner of the repository on which the updater should check for the updates

repository_name : The name at which the Libre EHR application is located

github_current : The pull request number at which the updater got merged in to the application, it can be added with or without #

feedback_issue_number : The issue number where we can get opinions of user for that update

db_backup_file : This file at which updater reads all the changed table names and it makes backup, restore from it.

HURDLES FACED:

The major problem i have faced in this project is i couldn’t get endpoint to fetch only merged requests from github API.

It can only give PRs in three states

  1. open (all open pull requests)
  2. closed ( couldn’t use it because it may also contain PR which got closed without merging)
  3. All (contain both open, closed PR)

So the only way i got is, i have to check the current PR time stamp against all other PRs.It caused a huge performance lag,it took me 1 min 30 seconds to loop through all pull request data. So i have cached the order the pull request got merged and reduced the performance lag

SCREENSHOTS OF MY WORK :

setup wizard for updater
Developer Mode
User mode
Updater User Administration

VIDEO TUTORIAL:

I have also made a video tutorial to help users to operate this module.

FUTURE WORK

  1. To write api functions for the gitlab, bit bucket
  2. To add some user friendly features such as allowing full update ( without single PR by PR update)

ACKNOWLDGEMENT

I would like to thank my mentors Tony, Nilesh prasad for providing me assistance and helping me to shape the project idea.I would also like to thank Terry Hill, Arthur Eaton for providing support, ideas, encouragement during this period.They both supported me a lot in acheiving this goal.

I would also like to org admins Judy Gichoya, MD, Robert O'Connor, Michael Downey for their continuous support.

QUICK LINKS

Github profile : https://github.com/naveen17797

Blog posts : https://medium.com/@naveen17797