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.
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.
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 |
- Install NodeJS V20.8
- Install 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.
To build the project, run:
make build
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.
We use ESlint as both a formatter and code quality assurance. Eslint can also be setup to format on save using a VScode extension:
-
Install the ESlint VScode extenstion.
-
Open your user settings (JSON) inside VScode and add the following:
"editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true }
-
Reload VScode.
- Use the Visual Studio Code IDE for development.
- Use the preformatted
PULL_REQUEST_TEMPLATE
by adding meaningful description - Make sure test coverage is above
95%
- Do not disable husky pre checks locally
- Use MVC pattern when adding a new page/endpoint, including validation and authentication. Example can be found on the following doc description here
- Happy coding
This code is open source software licensed under the MIT License.