Redmine tasks#
The Data Support CRM uses Redmine.
Upgrade Ruby#
Check the installed version of Ruby on the Information page
Check which minor versions of Ruby are supported by the desired version of Redmine
Upgrade plugins#
Click Check for updates on the Plugins page
For RedmineUP plugins:
Read the changelogs, checking for notable new features and Redmine version compatibility
Get access to the licence manager with
jmckinney@open-contracting.org
Download the latest versions of the PRO plugins in use from the license manager
For non-RedmineUP plugins:
Read the changelogs, checking for notable new features and Redmine version compatibility
Download the latest versions
Replace the plugin directories in the
salt/private/files/redmine/
directory with the new versionsApply our patches to the plugin files
Commit and push your changes
Changelogs#
Upgrade theme#
Check that the Circle theme is used via the Display settings page
Read its changelog, checking for notable new features
Check whether the desired version of Redmine is supported
Download the latest version
Replace the theme’s directory in the
salt/private/files/redmine/
directoryCommit and push your changes
Upgrade Redmine#
Check Redmine’s documentation for supported MySQL versions.
Check the installed version of Redmine on the Information page
Read Redmine’s changelog for changes that might affect users
In
salt/redmine/init.sls
, setbranch
andrevision
to the desired branch and current revision of the official SVN repositorySSH into
crm.open-contracting.org
as theroot
user.Change to the Redmine application’s directory:
cd /home/redmine/public_html
Install Redmine’s dependencies:
BUNDLER_WITHOUT="development test" bundle install
Generate Redmine’s token (only on first install):
bundle exec rake generate_secret_token
Run database migrations:
RAILS_ENV=production bundle exec rake db:migrate RAILS_ENV=production bundle exec rake redmine:plugins:migrate
Patch the
field_format.rb
file: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.
Load in Redmine changes:
systemctl restart apache2.service
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#
Click My account
Select Only for things I watch or I’m involved in
Uncheck I don’t want to be notified of changes that I make myself
Click Save
Tests#
Create a company contact, and add an individual contact to the company. Add tags to the contacts following the contact requirements.
Create an issue.
Assign the issue to yourself. Check that an email notification is received.
Add yourself as a watcher.
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:
Project
Tracker
Subject
Description
Status
Priority
Edit the issue, check some items off the checklist, and add a new checklist item.
Edit the issue, and log time, populating all fields in the time entry. (#4079)
Log time against the issue by clicking Log time and populating all fields in the time entry.
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:
Delete the new issues, contacts and time entries you created.
Check I don’t want to be notified of changes that I make myself.
If the tests were performed on a test server:
Access
/issues?set_filter=1&f%5B%5D=&sort=updated_on%3Adesc
to list recently updated issues, and check that you didn’t accidentally:Use the test server as if it were the live server (e.g. responding to requests).
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:
Open the live server’s wiki page
Open the test server’s wiki page at
/projects/ocds/wiki
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:
Click the Fetch mail link on the live server’s wiki page
Send the email
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.
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.
Reply to the email (not any notification) from the non-work email address and check that the issue is updated.
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.
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:
Connect to the server
Set up your environment
Open a MySQL console, and run the SQL queries
Open a Rails console, and run the cleanup scripts
Set up backups#
Create and configure a S3 backup bucket
Configure the AWS CLI
Set
redmine.backup.location
in the server’s Pillar file, for example:redmine: backup: location: ocp-redmine-backup/site