Development

See Development Requirements before getting started.

Other Useful Tools

  • Pyenv for managing python environments

  • Poetry for managing dependencies

  • Precommit for reformating code before committing

  • Tox running tests, verifying code

Basic Process

Prepare to make changes

The code is revision controlled with git. You will also have a code server to safely store the code.

Note

Having private repositories make it easier to manage passwords. If you do not already have a git server setup, GitLab or Gitea are both free and very simple to setup and manage.

GitLab includes “GitLab Runner” which can be used for auto testing and deploys. Gitea is more lightweight but integrates very nicely with Drone-Ci.

The code most likely ended up on your workstation from the Github repository. For the sake of this guide we will assume that it is your code server.

# you've create an empty folder and are now inside it
git init
git remote add origin git@github.com:Riverside-Healthcare/Atlas-of-Information-Management.git
git pull origin master

# you have already installed pre-commit, right?
# we can now add the git hooks for it.
pre-commit install

Why Pre-Commit?

Pre-Commit is used to automatically run formatting tests after you make code changes. Check out the .pre-commit-config.yaml for all tests.

  • reformat c# code

  • reformat and check json config files

  • reformat and check toml and yaml python config files

  • fix end of files for consistency

  • reformat python code for consistency

  • reformat & check js & css code

Make some updates

Now, assume you’ve made some changes to the code. You’ve: - tweaked one of the c# helper functions - changed some colors in the UI - modified the analytics javascript - fixed some spelling errors in the docs

Visually test your changes by running the website locally -

Start debug

The first time you start up the app there will most likely be two SSL prompts.

ssl warning
ssl confirm
  • it is wise to run the Selenium tests to check for browser issues

  • next you can commit your code, since you’ve installed pre-commit your code will be validated.

    git add . && git commit -m "did some cool updates" && git push
    

If you have CI turned on on your git server, you can auto generate the new documentation. Take a look in .gitlab-ci.yml for the steps to do that in Gitlab Runner, or .github/workflows for how to do it in Github or Drone-CI.

Deploy

If you changes have tested nicely you can deploy the updates.

It is strongly recommended to have two instances of Atlas (Atlas and Atlas-Test).

First, deploy to test, and if user testing is ok, then deploy to prod.