This is a proof of concept application that searches Github for API specification files within government department Github repositories. It then tries to extract metadata from the API specification documents.
Gathering the data comprises three steps:
Organisation.populatewill create a set of organisations where each organisation represents a government department's github presence.organisation.find_and_create_recordswill search the organisation's github applications for API Specification documents and create a record for each one it finds.record.processwill get the contents of the documents identified in the previous step, and attempt to generate a metadata record from the document.
The application is set up to display all the UK Government organisations it finds.
The page for a particular organisation will list the records that it has been able to extract metadata from. There is also an update button on this page that can be used to initiate a data gathering process (as detailed above) for this organisation.
This is a Ruby on Rails application and requires Ruby and PostgesSQL installed.
- Clone this application to your local environment
- cd into the application root
- run
bundleto install the required ruby gems - run
rails db:createandrails schema:loadto set up the database - run
rake javascript:buildto set up the JavaScript environment - run
rake dartsass:buildto set up SASS
You should then be able to run a local instance of the application using rails s
The system requires a Github key to be provide. This allows the search for content on github to function. To work either:
- Set the environment variable
GITHUB_KEYto return a Github key - In development, set the credentials to include
github_keywith the Github key.
The CI pipeline for this application are run via github actions.
The following CI elements can be run locally before deployment.
To run the test locally use the command rspec
Use Rubocop to check the Ruby code of this application locally. The following
command will both find any problems and attempt to fix them: rubocop -A
Use the command brakeman to locally run a vulnerability test on the code