Skip to content

Commit e4b592b

Browse files
feat: merge changes before transferring ownership (#101)
# 🤖 Linear Closes GIT-XXX ## Description ## Checklist before requesting a review - [ ] I have conducted a self-review of my code. - [ ] I have conducted a QA. - [ ] If it is a core feature, I have included comprehensive tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Launched an enhanced funding mechanism that streamlines registration and distribution processes. - Expanded support for additional networks, offering broader ecosystem connectivity. - Introduced a new event type, "DistributionUpdatedWithMerkleRoot," enhancing event handling capabilities. - Added a new handler for managing "RegisteredWithSender" events within the Easy Retro Funding strategy. - Updated event handling to accommodate "DistributionUpdatedWithMerkleRoot" across various components. - Enhanced the workflow for end-to-end tests, improving testing accuracy and reliability. - **Documentation** - Updated operational and configuration guidelines for clearer setup and smoother deployments. - Enhanced clarity in environment variable documentation and workflow descriptions. - **Chores** - Refined deployment workflows and performance settings to improve overall system reliability. - Increased default fetch limit for public data access in Hasura configuration. - **Tests** - Strengthened testing coverage to ensure robust event handling and maintain system stability. - Added new test cases for the Easy Retro Funding strategy and updated existing tests for event handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: 0xkenj1 <[email protected]> Co-authored-by: 0xkenj1 <[email protected]>
1 parent 7ec9adb commit e4b592b

File tree

30 files changed

+2762
-249
lines changed

30 files changed

+2762
-249
lines changed

.github/README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ This directory contains the GitHub Actions workflows for the Grants Stack Indexe
44

55
## Available Workflows
66

7-
| Workflow | Description |
8-
| ------------------------ | ----------------------------------------------- |
9-
| `main-workflow.yml` | Main CI pipeline triggered on PR to dev/main |
10-
| `build.yml` | Handles project building and type checking |
11-
| `build-image.yml` | Builds and validates Docker images |
12-
| `lint.yml` | Runs code linting and commit message validation |
13-
| `test.yml` | Executes unit tests with coverage |
14-
| `test-integration.yml` | Runs integration tests |
15-
| `create-ecr.yml` | Creates ECR repository in AWS |
16-
| `create-s3.yaml` | Creates S3 bucket for terraform state |
17-
| `deploy-to-aws.yaml` | First-time deployment to AWS |
18-
| `deploy-blue-green.yml` | Handles blue-green deployment (Step 1) |
19-
| `promote-blue-green.yml` | Promotes blue-green deployment (Step 2) |
20-
| `destroy-blue-green.yml` | Finalizes blue-green deployment (Step 3) |
21-
| `destroy-deployment.yml` | Destroys environment resources |
7+
| Workflow | Description |
8+
| ------------------------ | ------------------------------------------------- |
9+
| `main-workflow.yml` | Main CI pipeline triggered on PR to dev/main |
10+
| `build.yml` | Handles project building and type checking |
11+
| `build-image.yml` | Builds and validates Docker images |
12+
| `lint.yml` | Runs code linting and commit message validation |
13+
| `test.yml` | Executes unit and integration tests with coverage |
14+
| `create-ecr.yml` | Creates ECR repository in AWS |
15+
| `create-s3.yaml` | Creates S3 bucket for terraform state |
16+
| `deploy-to-aws.yaml` | First-time deployment to AWS |
17+
| `deploy-blue-green.yml` | Handles blue-green deployment (Step 1) |
18+
| `promote-blue-green.yml` | Promotes blue-green deployment (Step 2) |
19+
| `destroy-blue-green.yml` | Finalizes blue-green deployment (Step 3) |
20+
| `destroy-deployment.yml` | Destroys environment resources |
2221

2322
## Main Workflow
2423

@@ -93,13 +92,14 @@ Each step requires manual trigger with environment selection (blue/green) to ens
9392

9493
## Required Configuration
9594

96-
###Environment Variables and Secrets
95+
### Environment Variables and Secrets
96+
9797
To properly configure your GitHub repository, set up the following environment variables and secrets:
9898

9999
1. Add Repository Secrets
100100
Navigate to GitHub Repository Settings → Secrets and add:
101101

102-
- `AWS_ACCESS_KEY_ID`
102+
- `AWS_ACCESS_KEY`
103103
- `AWS_SECRET_ACCESS_KEY`
104104
- `ECR_REGISTRY`
105105

@@ -249,5 +249,5 @@ The `push-to-ecr.yaml` workflow automatically pushes images to Amazon ECR when c
249249
Required secrets for ECR:
250250

251251
- `ECR_REGISTRY`
252-
- `AWS_ACCESS_KEY_ID`
252+
- `AWS_ACCESS_KEY`
253253
- `AWS_SECRET_ACCESS_KEY`

.github/production_operations.md

+27-25
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This guide is for production operations on the Gitcoin Data Layer.
1010

1111
- Make sure you have already created the S3 bucket and ECR repository. Refer to the [README.md](./README.md) for more information.
1212
- Make sure you have already created environment variables and secrets in the repository settings. Refer to the [README.md](./README.md) for more information.
13+
- Run `Push Docker Image to ECR` workflow and ensure the latest commit hash is available in the ECR Registry and use that in the TERRAFORM_VARS image tags
1314

1415
## First Deployment
1516

@@ -21,10 +22,10 @@ This guide is for production operations on the Gitcoin Data Layer.
2122
4. Go to EC2 > Instances > gitcoin-data-layer-production-bastion > Connect > Session Manager > Connect ( IF YOU CAN’T USE `SessionManager` try rebooting the instance)
2223
5. Once in the terminal run:
2324

24-
1. sudo su
25-
2. cd ~
26-
3. git clone https://github.com/defi-wonderland/grants-stack-indexer-v2.git
27-
4. cd grants-stack-indexer-v2
25+
1. `sudo su`
26+
2. `cd ~`
27+
3. `git clone https://github.com/gitcoinco/grants-stack-indexer-v2.git`
28+
4. `cd grants-stack-indexer-v2`
2829
5. set env variables for scripts
2930

3031
1. `nano ./scripts/migrations/.env`
@@ -35,11 +36,11 @@ This guide is for production operations on the Gitcoin Data Layer.
3536
NODE_ENV=production
3637
```
3738

38-
6. chmod +x ./deployment/bastion_scripts/install_dependencies.sh
39-
7. ./deployment/bastion_scripts/install_dependencies.sh
40-
8. source ~/.bashrc
41-
9. pnpm i && pnpm build
42-
10. pnpm db:create-databases
39+
6. `chmod +x ./deployment/bastion_scripts/install_dependencies.sh`
40+
7. `./deployment/bastion_scripts/install_dependencies.sh`
41+
8. `source ~/.bashrc`
42+
9. `pnpm i && pnpm build`
43+
10. `pnpm db:create-databases`
4344

4445
### Migrate cache: Run 2 times, first green, blue after.
4546

@@ -49,19 +50,18 @@ This guide is for production operations on the Gitcoin Data Layer.
4950
DATABASE_URL=postgres://{{DB_USER}}:{{DB_PASSWORD}}@{{DB_URL}}:5432/GitcoinDatalayerGreen
5051
DATABASE_SCHEMA=public
5152
NODE_ENV=production
52-
5353
```
5454

55-
2. pnpm db:cache:migrate
56-
3. nano ./scripts/migrations/.env
55+
2. `pnpm db:cache:migrate`
56+
3. `nano ./scripts/migrations/.env`
5757

5858
```tsx
5959
DATABASE_URL=postgres://{{DB_USER}}:{{DB_PASSWORD}}@{{DB_URL}}:5432/GitcoinDatalayerBlue
6060
DATABASE_SCHEMA=public
6161
NODE_ENV=production
6262
```
6363

64-
4. pnpm db:cache:migrate
64+
4. `pnpm db:cache:migrate`
6565

6666
### Bootstrap Green database
6767

@@ -81,8 +81,8 @@ This guide is for production operations on the Gitcoin Data Layer.
8181
8282
```
8383

84-
2. pnpm bootstrap:metadata
85-
3. pnpm bootstrap:pricing
84+
2. `pnpm bootstrap:metadata`
85+
3. `pnpm bootstrap:pricing`
8686

8787
### Migrate processing tables: Run 2 times, first green, blue after.
8888

@@ -94,16 +94,16 @@ This guide is for production operations on the Gitcoin Data Layer.
9494
NODE_ENV=production
9595
```
9696

97-
2. pnpm db:migrate
98-
3. nano ./scripts/migrations/.env
97+
2. `pnpm db:migrate`
98+
3. `nano ./scripts/migrations/.env`
9999

100100
```tsx
101101
DATABASE_URL=postgres://{{DB_USER}}:{{DB_PASSWORD}}@{{DB_URL}}:5432/GitcoinDatalayerBlue
102102
DATABASE_SCHEMA=public
103103
NODE_ENV=production
104104
```
105105

106-
4. pnpm db:migrate
106+
4. `pnpm db:migrate`
107107

108108
### Configure API
109109

@@ -115,7 +115,9 @@ This guide is for production operations on the Gitcoin Data Layer.
115115
HASURA_SCHEMA=public
116116
```
117117

118-
2. pnpm api:configure
118+
2. `pnpm api:configure`
119+
120+
_Note: If data isn't populated, check your processing task logs on ECS. If there are issues, fix them and then run `Upgrade current deployment` workflow. Avoid using this unless you are adding a new chain or there are errors during the first time deployment._
119121

120122
## Upgrade using blue deployment
121123

@@ -130,11 +132,11 @@ This guide is for production operations on the Gitcoin Data Layer.
130132
DATABASE_SCHEMA=public
131133
NODE_ENV=production
132134
```
133-
- pnpm db:reset
134-
- pnpm db:cache:reset
135-
- pnpm db:cache:migrate
136-
- pnpm db:copy-cache -f {{ green | blue (should be the source environment) }}
137-
- pnpm db:migrate
135+
- `pnpm db:reset`
136+
- `pnpm db:cache:reset`
137+
- `pnpm db:cache:migrate`
138+
- `pnpm db:copy-cache -f {{ green | blue (should be the source environment) }}`
139+
- `pnpm db:migrate`
138140
- Set hasura config `nano ./scripts/hasura-config/.env`
139141

140142
```tsx
@@ -143,7 +145,7 @@ This guide is for production operations on the Gitcoin Data Layer.
143145
HASURA_SCHEMA=public
144146
```
145147

146-
- pnpm api:configure
148+
- `pnpm api:configure`
147149

148150
5. Wait until the new deployment is stable,you can go to the hasura api task on ECS and get the IP address of the task and check if the api is working. (You can rollback running again using `Promote Blue Green (Start upgrade - Step 2)` workflow)
149151
6. Run `Promote Blue Green (Start upgrade - Step 2)` workflow.

.github/workflows/test-integration.yml

-23
This file was deleted.

0 commit comments

Comments
 (0)