Skip to content

Additional Information

Bogdan Marc edited this page Sep 9, 2024 · 2 revisions

Coding standards

rubocop should always return a clean status with no warnings.

Tests

Once the API is started you can invoke the tests with the simple command below:

rake test

Issues

Please add issues to the shared issues list

Deployment

The detailed deployment mapping is described in deployment.yml. At the time of writing, using the new infrastructure, the deployment process is as follows:

  • commits to the dev-infrastructure branch will deploy the dev server
  • commits to the preprod branch will deploy the pre-production server
  • any commit on the prod branch will deploy the production server as a new release

If the commit is a "new" release, the deployment should be tagged with the same semantic version number matching the BREAKING.FEATURE.PATCH format, e.g. v1.2.3, the same as should be set in the /app/lib/version.rb; also, a short annotation summarising the updates should be included in the tag as well.

Once the production deployment has been completed and verified, please create a release on the repository using the same semantic version number. Utilise the Generate release notes from commit log option to create specific notes on the contained changes as well as the ability to diff agains the previous version.

entrypoint.sh features

  • Workaround to removing the PID lock of the Rails process in the event of the application crashing and not releasing the process.
  • Guards to ensure the required environment variables are set accordingly and trigger the build to fail noisily and log to the system.
  • Rails secret creation for SECRET_KEY_BASE assignment; see Runtime Configuration environment variables.

Rails script tasks

Some development tasks are handled by automated Rails task scripts. All tasks code is in ./lib/tasks/*.rake. You can list all of the tasks with rails -T. The mostly commonly useful ones are:

  • test
    Run the test suite

  • ukhpi:aspects
    Generate a JavaScript description of the DSD aspects, as described by the DataModel class, which directly translates from the UKHPI-dsd.ttl file

  • boundaries tasks
    A number of tasks releated to generating simplified GeoJSON files from the Shapefiles downloaded from ONS. These tasks will need to be re-run when the boundaries change, e.g. when local authorities are merged or split to form new unitary authorities. See below for more details.

    • ukhpi:describe[uri]
      A convenient way to perform a SPARQL describe for the given URI

    • ukhpi:locations
      This task uses a SPARQL query to list all of the geographical regions in the UKHPI data, and their containment hierarchy, and generate cached versions of that data as code. In particular, it regenerates app/javascript/data/locations-data.js and app/models/locations_table.rb. This task should be re-run if and when the regions data from LR is changed in the triple store.

Note that, by default, SPARQL queries will be run against the dev triple store. To direct the query against a different SPARQL endpoint, change the SERVER environment variable:

SERVER="https://lr-dev.epimorphics.net/landregistry/query" rails ukhpi:locations

Clone this wiki locally