Legacy documentation is available on Confluence; whilst some of this is still relevant its largely only useful as a historical reference.
We also have markdown pages within the doc
folder of this git repo
brew install rbenv
brew install ruby-build
rbenv install 3.1.4
gem install bundler --version 2.3.10
brew install postgis
brew services start postgresql
brew install redis
brew services start redis
bundle install
to install ruby dependenciesnpx yarn
to install node dependenciesbin/rails db:setup
to set up the database development and test schemas, and seed with test data.REDIS_URL
, eg in the .env
filebundle exec rake dev:ssl:generate
.env.local
from another team memberrspec
to run the spec tests.cucumber
to run the cucumber tests.yarn spec
to run the Javascript tests.rails s
to launch the app on https://localhost:3000.RAILS_ENV=production
, Sidekiq is needed for background job processing
a. running bundle exec sidekiq --config config/sidekiq.yml
will start a Sidekiq WorkerAdd the Root Certificate to macOS Keychain
Via the CLI
Run sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain config/ssl/localhost.crt
Via the UI
./config/ssl/localhost.crt
Reload the webpage
Open the "Advanced" pane at the bottom
Click "Proceed to website"
It's best to lint just your app directories and not those belonging to the framework, e.g.
bundle exec rubocop app config lib features spec
You can copy the script/pre-commit
to .git/hooks/pre-commit
and git
will
then lint check your commits prior to committing.
This can be controlled from various environment variables, see Env Vars for more information.
There is a JSON /healthcheck
endpoint which will verify connectivity to each of the service dependencies to confirm whether the service is healthy.
The endpoint also includes the git commit SHA of the codebase deployed as well
as a copy of the DEPLOYMENT_ID
to allow checking when the deployed version has
changed. This is retrieved from the following environment variable.
DEPLOYMENT_ID
- identifier for the current deployment.
We store feature flags in a JSON config (./feature-flags.json
), so that flags are visible across all environments.
To add a feature flag, add an object to the features
array in the following format. The name
key is used to enable the feature (e.g., Feature.enabled? :sms
)
{
"features": [
{
"name": "sms",
"description": "Sends reminder text messages",
"enabled_for": {
"environments": ["production", "staging"]
}
}
]
}
This config is read into a dashboard available at /feature_flags
in any of the non-production environments.
If you have plenty of cpu cores, it is faster to run tests with parallel_tests
bundle exec rake parallel:create
bundle exec rake parallel:prepare
bundle exec rake parallel:spec
bundle exec rake parallel:features
To run feature tests in a headed configuration for easier troubleshooting, add an .env.test.local
file to the root of the project with the following environment variable:
SELENIUM_CHROME_DRIVER=true
application.css
not being declared to be precompiled in production, run the following commandrake tmp:clear
Failure/Error: require File.expand_path('../config/environment', __dir__)
you will need to make sure you have an instance of Redis running a simple way to do this in a separate terminal is to run the following commandbrew services start redis
or
redis-server