GSoC ’19 with InterMine
By: Laksh Singla
Tags: Final Report, Gsoc 2019, Intermine

GSoC ’19 with InterMine

Final Report

InterMine

This blog post serves as a summary of the work done by me during Google Summer of Code ’19.

ABSTRACT

The title of the project was ‘Improving imjs and im-tables’ and my mentors were Aman Dwivedi and Yo Yehudi. imjs and im-tables are the primary client side libraries used to facilitate the communication with InterMine instances. The major goals of the project were to:

Upgrade the NPM dependencies of imjs and im-tables

Segregate the tests of imjs libraries into unit and integration tests, and add mocks for the unit tests

Add methods for the Registry class of imjs library

Improve the developer documentation for the imjs library

TASKS ACCOMPLISHED

During the GSoC ’19 period, I was able to complete all of my major tasks as well as accomplish some minor tasks and bug fixes. Following is a summary of the tasks that were accomplished by me. It highlights the tasks accomplished, the challenges faced during the process and its impact as well.

I was able to update almost all of the dependencies of both the imjs and im-tables libraries, and added new package.json and package-lock.json corresponding to these updated dependencies. A lot of the outdated features of these old dependencies used in the libraries were replaced by their newer versions. A major challenge was upgrading mocha in imjs as a lot of tests had to be rewritten so as to not return a Promise, when they were already using the callback variant for asynchronous testing. As a result of updating these dependencies, the libraries are maintainable for a larger period of time. grunt-browserify is still not updated because it causes an old CORS bug to re-appear.

and corresponding to these updated dependencies. A lot of the outdated features of these old dependencies used in the libraries were replaced by their newer versions. A major challenge was upgrading in imjs as a lot of tests had to be rewritten so as to not return a Promise, when they were already using the callback variant for asynchronous testing. As a result of updating these dependencies, the libraries are maintainable for a larger period of time. is still not updated because it causes an old CORS bug to re-appear. Tests in imjs are a mixture of unit and integration tests, which test the features of the library and InterMine’s testmine simultaneously. Due to this, a local setup of testmine is required, which should not be the case for unit tests. A testing framework for segregating the unit and the integration tests in imjs from each other was developed. Depending upon the value of the environment variable IMJS_TEST it runs either the unit tests or the integration tests. Moreover, using nock, the HTTP responses in the unit tests are mocked, thus eliminating the need for setting up testmine for unit testing. In case the user wants to run the integration tests only, mocks are not setup, therefore testing the features of the testmine.

it runs either the unit tests or the integration tests. Moreover, using the HTTP responses in the unit tests are mocked, thus eliminating the need for setting up testmine for unit testing. In case the user wants to run the integration tests only, mocks are not setup, therefore testing the features of the testmine. im-tables was decaffeinated, i.e. converted from CoffeeScript to Javascript and the Grunt build system was appropriately modified. JavaScript is much easier to maintain and widely popular than CoffeeScript.

build system was appropriately modified. JavaScript is much easier to maintain and widely popular than CoffeeScript. Public documentation for imjs library was created, that incorporated instructions for installing and using the library and its different classes to interact with mine instances.

Registry class was added to the imjs library, that facilitates the interaction with registry.intermine.org.

class was added to the imjs library, that facilitates the interaction with registry.intermine.org. Long standing CORS issue was fixed in the imjs library which prevented it from getting bundled into other client side libraries.

LINKS

(imjs) Updating outdated dependencies of imjs (https://github.com/intermine/imjs/pull/46)

(imjs) Segregating unit and integration tests (https://github.com/intermine/imjs/pull/47)

(imjs) Adding Registry methods (https://github.com/intermine/imjs/pull/50)

methods (https://github.com/intermine/imjs/pull/50) (imjs) CORS Bugfix (https://github.com/intermine/imjs/pull/51)

(im-tables) Updating outdated dependencies of im-tables (https://github.com/intermine/im-tables/pull/177)

(im-tables) Decaffeinate im-tables (https://github.com/intermine/im-tables/pull/179)

(documentation) IMJS Documentation (https://github.com/intermine/imjs-docs/)

FURTHER WORK

In continuation of the work done, further improvement can be made to the test-suite, by making mocks auto update-able. Also, investigation can be done as to why updating grunt-browserify causes the CORS issue to reappear.

ACKNOWLEDGEMENT

I would like to thank my mentors for not only being very supportive to me, but also for getting their hands dirty with coding, and helping me complete my tasks. I would also like to express my gratitude towards other members of the InterMine community who guided me before and during the GSoC process.