Files
loomio/MAINTENANCE.md

3.9 KiB

Loomio Recipe Maintenance

All contributions should be made via a pull request. This is to ensure a certain quality and consistency, that others can rely on.

Maintainer Responsibilities

A recipe maintainer has the following responsibilities:

  • Respond to pull requests / issues within a week
  • Make image security updates within a day
  • Make image patch / minor updates within a week
  • Make image major updates within a month

In order to fullfill these responsibilities a recipe maintainer:

  • Has to watch the repository (to get notifications)
  • Needs to make sure renovate is configured properly

Pull Requests

A pull request can be merged if it is approved by at least one maintainer. For pull requests opened by a maintainer they need to be approved by another maintainer. Even though it is okay to merge a pull request with one approval, it is always better if all maintainers looked at the pull request and approved it.

Become a maintainer

Everyone can apply to be a recipe maintainer:

  1. Watch the repository to always get updates
  2. Simply add your self to the list in the README.md and open a new pull request with the change.
  3. Once the pull request gets merged you will be added to the loomio maintainers team.

Testing Loomio Changes

As a maintainer, it is helpful to have a dev environment to test changes. One can easily be created in the usual way with abra app new loomio, but to test changes and upgrades it's good to have a database with a bunch of test data.

Populating with test data

You can either make some artificial test data, or import test data from an existing Loomio instance. https://help.loomio.com/en/user_manual/groups/data_export/index.html is super helpful here. Here's a summary:

  1. Export existing data from a running instance by having an admin go to a group and click the "Export group data" settings option

  2. Fully deploy a clean test instance of Loomio. Note: importing might not work well on a database that has data in it, so you might want to wipe your test instance when doing an import, if it already has data in it

  3. Copy the json into the Loomio app container by doing

[local] $ scp loomio-testdata.json username@your-domain.org:loomio-deploy/import/
[local] $ ssh username@your-domain.org
[your-domain.org] $ docker ps | grep loomio | grep app  # note down the loomio app container id
[your-domain.org] $ sudo docker cp ~/loomio-deploy/import/loomio-testdata.json <loomio-app-container-id>:/import/loomio-testdata.json
  1. Set up your rails tools
[your-domain.org] $ docker exec -it <loomio-app-container-id> bash
[loomio] $ DB_PASS="$(cat /run/secrets/db_password)"
[loomio] $ echo "production:
  adapter: postgresql
  host: db
  database: loomio_production
  username: postgres
  password: ${DB_PASS}
  port: 5432" > config/database.yml

[loomio] $ cd /loomio && RAILS_ENV=production EDITOR=vi bundle exec rails credentials:edit
  1. Process the Loomio test data export, to get it into your dev instance's database:
[loomio] $ rails console

[loomio][rails] > GroupExportService.import('/import/loomio-testdata.json')

Manipulating the loomio db

If you want to drop your loomio db(!!), you can do so by logging in to the db container:

[your-domain.org] $ docker ps | grep loomio | grep _db  # find your loomio _db_ container id
[your-domain.org] $ docker exec -it <loomio-db-container-id> bash
[loomio-db] # su postgres
[loomio-db] $ dropdb loomio_production
[loomio-db] $ createdb loomio_production

From here, you can do something like recreate it, from the app container:

[your-domain.org] $ docker ps | grep loomio | grep app  # find your loomio app container id
[your-domain.org] $ docker exec -it <loomio-app-container-id> bash
[loomio-app] $ rake db:setup  # you may have to run through step 4 from earlier