Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Improve contributing.md, add incident instructions INTER-945 #179

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# Contributing to Fingerprint Pro use cases

The `main` branch is locked for the push action. For proposing changes, use the standard [pull request approach](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). It's recommended to discuss fixes or new functionality in the Issues, first.

## Working with code

We prefer using [yarn](https://yarnpkg.com/) for installing dependencies and running scripts.

The `main` branch is locked for the push action. For proposing changes, use the standard [pull request approach](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). It's recommended to discuss fixes or new functionality in the Issues, first.
* Run `yarn install` to install dependencies.
* Run `yarn dev` to start the local development server.
* Run `yarn build` to build a production build of the project.
* Run `yarn start` to start the production build of the project.
* Run `yarn lint` to check the code style using [ESLint](https://eslint.org/).

See the [package.json](./package.json) -> `scripts` section for more useful commands.

### How to build
## Testing

Just run:
* Run `yarn test` to run unit tests using [Vitest](https://vitest.dev/).
* To run end-to-end tests using [Playwright](https://playwright.dev/):
* First run `yarn dev` or `yarn start` to start the development or production server.
* Then run `yarn test:e2e:chrome` to run the tests in Chrome.

```shell
yarn build
```
### Deployment

### Code style
- Merging a PR into `main` automatically triggers a new deployment accessible on [demo.fingerprint.com](https://demo.fingerprint.com).
- The app is deployed as a Digital Ocean App.
- The app is deployed behind a Cloudfront distribution in the Fingerprint DEV AWS environment (search for `demo.fingerprint.com` in the distribution description).
- If you ever encounter caching issues, for example, a cached index.html pointing to no longer existing resources, you can fix it by [creating a cache invalidation](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation_Requests.html#invalidating-objects-console) (`/*` is fine) in the Cloudfront distribution.

The code style is controlled by [ESLint](https://eslint.org/). Run to check that the code style is ok:
### Rollbacks and incident response

```shell
yarn lint
```
If an incident occurs, any member of the Fingerprint team on Digital Ocean can rollback the app to the previous version. In case of any problems, please contact @JuroUhlar and the Integrations team.

### How to publish
1. Go to the [Digital Ocean control panel](https://cloud.digitalocean.com/apps/69a24f2e-6d8e-4e9d-bcf3-024a653ae7b2/deployments).
2. Find the `fingerprint-use-cases` app.
3. Click on the `Activity` tab.
4. Find a previous working version and click `Rollback`.

- Project is deployed to [demo.fingerprint.com](https://demo.fingerprint.com) with each merge into the `main` branch.
Loading