Redmine tasks#

The Data Support CRM uses Redmine.

Upgrade Ruby#

  1. Check the installed version of Ruby on the Information page

  2. Check which minor versions of Ruby are supported by the desired version of Redmine

  3. Change the default version of Ruby installed by RVM

Upgrade plugins#

  1. Click Check for updates on the Plugins page

  2. For RedmineUP plugins:

    1. Read the changelogs, checking for notable new features and Redmine version compatibility

    2. Get access to the licence manager with jmckinney@open-contracting.org

    3. Download the latest versions of the PRO plugins in use from the license manager

  3. For non-RedmineUP plugins:

    1. Read the changelogs, checking for notable new features and Redmine version compatibility

    2. Download the latest versions

  4. Replace the plugin directories in the salt/private/files/redmine/ directory with the new versions

  5. Apply our patches to the plugin files

  6. Commit and push your changes

  7. Deploy the service

Changelogs#

Upgrade theme#

  1. Check that the Circle theme is used via the Display settings page

  2. Read its changelog, checking for notable new features

  3. Check whether the desired version of Redmine is supported

  4. Download the latest version

  5. Replace the theme’s directory in the salt/private/files/redmine/ directory

  6. Commit and push your changes

  7. Deploy the service

Upgrade Redmine#

Check Redmine’s documentation for supported MySQL versions.

  1. Check the installed version of Redmine on the Information page

  2. Read Redmine’s changelog for changes that might affect users

  3. In salt/redmine/init.sls, set branch and revision to the desired branch and current revision of the official SVN repository

  4. Deploy the service.

  5. SSH into crm.open-contracting.org as the root user.

  6. Change to the Redmine application’s directory:

    cd /home/redmine/public_html
    
  7. Install Redmine’s dependencies:

    BUNDLER_WITHOUT="development test" bundle install
    
  8. Generate Redmine’s token (only on first install):

    bundle exec rake generate_secret_token
    
  9. Run database migrations:

    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake redmine:plugins:migrate
    
  10. Patch the field_format.rb file:

    1. Modify /home/redmine/public_html/lib/redmine/field_format.rb, removing ::I18n.t('activerecord.errors.messages.inclusion') from line 788.

      784 def validate_custom_value(custom_value)
      785   values = Array.wrap(custom_value.value).reject {|value| value.to_s == ''}
      786   invalid_values = values - possible_custom_value_options(custom_value).map(&:last)
      787   if invalid_values.any?
      788     []
      789   else
      790     []
      791   end
      792 end
      

    Note

    This edit fixes a bug/incompatibility between redmine_contacts and Redmine 3.4.7.

  11. Load in Redmine changes:

    systemctl restart apache2.service
    
  12. Ask the Data Support Team to Test Redmine.

Enable admin user#

Dogsbody Technology uses the admin user to verify upgrades.

To enable the admin user:

./run.py 'redmine' mysql.query redmine 'UPDATE users SET status = 1, admin = 1 WHERE login = "admin"'

To disable the admin user:

./run.py 'redmine' mysql.query redmine 'UPDATE users SET status = 0, admin = 0 WHERE login = "admin"'

Test Redmine#

You must test Redmine’s web, email and command-line interfaces.

Web interface#

Setup#

  1. Click My account

  2. Select Only for things I watch or I’m involved in

  3. Uncheck I don’t want to be notified of changes that I make myself

  4. Click Save

Tests#

  1. Create a company contact, and add an individual contact to the company. Add tags to the contacts following the contact requirements.

  2. Create an issue.

    1. Assign the issue to yourself. Check that an email notification is received.

    2. Add yourself as a watcher.

    3. Edit the issue, add a note, add the New ticket checklist from the template, and update the following fields. Check that an email notification is received:

      1. Project

      2. Tracker

      3. Subject

      4. Description

      5. Status

      6. Priority

    4. Edit the issue, check some items off the checklist, and add a new checklist item.

  3. Edit the issue, and log time, populating all fields in the time entry. (#4079)

  4. Log time against the issue by clicking Log time and populating all fields in the time entry.

  5. Check all View Customize work, at least “Always expand To, Cc, Bcc addresses” and “Confirm recipients before sending email”.

Views Customize#

Note

An administrator can confirm the list of Views Customize, if you lack permission.

  • Redirect from homepage to OCDS project.

    • Check that accessing the bare domain redirects to /projects/ocds.

These customizations have to do with the Pipeline tab.

  • Rename Deals to Pipeline and display as board by default.

    • Check the label in the navigation bar. Check that the results are presented as a table of cards (like an agile board).

  • Hide deal values and contacts.

    • Check that the cards include only a publisher name, and that there is no total value at the bottom of the table.

  • Hide deal value.

    • Click on a card, and check that there is no value (like 0.0).

  • Do not change the table’s background color on hover.

For these customizations, you can use /issues/864:

  • Move Agile boards, Helpdesk reports, Custom queries to the bottom of the sidebar.

  • Add a Respond by e-mail link to the links at the top of the issue.

  • Hide quoted text by default.

    • Note #2 should have “…Show quoted text…” links

  • Add Initially addressed to under From at the top of the issue.

For these customizations, you can use /issues/3227:

  • Always expand To, Cc, Bcc addresses

    • Check Send note, and check that the fields are visible

  • Confirm recipients before sending email

    • Add analyst email addresses to Cc and Bcc, click Submit, and check the content of the dialog

Teardown#

If the tests were performed on the live server:

  1. Delete the new issues, contacts and time entries you created.

  2. Check I don’t want to be notified of changes that I make myself.

If the tests were performed on a test server:

  1. Access /issues?set_filter=1&f%5B%5D=&sort=updated_on%3Adesc to list recently updated issues, and check that you didn’t accidentally:

    1. Use the test server as if it were the live server (e.g. responding to requests).

    2. Fetch messages that should have been fetched by the live server.

Email interface#

Tip

If using a test server, these tests need to be performed carefully. Mail that is fetched by the test server will not be re-fetched by the live server without intervention. If more than the test message is fetched by the test server, access GMail and mark any additional messages as unread, so that they will be re-fetched by the live server.

Note

To test mail retrieval on a test server:

  1. Open the live server’s wiki page

  2. Open the test server’s wiki page at /projects/ocds/wiki

  3. Draft an email to send from a non-work email address

Wait for a time whose minute doesn’t end in 4 or 9, to avoid the cron job on the live server fetching the mail first.

Then, in quick succession, to reduce the likelihood of a partner’s email being received at the same time:

  1. Click the Fetch mail link on the live server’s wiki page

  2. Send the email

  3. Click the Fetch mail link on the test server’s wiki page

The JSON response should have a count of 1, and the expected issue should be updated.

  1. Edit an issue, check Send note, add a non-work email address as a recipient, and submit. Check that an email (not a notification) is received.

  2. Reply to the email (not any notification) from the non-work email address and check that the issue is updated.

  3. Send an email with an attachment to data@open-contracting.org from a non-work email address. Check that an issue was created and that the attachment is associated.

  4. If using the live server: Check that the cron job (which runs every 5 minutes) works, by sending an email as in the previous step and waiting 5 minutes.

    • If the cron job isn’t yet active, you can manually run the commands in /home/sysadmin-tools/bin/redmine_cron.sh, which is called from /etc/cron.d/redmine

    Note

    We couldn’t get the Rake task to work in December 2018, so the cron job uses the manual fetch mail link.

Command-line interface#

Using these commands:

  1. Connect to the server

  2. Set up your environment

  3. Open a MySQL console, and run the SQL queries

  4. Open a Rails console, and run the cleanup scripts

Set up backups#

  1. Create and configure a S3 backup bucket

  2. Configure the AWS CLI

  3. Set redmine.backup.location in the server’s Pillar file, for example:

    redmine:
      backup:
        location: ocp-redmine-backup/site
    
  4. Deploy the service