Skip to content

Manual merge of curation data

Mark T. Holder edited this page Oct 5, 2015 · 6 revisions

Background

Edits to studies result in a new commit on a "work in progress" branch of the phylesystem-# repository. The current automated merge rule is: Only merge the changes to the master branch if the study has not changed along the master branch since the parent of the new commit.

If this condition is not met, the curator will see a message such as:

Merge needed - Your changes were saved, but an edit by another user prevented your edit from merging to the publicly visible location. In the near future, we hope to take care of this automatically. In the meantime, please report this error to the Open Tree of Life software team

This can happen if the same curator has multiple tabs/windows/browser editing the same study, or if there are multiple curators editing the same study.

Solution

Basically, someone with ssh access needs to log on to api.opentreeoflife.org, and merge the content manually with git commands. The caveat is that, you don't want the phylesystem-api to be modifying the filesystem while you are in the midst of that operation. So, you need to set the lockfile that that the phylesystem-api uses.

Step 0: Note the study and branch

From the curator's name and error report, you should be able to figure out what study was affected. Hopefully, you'll only find one branch in the phylesystem repo with that combination of curator name and study ID. From this you should note the NAME_OF_THE_UNMERGED_BRANCH_HERE and the study ID which should have at least 2 digits.

Let NS_#### denotes the study id. NS is placeholder for the study prefix (pg or ot). The #### will represent the full numeric part of the study ID, and XX will represent the last 2 digits.

Currently, you can do this most easily with 2 bash sessions:

Step 1: bash session #1 - obtain the lock

$ ssh api
$ source venv/bin/activate
$ cd repo/phylesystem-1_par/phylesystem-1
$ python ~/repo/peyotl/extras/lock-phylesystem.py .

this last step will block, holding the file lock

Step 2: bash session #2 - perform the merge

$ ssh api
$ source venv/bin/activate
$ cd repo/phylesystem-1_par/phylesystem-1
$ git checkout NAME_OF_THE_UNMERGED_BRANCH_HERE
$ git merge master
VERIFY that there is no conflict
$ python ~/repo/peyotl/scripts/nexson/validate_ot_nexson.py study/NS_XX/NS_####/NS_####.json
$ echo $? # to make sure that you get a 0 exit from the validate
$ git checkout master
$ git merge NAME_OF_THE_UNMERGED_BRANCH_HERE
$ git branch -d NAME_OF_THE_UNMERGED_BRANCH_HERE
$ exit

Step 3: bash session #1 - release the lock

Ctrl-D to end the lock-holding process
$ exit

Step 4: trigger a push

This will move the master branch content to GitHub so that the new study content will be indexed

You can execute this from any machine (not necessarily from api):

$ curl -X PUT http://api.opentreeoflife.org/phylesystem/push/v1

You should see something like:

{"description": "Push succeeded", "error": 0}
Clone this wiki locally