From 1b47da386edd2a23d2d4e61daf95c93310bbbfba Mon Sep 17 00:00:00 2001 From: Moe Shehab <52987806+mhmdksh@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:08:55 +0400 Subject: [PATCH 1/5] Update master-pipeline.yml --- .github/workflows/master-pipeline.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/master-pipeline.yml b/.github/workflows/master-pipeline.yml index 90f60e8dc..3af87022a 100644 --- a/.github/workflows/master-pipeline.yml +++ b/.github/workflows/master-pipeline.yml @@ -4,7 +4,10 @@ on: push: branches: - master - + pull_request: + branches: + - master + jobs: test: runs-on: ubuntu-latest @@ -65,6 +68,7 @@ jobs: publish: needs: test runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Check out the repo uses: actions/checkout@v2 @@ -84,6 +88,7 @@ jobs: deploy: needs: publish runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Production deploy uses: garygrossgarten/github-action-ssh@v0.6.4 From 06441bed4e3268720c6d7eb6e7e9bff4bdb1e4dc Mon Sep 17 00:00:00 2001 From: mhmdksh Date: Thu, 3 Aug 2023 09:16:52 +0000 Subject: [PATCH 2/5] Updated the github actions structure --- .github/workflows/develop-pipeline.yml | 7 ++- .github/workflows/run-tests-on-pr.yml | 68 -------------------------- .github/workflows/staging-pipeline.yml | 7 ++- 3 files changed, 12 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/run-tests-on-pr.yml diff --git a/.github/workflows/develop-pipeline.yml b/.github/workflows/develop-pipeline.yml index c49ae38a6..8bbde1fde 100644 --- a/.github/workflows/develop-pipeline.yml +++ b/.github/workflows/develop-pipeline.yml @@ -4,7 +4,10 @@ on: push: branches: - develop - + pull_request: + branches: + - develop + jobs: test: runs-on: ubuntu-latest @@ -65,6 +68,7 @@ jobs: publish: needs: test runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Check out the repo uses: actions/checkout@v2 @@ -84,6 +88,7 @@ jobs: deploy: needs: publish runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Develop deploy uses: garygrossgarten/github-action-ssh@v0.6.4 diff --git a/.github/workflows/run-tests-on-pr.yml b/.github/workflows/run-tests-on-pr.yml deleted file mode 100644 index be434d0e4..000000000 --- a/.github/workflows/run-tests-on-pr.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: run tests on pull request - -on: - workflow_dispatch: - pull_request: - branches: - - develop - - master - - staging - types: - - opened - -jobs: - test: - runs-on: ubuntu-latest - services: - # Label used to access the service container - redis: - # Docker Hub image - image: redis - # Set health checks to wait until redis has started - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - postgres: - # Use this postgres image https://github.com/Giveth/postgres-givethio - image: ghcr.io/giveth/postgres-givethio:latest - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: givethio - PGDATA: /var/lib/postgresql/data/pgdata - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5443:5432 - steps: - - uses: actions/checkout@v1 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 16.14.2 - - name: Install dependencies - run: npm ci - - name: Run tslint - run: npm run tslint - - name: Run build - run: npm run build - - name: Run migrations - run: npm run db:migrate:run:test - - name: Run tests - run: npm run test - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - XDAI_NODE_HTTP_URL: ${{ secrets.XDAI_NODE_HTTP_URL }} - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} - INFURA_ID: ${{ secrets.INFURA_ID }} - POLYGON_SCAN_API_KEY: ${{ secrets.POLYGON_SCAN_API_KEY }} - OPTIMISTIC_SCAN_API_KEY: ${{ secrets.OPTIMISTIC_SCAN_API_KEY }} - CELO_SCAN_API_KEY: ${{ secrets.CELO_SCAN_API_KEY }} - CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }} diff --git a/.github/workflows/staging-pipeline.yml b/.github/workflows/staging-pipeline.yml index 22b704726..2e1fca043 100644 --- a/.github/workflows/staging-pipeline.yml +++ b/.github/workflows/staging-pipeline.yml @@ -4,7 +4,10 @@ on: push: branches: - staging - + pull_request: + branches: + - staging + jobs: test: runs-on: ubuntu-latest @@ -65,6 +68,7 @@ jobs: publish: needs: test runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Check out the repo uses: actions/checkout@v2 @@ -84,6 +88,7 @@ jobs: deploy: needs: publish runs-on: ubuntu-latest + if: github.event_name == 'push' steps: - name: Staging deploy uses: garygrossgarten/github-action-ssh@v0.6.4 From 600a80ab53e4825acd044e9a59b24578e80f3d09 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 11 Aug 2023 19:59:04 -0500 Subject: [PATCH 3/5] hotfix qfroundscore only fill it if null --- src/repositories/donationRepository.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/repositories/donationRepository.ts b/src/repositories/donationRepository.ts index d76e858a5..caa7b3ae8 100644 --- a/src/repositories/donationRepository.ts +++ b/src/repositories/donationRepository.ts @@ -14,6 +14,7 @@ export const fillQfRoundDonationsUserScores = async (): Promise => { SET "qfRoundUserScore" = u."passportScore" FROM "user" u WHERE donation."userId" = u.id + AND "qfRoundUserScore" IS NULL AND donation.status = 'verified' AND EXISTS( SELECT 1 From d4f6c4588c816577c4e921f0b0d255db8465ff4d Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 28 Aug 2023 22:15:07 -0500 Subject: [PATCH 4/5] improve calculations priority queue --- src/services/donationService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/donationService.ts b/src/services/donationService.ts index 43b2356c0..7041df901 100644 --- a/src/services/donationService.ts +++ b/src/services/donationService.ts @@ -317,10 +317,6 @@ export const syncDonationStatusWithBlockchainNetwork = async (params: { } await donation.save(); - // Update materialized view for project and qfRound data - await refreshProjectEstimatedMatchingView(); - await refreshProjectDonationSummaryView(); - // ONLY verified donations should be accumulated // After updating, recalculate user total donated and owner total received await updateUserTotalDonated(donation.userId); @@ -332,6 +328,10 @@ export const syncDonationStatusWithBlockchainNetwork = async (params: { donation, }); + // Update materialized view for project and qfRound data + await refreshProjectEstimatedMatchingView(); + await refreshProjectDonationSummaryView(); + // send chainvine the referral as last step to not interrupt previous if (donation.referrerWallet && donation.isReferrerGivbackEligible) { logger.info( From 3dc487c81a2c14688ace9d8645a85a0c126df09d Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 28 Aug 2023 22:34:49 -0500 Subject: [PATCH 5/5] upgrade master test env for new auth service server --- config/test.env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/test.env b/config/test.env index 6fcdbcf97..3221d993a 100644 --- a/config/test.env +++ b/config/test.env @@ -83,9 +83,9 @@ TRACE_FILE_UPLOADER_PASSWORD=hello_trace API_GIV_PASSWORD=123 API_GIV_USERNAME=testApiGive -AUTH_MICROSERVICE_AUTHENTICATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authentication -AUTH_MICROSERVICE_AUTHORIZATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authorization -AUTH_MICROSERVICE_NONCE_URL=https://serve.giveth.io/siweauthmicroservice/v1/nonce +AUTH_MICROSERVICE_AUTHENTICATION_URL=https://auth.serve.giveth.io/v1/authentication +AUTH_MICROSERVICE_AUTHORIZATION_URL=https://auth.serve.giveth.io/v1/authorization +AUTH_MICROSERVICE_NONCE_URL=https://auth.serve.giveth.io/v1/nonce PRIVATE_ETHERS_TEST_KEY=8ab0e165c2ea461b01cdd49aec882d179dccdbdb5c85c3f9c94c448aa65c5ace PUBLIC_ETHERS_TEST_KEY=0x53bFf74b9Af2E3853f758A8D2Bd61CD115d27782