GithubHelp home page GithubHelp logo

ministryofjustice / disclosure-checker Goto Github PK

View Code? Open in Web Editor NEW
0.0 9.0 2.0 2.58 MB

Check when to disclose cautions or convictions

License: MIT License

Ruby 77.26% JavaScript 2.09% HTML 12.54% Gherkin 7.51% Dockerfile 0.40% Shell 0.03% SCSS 0.18%
x-justice-delivery-team

disclosure-checker's Introduction


MoJ logo

Disclosure Checker

repo standards badge

This is a Rails application to enable citizens to check when their convictions are spent. It is based on software patterns developed for the C100 Application.

Documentation for calculations of convictions

This service follows several rules to calculate spent dates of multiple convictions, we have documented all of the scenarios known to us in our tests:

We have also added visual graphics to better aid understanding:

We have also gather together all the documents and information we have gone through in one ticket:

If for some reason the ticket is not available, please refer to the following:

It is important to understand how convictions work, as this is the main reason for the existence of this service.

Docker

The application can be run inside a docker container. This will take care of the ruby environment, postgres database, and any other dependency for you, without having to configure anything in your machine.

  • docker-compose up

The application will be run in "production" mode, so will be as accurate as possible to a real production environment.

Please note, in production environments this is done in a slightly different way as we don't use docker-compose in those environments (kubernetes cluster). But the general idea is the same.

Getting Started

You will need to install Homebrew, to enable the brew command.

  • Copy .env.example to .env and replace with suitable values.

  • bundle install

  • bundle exec rails db:setup

  • bundle exec rails db:migrate

  • bundle exec rails server

GOV.UK Frontend (styles, javascript and other assets)

  • brew install yarn # if you don't have it already
  • yarn # this will install the dependencies

For running the tests:

  • Copy .env.test.example to .env.test and replace with suitable values if you expect to run the tests
  • RAILS_ENV=test bundle exec rails db:setup
  • RAILS_ENV=test bundle exec rails db:migrate

You can then run all the code linters and tests with:

  • RAILS_ENV=test bundle exec rake or
  • RAILS_ENV=test bundle exec rake test:all_the_things

Or you can run specific tests as follows (refer to lib/tasks/all_tests.rake for the complete list):

  • RAILS_ENV=test bundle exec rake spec
  • RAILS_ENV=test bundle exec rake brakeman

Cucumber features

ChromeDriver is needed for the integration tests. It can be installed on Mac using Homebrew: brew cask install chromedriver

The features can be run manually (these are not part of the default rake task) in any of these forms:

  • bundle exec cucumber features
  • bundle exec cucumber features/caution.feature
  • bundle exec cucumber features/caution.feature -t @happy_path

Any of the files in the features directory can be run individually.

By default cucumber will start a local server on a random port, run features against that server, and kill the server once the features have finished.

If you want to show the browser (useful to debug issues) prefix the commands like this:

  • SHOW_BROWSER=1 bundle exec cucumber features/caution.feature

K8s cluster staging environment

There is a staging environment running on this url

The staging env uses http basic auth to restrict access. The username and password should be available from the MoJ Rattic server, in the Family Justice group.

This environment should be used for any test or demo purposes, user research, etc. Do not use production for tests as this will have an impact on metrics and will trigger real emails

There is a deploy repo for this staging environment. It contains the k8s configuration files and also the required ENV variables.

Continuous integration and deployment

GitHub actions are used for CI and CD and you can find the configuration in .github/workflows/test-build-deploy.yml

After a successful merge to main, a docker image will be created and pushed to an ECR repository. It will also trigger an automatic deploy to staging.

For more details, refer to the deploy repo.

disclosure-checker's People

Contributors

bnewing avatar davidslv avatar dependabot[bot] avatar digitalali-moj avatar meenamodhvadia avatar njpreddy avatar njseeto avatar polsonby avatar tmckernan avatar vertism avatar zheileman avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disclosure-checker's Issues

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

Default branch is not main

Hi there
The default branch for this repository is not set to main
See repository settings/settings/branches to rename the default branch to main and ensure the Branch protection rules is set to main as well
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.