Skip to content

Developer's corner

Nicolas Harraudeau edited this page Jul 7, 2017 · 12 revisions

Workflows

Where to register a security issue

Go see the spreadsheet named "B2SHARE software security issues" in the shared Google drive directory and follow the instructions in it.

Code

Dev environment

How to work on the web UI

  1. Have a b2share v2 installation: run devenv/run_demo.sh in one terminal window
  2. Open another terminal window and go to the b2share installation directory, and into the webui directory: workon b2share-evolution && cdvirtualenv src/b2share/webui
  3. Run this command: node_modules/webpack/bin/webpack.js --config webpack.config.devel.js -dw

Changing one .jsx file now automatically updates the visible html in the browser

Updating dependencies

Description

The dependencies are defined in multiple places:

  • setup.py: These are the dependencies for development. It specifies the versions of each dependency which are compatible with B2SHARE. It can happen that these break as most of the dependencies have "equal or greater than" versions. Example invenio-config>=1.0.0b2,<1.1.0 would accept any version later released with a version between 1.0.0b2 and 1.1.0. The setup.py file also lists the dependencies for testing and generating the documentation. These dependencies are not installed in production environment.
  • requirements.txt: These are the EXACT VERSIONS installed in production and tested on travis. This should be updated only when needed and carefully tested.

Updating setup.py

There are a few cases when the setup.py should be updated:

  • A dependency is not needed anymore. Then it is removed from the list.
  • The lowest version of a dependency is not supported anymore. Then the lowest version is updated.
  • The last version of a dependency breaks B2SHARE. Then we can add a lower than version. Example <1.1.0 in invenio-config>=1.0.0b2,<1.1.0. Note that sooner or later B2SHARE will have to be compatible with the new version of the dependency. One way of resolving the issue is by supporting only the new version and updating the lowest supported version.

Note that requirements.txt should only contain versions which are compatible with the setup.py

Updating requirements.txt

Here are the prerequisites to update the requirements.txt:

$ pip install requirements-builder
$ pip install pip-tools

Here are the steps to update the requirements.txt:

# Generate the list of requirements with open versions in case the setup.py changed
$ requirements-builder --level=pypi -e postgresql setup.py > requirements.in
# Update the list of dependencies for production and travis, i.e. the requirements.txt file
$ pip-compile requirements.in