Skip to content

The GitHub request application is a tool designed to streamline and automate the process of managing and tracking request for GitHub. This includes the adding, removal or editing of members.

License

cabinetoffice/github-requests-app

Repository files navigation

GitHub Requests App

Static Badge

The GitHub request application is a tool designed to streamline and automate the process of managing and tracking request for GitHub. This includes the adding, removal or editing of members. Further documentation can be found here.

Overview

The GitHub Requests Application is a Node.js-based web application that provides a simple interface. Internal users (members of the Cognito user pool) fill in forms with requested details. When a request is submitted, an issue is created on the dedicated terraform repository, and an email is sent to the user from our github-request.idp email address. The email includes a message containing the user's filled-in information.

The issue is then reviewed by the team, and further comments may be requested if necessary. Approval must be granted by two members of the team to avoid misconfigurations.

Frontend Technologies and Utils

Config variables

Key Description Example Value
AUTH_SIGN_IN_URL Authentication sign in URL https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login
BASE_URL Base application URL http://localhost:3000 (dev mode)
CDN_HOST CDN host cdn_domain
COOKIE_ID_NAME The name of the cookie github-requests
COOKIE_PARSER_SECRET Secret used in validating/calculating the cookie signature secret
COOKIE_SESSION_SECRET Secret key for signing the session cookie secret
FEATURE_FLAG_ENABLE_AUTH Enable authentication feature flag true or false
GITHUB_KEY GitHub key [github key]
GITHUB_OWNER GitHub organisation name cabinetoffice
GITHUB_REPO_ISSUE_ASSIGNEE GitHub team responsible to solve issues and update configs files IDP_TEAM
GITHUB_REPO_ISSUE_LABEL GitHub label to categorize the related issues github-requests-app
GITHUB_TERRAFORM_REPO GitHub private repo with terraform configurations with members, repos and teams files github-requests-terraform
HUMAN Formatting messages form (default JSON) true (Enable human formatting for log messages)
LOG_LEVEL Logging levels info
NODE_ENV Node environment development or production
NODE_SSL_ENABLED Whether SSL is enabled for Node true or false
PATH_SSL_CERTIFICATE Path to SSL certificate ./infrastructure/host/test.cert
PATH_SSL_PRIVATE_KEY Path to SSL private key ./infrastructure/host/test.key
PORT Server port number 3000
SESSION_APP_KEY Session application key git
SESSION_ID_NAME Session ID name connect.sid
USER_POOL_CLIENT_ID Client ID of an app registered with the user pool in Amazon Cognito secret
USER_POOL_ID ID of the user pool in Amazon Cognito secret

Launching the web-app

Prerequisites

  1. Install NodeJS V20.8
  2. Install Docker

Running local development environment with Docker

Docker is used to run the application in development mode, with tooling setup to detect changes in local src directory and reload the container's node server.

  • Ensure that NODE_ENV=development is set in the .env file.

  • In order for static assets to be loaded, the CDN_HOST must be set to a CDN domain which serves the GOV.UK static assets.

Building the application

To build the project, run:

make build

Building the Docker Image

Create a copy of the .env.example file and name it .env, then run:

make docker-build
make docker-up

This will then download the necessary dependencies, build the Docker image, and start the application. You will be able to access it on localhost:3000.

ESlint

We use ESlint as both a formatter and code quality assurance. Eslint can also be setup to format on save using a VScode extension:

  1. Install the ESlint VScode extenstion.

  2. Open your user settings (JSON) inside VScode and add the following:

    "editor.formatOnSave": true, 
    "editor.codeActionsOnSave": { "source.fixAll.eslint": true }
  3. Reload VScode.

Recommendations

  1. Use the Visual Studio Code IDE for development.
  2. Use the preformatted PULL_REQUEST_TEMPLATE by adding meaningful description
  3. Make sure test coverage is above 95%
  4. Do not disable husky pre checks locally
  5. Use MVC pattern when adding a new page/endpoint, including validation and authentication. Example can be found on the following doc description here
  6. Happy coding

License

This code is open source software licensed under the MIT License.

About

The GitHub request application is a tool designed to streamline and automate the process of managing and tracking request for GitHub. This includes the adding, removal or editing of members.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published