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

Merging Staging to Prod (Update CI) #45

Merged
merged 410 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
410 commits
Select commit Hold shift + click to select a range
ab8a7e8
Merge branch 'staging' into add/local-test-deployments
aminlatifi Sep 10, 2024
2a64877
Merge pull request #48 from GeneralMagicio/add/local-test-deployments
aminlatifi Sep 10, 2024
b5e9d29
Added funding manager to abc
aminlatifi Sep 11, 2024
6947f4a
Fixed a mock value name
aminlatifi Sep 11, 2024
f731219
Merge pull request #51 from GeneralMagicio/feat/add-funding-manager-abc
aminlatifi Sep 11, 2024
1814913
get inverter graphql endpoint from config
ae2079 Sep 11, 2024
c33d234
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into addS…
ae2079 Sep 11, 2024
2e6b78c
Fix review comments (use lodash, add provider to class elements and h…
ae2079 Sep 12, 2024
20513f1
Fix bug in get token total supply
ae2079 Sep 12, 2024
2a63812
add env variables for tests
ae2079 Sep 12, 2024
6daf7ea
separate run script from logic
ae2079 Sep 12, 2024
1697b2e
Add test for fetching all needed data from inverter
ae2079 Sep 12, 2024
d5cc608
Add todo
ae2079 Sep 12, 2024
a3e49cc
Fix command
ae2079 Sep 12, 2024
e02e63c
restore stub at the end of the test
ae2079 Sep 12, 2024
d607ab8
Changed sinon restore logic in test
aminlatifi Sep 12, 2024
7714f3d
Change sinon use
aminlatifi Sep 12, 2024
ecdf75c
Add filter to projects and donations incorporated in sync inverter data
aminlatifi Sep 12, 2024
809fa8e
Merge pull request #49 from GeneralMagicio/addScriptForSyncDataWithIn…
ae2079 Sep 12, 2024
9751f34
Add github action for inverter sync script
ae2079 Sep 15, 2024
1414f2c
Added staging deploy only
aminlatifi Sep 16, 2024
0882bc2
Merge pull request #53 from GeneralMagicio/add-deploy-action
aminlatifi Sep 16, 2024
3791375
Renamed pipeline
aminlatifi Sep 16, 2024
b32d8fd
Added privado request ID to logs
aminlatifi Sep 16, 2024
06b48ed
Added fromWalletAddress to the donation search term support
aminlatifi Sep 16, 2024
433cc70
Added test for fromWalletAddress match on donation search term
aminlatifi Sep 16, 2024
d2359ba
Merge pull request #54 from GeneralMagicio/feat/donation-search-term-…
aminlatifi Sep 16, 2024
5432b91
Changed log place
aminlatifi Sep 16, 2024
d354610
Changed log type to error
aminlatifi Sep 16, 2024
bbbbd8d
Fix mocked block timestamp to pass the test
ae2079 Sep 17, 2024
20b3f0d
Add manual trigger to the job
ae2079 Sep 17, 2024
944882b
Merge pull request #52 from GeneralMagicio/AddGithubActionForScript
ae2079 Sep 17, 2024
6104a89
Add build step to inverter script action
ae2079 Sep 17, 2024
ed16436
rename script
ae2079 Sep 17, 2024
c6b9f48
Fixed staging deploy only up command
aminlatifi Sep 17, 2024
4b14358
Merge branch 'staging' of https://github.com/GeneralMagicio/QAcc-BE i…
aminlatifi Sep 17, 2024
c87d719
Decomission backup donation service
aminlatifi Sep 17, 2024
0fb5308
Change the script to ssh to the server and run the command on it
ae2079 Sep 17, 2024
2b40b50
Change the script to run command on the server out of docker
ae2079 Sep 17, 2024
571a628
Install npm on server
ae2079 Sep 17, 2024
d1bd5c6
Separate steps
ae2079 Sep 17, 2024
fe1aa1f
Migrated to mongo connection
aminlatifi Sep 17, 2024
b904bb9
Skip abc launcher adapter tests
aminlatifi Sep 17, 2024
8893c63
Merge pull request #57 from GeneralMagicio/feat/migrate-mongo-connection
aminlatifi Sep 18, 2024
305b02b
Use stand alone dataSource
ae2079 Sep 18, 2024
f605071
Run the script stand alone
ae2079 Sep 18, 2024
762b689
Run the script in the docker
ae2079 Sep 18, 2024
f9c5fa7
Revert "Use stand-alone data source"
ae2079 Sep 18, 2024
cd350c5
change logger to console
ae2079 Sep 18, 2024
a1184c8
change command to print the logs
ae2079 Sep 18, 2024
2978cc7
add print logs
ae2079 Sep 18, 2024
87dfa3f
Merge pull request #56 from GeneralMagicio/runInverterScriptOnServer
aminlatifi Sep 18, 2024
2ec1709
change the cron to run on every mondays
ae2079 Sep 18, 2024
d1db721
use _ilike instead of _eq
ae2079 Sep 18, 2024
882cf67
Merge pull request #59 from GeneralMagicio/FixBugInQueries
ae2079 Sep 18, 2024
d2fc67c
set early access round id
ae2079 Sep 19, 2024
3e896e8
Merge pull request #60 from GeneralMagicio/fixBugInDonationEarlyAcces…
ae2079 Sep 19, 2024
19d0331
show earlyAccessRoundId
ae2079 Sep 19, 2024
003ccfd
fix lint error
ae2079 Sep 19, 2024
6477af5
join get user donations query with early access round
ae2079 Sep 19, 2024
14394e8
remove redundant code
ae2079 Sep 19, 2024
e9bbf28
Merge pull request #61 from GeneralMagicio/joinWithEarlyAccessRound
ae2079 Sep 19, 2024
07831cd
join with early access round
ae2079 Sep 19, 2024
39723e2
Merge pull request #62 from GeneralMagicio/addEarlyAccessRoundToQueries
ae2079 Sep 19, 2024
871ffe6
add projectDonationSummary entity
ae2079 Sep 22, 2024
b87990d
add migration for adding projectDonationSummary
ae2079 Sep 22, 2024
a735bc2
add repository for projectDonationSummary
ae2079 Sep 22, 2024
ff51025
add unit tests for the repository for projectDonationSummary
ae2079 Sep 22, 2024
2828f4b
add projectDonationSummary to resolvers
ae2079 Sep 22, 2024
a73063e
add unit tests for projectDonationSummaryResolver
ae2079 Sep 22, 2024
24356ab
push update to run pipeline again
ae2079 Sep 22, 2024
b775170
change earlyAccessRoundResolver.ts to roundsResolver.ts and add qf ro…
ae2079 Sep 23, 2024
734bea2
change tests and add new tests to them
ae2079 Sep 23, 2024
809135e
Added user accepted ToS field to the user
aminlatifi Sep 23, 2024
61fdd91
Remove test data after all
ae2079 Sep 23, 2024
9f06b9a
remove data after all tests
ae2079 Sep 23, 2024
99d79f2
added migration file
kkatusic Sep 23, 2024
d348d31
deleted ds_store
kkatusic Sep 23, 2024
9d3e9d2
added field and price updating function
kkatusic Sep 23, 2024
54969b7
added token_price update for early access round
kkatusic Sep 23, 2024
f1a15de
added test for q-round and early rounds
kkatusic Sep 24, 2024
342a8b3
use union type of graphql
ae2079 Sep 24, 2024
dee7578
change the tests
ae2079 Sep 24, 2024
217fa76
removed if condition in for loop
kkatusic Sep 24, 2024
b4a1960
fix tests
ae2079 Sep 24, 2024
ad57fb9
added additional where condition to query
kkatusic Sep 24, 2024
20db4d1
added token constant and added same logic for qacc round
kkatusic Sep 24, 2024
f419212
fix tests by deleting donations with qf rounds
ae2079 Sep 24, 2024
0068e86
fix tests by delete data in project qf rounds table
ae2079 Sep 24, 2024
3a70bf3
fix tests by delete data of qf rounds history table
ae2079 Sep 24, 2024
df096ca
Merge pull request #64 from GeneralMagicio/RoundsEndpoint
ae2079 Sep 24, 2024
68b2fd1
Added batchMintingEligibleUsers api
aminlatifi Sep 24, 2024
961cd3a
Merge branch 'staging' into feat/tos-support
aminlatifi Sep 24, 2024
73bd5c9
Merge pull request #66 from GeneralMagicio/feat/tos-support
aminlatifi Sep 24, 2024
8b02350
Merge branch 'staging' into feat/setup_token_price_column_round
aminlatifi Sep 24, 2024
c1f05bd
Merge branch 'staging' into feat/setup_token_price_column_round
kkatusic Sep 24, 2024
4c21d11
Merge branch 'staging' into feat/setup_token_price_column_round
kkatusic Sep 24, 2024
7fdc7db
Merge branch 'feat/setup_token_price_column_round' of https://github.…
kkatusic Sep 24, 2024
9534b55
pull staging and resolve confilcts
ae2079 Sep 24, 2024
8f8e7cf
fix tests by delete data at the end of project donation summary tests
ae2079 Sep 24, 2024
737004e
Add AddUserAcceptedToS Migration
aminlatifi Sep 24, 2024
dfb8e7d
fix tests by delete donations from DB
ae2079 Sep 24, 2024
8a56f72
Merge pull request #63 from GeneralMagicio/AddProjectDonationSummary
aminlatifi Sep 24, 2024
8767092
Merge branch 'staging' into feat/setup_token_price_column_round
aminlatifi Sep 24, 2024
61a2f7b
changes to gecko timestamp and token name
kkatusic Sep 24, 2024
a99df26
fixing test running errors
kkatusic Sep 25, 2024
ebeaf98
fixing test cases
kkatusic Sep 25, 2024
0060645
Added addQAccToken
aminlatifi Sep 25, 2024
4572d7f
Exclude addQAccToken from running in test env
aminlatifi Sep 25, 2024
ae1616d
Moved project donation summary update logic to after donation verific…
aminlatifi Sep 25, 2024
21eb201
Fixed test issue
aminlatifi Sep 25, 2024
14455eb
Merge pull request #67 from GeneralMagicio/feat/donation-summary
aminlatifi Sep 25, 2024
115a964
Merge branch 'staging' into feat/setup_token_price_column_round
aminlatifi Sep 25, 2024
f5a6cc5
removing condition
kkatusic Sep 25, 2024
c1a4a39
removed another condition
kkatusic Sep 25, 2024
908bf37
pushed formatting date inside getTokenPriceAtDate method
kkatusic Sep 25, 2024
3b01e0e
fixing test after removing conditions
kkatusic Sep 25, 2024
c3aff53
test updated
kkatusic Sep 25, 2024
a01e9cc
fixing function naming issue
kkatusic Sep 25, 2024
2e47519
Added roundNumber to qfRound entity
aminlatifi Sep 25, 2024
27cb5c2
Added migraiton create script
aminlatifi Sep 25, 2024
2060b78
Added releationId to ProjectDonationSummary
aminlatifi Sep 25, 2024
d8c7d6f
changed earlyAccessRound index
aminlatifi Sep 25, 2024
043a724
Renamed projectDonationSummary to projectRoundRecord
aminlatifi Sep 25, 2024
4e5bf4e
Implemented getCumulativePastRoundsDonationAmounts in ProjectRoundRec…
aminlatifi Sep 25, 2024
6cced6f
Added Migration to change donation field type and projectRoundRecord …
aminlatifi Sep 25, 2024
f2cce59
Made qfRound round number nullabe
aminlatifi Sep 26, 2024
edb590f
Changed earlyRound type decision field
aminlatifi Sep 26, 2024
c48d66d
Fixed precision in test
aminlatifi Sep 26, 2024
fe7d00d
Fixed issue in test
aminlatifi Sep 26, 2024
df75268
add qacc validation to draft donation resolver
ae2079 Sep 26, 2024
a8e00f1
fix tests
ae2079 Sep 26, 2024
345f2d1
Update src/repositories/projectRoundRecordRepository.test.ts
aminlatifi Sep 26, 2024
b254f6b
Changed getCumulativePastRoundsDonationAmounts query
aminlatifi Sep 26, 2024
fdc1198
Merge branch 'feat/contribution-cap' of https://github.com/GeneralMag…
aminlatifi Sep 26, 2024
1da2c9e
Merge pull request #68 from GeneralMagicio/feat/contribution-cap
aminlatifi Sep 26, 2024
5a7b2ea
adding starting date check in query for round token price
kkatusic Sep 26, 2024
c042c67
added constant for token name
kkatusic Sep 26, 2024
9277407
Added projectUserRecord and its repository
aminlatifi Sep 26, 2024
61624c2
Moved qacc constants to separate file
aminlatifi Sep 26, 2024
4361a5c
Merge pull request #69 from GeneralMagicio/addNFTConditionToDraftDona…
ae2079 Sep 26, 2024
be63d44
Merge branch 'staging' into feat/setup_token_price_column_round
kkatusic Sep 26, 2024
f9071cb
fixing build errors
kkatusic Sep 26, 2024
53ff13d
Added projectUserRecode to user resolver
aminlatifi Sep 26, 2024
99a73ad
Merge branch 'staging' of https://github.com/GeneralMagicio/QAcc-BE i…
aminlatifi Sep 26, 2024
169263b
add new fields to early access round and qf round tables
ae2079 Sep 27, 2024
38248a1
add migration for adding round caps
ae2079 Sep 27, 2024
4d5bf1a
update early access round repository tests
ae2079 Sep 27, 2024
1f9697e
make new fields nullable
ae2079 Sep 27, 2024
cacb46d
update qf round repository tests
ae2079 Sep 27, 2024
014dc02
update migration to make new fields nullable
ae2079 Sep 27, 2024
571aca9
update rounds resolver tests
ae2079 Sep 27, 2024
7f2687c
Merge branch 'staging' into feat/setup_token_price_column_round
aminlatifi Sep 27, 2024
aee9d42
Fixed import issue
aminlatifi Sep 27, 2024
aa5e9b2
Merge pull request #65 from GeneralMagicio/feat/setup_token_price_col…
kkatusic Sep 27, 2024
9258509
Added fix add token price to rounds
aminlatifi Sep 27, 2024
9ba7f4b
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into AddR…
ae2079 Sep 29, 2024
0cf6243
remove redundant POLPriceAtRoundStart field and use tokenPrice instea…
ae2079 Sep 29, 2024
85d8d63
Update ProjectUserRecord and related resolvers
aminlatifi Sep 29, 2024
9f8be62
Merge branch 'staging' into feat/contribution-cap
aminlatifi Sep 29, 2024
78ddc0d
Made qf slug unique in tests
aminlatifi Sep 29, 2024
632dbee
Added round number generator
aminlatifi Sep 29, 2024
aa9a019
Fixed an issue in importing
aminlatifi Sep 29, 2024
d3d5854
Added project user record migration
aminlatifi Sep 29, 2024
adc0894
Merge pull request #71 from GeneralMagicio/feat/contribution-cap
aminlatifi Sep 29, 2024
b1b2516
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into AddR…
ae2079 Sep 29, 2024
7526438
add virtual fields for cumulative caps
ae2079 Sep 29, 2024
da4bb4a
update tests based on the changes
ae2079 Sep 29, 2024
e3cf638
Fixed cumulutive values for qfRound and EA roudns
aminlatifi Sep 29, 2024
21325d5
Merge pull request #70 from GeneralMagicio/AddRoundCaps
aminlatifi Sep 29, 2024
52b76d6
add mock report based on the test data
ae2079 Sep 29, 2024
0f37edf
sync the reward amounts based on the report json file
ae2079 Sep 29, 2024
d634546
fix unit test
ae2079 Sep 29, 2024
30b40a6
remove redundant comments
ae2079 Sep 29, 2024
1549045
find reports based on round number
ae2079 Sep 29, 2024
87bfdf8
Added qAcc service for allowed donate amount
aminlatifi Sep 29, 2024
c9b3826
add simple git lib
ae2079 Sep 30, 2024
df1d265
pull the reports from github repo
ae2079 Sep 30, 2024
e334e18
Don't throw error on missed project round records
aminlatifi Sep 30, 2024
fb1e414
Fixed issue in schema
aminlatifi Sep 30, 2024
8ab8243
Updated graphql schema
aminlatifi Sep 30, 2024
38d76dc
Revert change in ProjectRoundRecord query
aminlatifi Sep 30, 2024
74382aa
Merge pull request #73 from GeneralMagicio/feat/userDonateCap
aminlatifi Sep 30, 2024
98c01eb
Renamed variables and added comments
aminlatifi Sep 30, 2024
4465569
Renamed variables and added comments
aminlatifi Sep 30, 2024
7d7bb1f
Added qacc resolver projectUserDonationCap api
aminlatifi Sep 30, 2024
c992089
Integrated qacc limit with the donation creation api
aminlatifi Sep 30, 2024
b9b325c
Removed .only
aminlatifi Sep 30, 2024
0d91977
Fixed issue in draft donation tests
aminlatifi Sep 30, 2024
4b22d80
Merge pull request #75 from GeneralMagicio/feat/qacc-cap-api
aminlatifi Sep 30, 2024
7cf68d7
Added price fetch cron job
aminlatifi Oct 1, 2024
0c8636a
Implemented lead time for round price fetching
aminlatifi Oct 1, 2024
2330d56
Merge pull request #76 from GeneralMagicio/feat/round-price-fetch-job
aminlatifi Oct 1, 2024
893e610
add cumulative donations to the round records
ae2079 Oct 1, 2024
c1b61cb
Merge pull request #72 from GeneralMagicio/ChangeInverterScriptToRunW…
ae2079 Oct 1, 2024
c0ddfa4
Merge pull request #77 from GeneralMagicio/AddCumulativeDonationAmounts
ae2079 Oct 1, 2024
a8a539c
remove flag for calculating donation amounts
ae2079 Oct 1, 2024
cbaa87d
update cumulative donation amounts in update round record method
ae2079 Oct 1, 2024
b106344
Merge pull request #78 from GeneralMagicio/fixCumulativeDonationAmount
aminlatifi Oct 1, 2024
351837f
Cached early access round after load query
aminlatifi Oct 1, 2024
ac0abf5
Disable cache in test env
aminlatifi Oct 1, 2024
7f53964
Initialize project round record if not exists
aminlatifi Oct 1, 2024
da0683d
Updated the tests according to update in the query
aminlatifi Oct 1, 2024
c5c9f07
Merge pull request #79 from GeneralMagicio/feat/cache-early-access-af…
aminlatifi Oct 1, 2024
c86b141
Merge pull request #80 from GeneralMagicio/fix/project-round-record-i…
aminlatifi Oct 1, 2024
fc9573b
Fixed log message
aminlatifi Oct 2, 2024
11966c4
Fixed issue in fill price query
aminlatifi Oct 2, 2024
e9b4104
Updated condition of active qf round
aminlatifi Oct 2, 2024
0e3575b
Updated test according to change
aminlatifi Oct 2, 2024
f768aa5
Fixed issue in test
aminlatifi Oct 2, 2024
ba7b269
Merge pull request #81 from GeneralMagicio/feat/change-qf-round-activ…
aminlatifi Oct 2, 2024
fa02159
All projects are particpated to qfRound
aminlatifi Oct 2, 2024
de17313
Merge branch 'staging' into feat/change-qf-round-active-rule
aminlatifi Oct 2, 2024
5efa395
Removed qfRound connection to projects in some tests
aminlatifi Oct 2, 2024
2135130
Merge pull request #82 from GeneralMagicio/feat/change-qf-round-activ…
aminlatifi Oct 2, 2024
6c26d39
Fixed build issue
aminlatifi Oct 2, 2024
3ab24ef
Fixed qf round user cap limit for ea donors
aminlatifi Oct 2, 2024
3fd8fb4
Merge pull request #83 from GeneralMagicio/fix/qacc-user-cap-limit
aminlatifi Oct 2, 2024
5a1f9fa
add new error messages
ae2079 Oct 2, 2024
bbb549f
throw error when round does not started
ae2079 Oct 2, 2024
69f32d1
fix tests
ae2079 Oct 2, 2024
8b73cb3
skip the failed tests for now
ae2079 Oct 2, 2024
7653628
Merge pull request #84 from GeneralMagicio/FixCumulativeAmountIssue
ae2079 Oct 2, 2024
3b2f20d
delete donations with early access rounds
ae2079 Oct 2, 2024
996e8c0
Merge pull request #85 from GeneralMagicio/fixQaccServiceTests
ae2079 Oct 3, 2024
b4f3d9d
remove redundant conditions
ae2079 Oct 3, 2024
49d29a3
Merge pull request #86 from GeneralMagicio/removeRedundantCondition
ae2079 Oct 3, 2024
5f52710
Fixed a message
aminlatifi Oct 3, 2024
a0630d6
Fixed issue in qf round project cap limit
aminlatifi Oct 6, 2024
efdd75a
Changed default tokenPrice
aminlatifi Oct 6, 2024
7eda067
Changed default token price in qAcc cap calculation
aminlatifi Oct 6, 2024
216c6c1
Did some refactoring
aminlatifi Oct 6, 2024
8ea981d
Added more tests
aminlatifi Oct 6, 2024
a051ec0
Merge pull request #87 from GeneralMagicio/fix/qf-round-project-cap
aminlatifi Oct 6, 2024
47d669c
Fixed cap issue
aminlatifi Oct 7, 2024
a02bf0e
Changed cumulativeCapPerProject query cache time
aminlatifi Oct 7, 2024
a1d9683
Merge pull request #88 from GeneralMagicio/fix/cap-issue
aminlatifi Oct 7, 2024
0acceb7
Added TYPEORM_DISABLE_SSL feature
aminlatifi Oct 8, 2024
5e20ed8
Renamed cumulativeCapPerProject to cumulativeUSDCapPerProject
aminlatifi Oct 8, 2024
26c7861
Updated qacc service according to qf round close cap
aminlatifi Oct 8, 2024
9799005
Update test according to changes
aminlatifi Oct 8, 2024
efba9c3
Merge pull request #89 from GeneralMagicio/feat/qf-round-close-cap
aminlatifi Oct 8, 2024
c85bc33
Updated test to check fraction support in donation value
aminlatifi Oct 8, 2024
e81d91e
Change update of create query of projectUserRecord
aminlatifi Oct 9, 2024
b710c3b
Updated updateOrCreateProjectUserRecord to single one
aminlatifi Oct 9, 2024
5a99251
Change query to single raw query
aminlatifi Oct 9, 2024
fa0f53f
Updated updateOrCreateProjectRoundRecord
aminlatifi Oct 9, 2024
24b26e1
Fixed default value initialization
aminlatifi Oct 9, 2024
55abe59
Merge pull request #90 from GeneralMagicio/feat/improve-queries
aminlatifi Oct 9, 2024
f78a19d
Merge branch 'main' into staging
geleeroyale Oct 9, 2024
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
Binary file removed .DS_Store
Binary file not shown.
5 changes: 3 additions & 2 deletions .github/workflows/main-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: givethio
POSTGRES_DB: qacc
PGDATA: /var/lib/postgresql/data/pgdata
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -119,7 +119,8 @@ jobs:
SOLANA_DEVNET_NODE_RPC_URL: ${{ secrets.SOLANA_DEVNET_NODE_RPC_URL }}
SOLANA_MAINNET_NODE_RPC_URL: ${{ secrets.SOLANA_MAINNET_NODE_RPC_URL }}
MPETH_GRAPHQL_PRICES_URL: ${{ secrets.MPETH_GRAPHQL_PRICES_URL }}

PRIVADO_VERIFIER_NETWORK_ID: ${{ secrets.PRIVADO_VERIFIER_NETWORK_ID }}

publish:
needs: test
runs-on: ubuntu-latest
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/staging-deploy-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: staging-deploy-only

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd QAcc-BE
git checkout staging
git pull
docker compose -f docker-compose-staging.yml pull
docker compose -f docker-compose-staging.yml up --force-recreate -d
docker image prune -a --force
23 changes: 23 additions & 0 deletions .github/workflows/staging-inverter-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run Inverter Sync Script

on:
schedule:
- cron: '0 0 * * 1' # Runs at midnight every Monday
workflow_dispatch: # This allows manual triggering

jobs:
run-script:
runs-on: ubuntu-latest

steps:
- name: SSH into Server and Run Inverter Sync Script
uses: appleboy/[email protected]
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd QAcc-BE
docker compose -f docker-compose-staging.yml exec qacc-be npm run sync:inverter:production
docker compose -f docker-compose-staging.yml logs qacc-be
5 changes: 3 additions & 2 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: givethio
POSTGRES_DB: qacc
PGDATA: /var/lib/postgresql/data/pgdata
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -119,6 +119,7 @@ jobs:
SOLANA_DEVNET_NODE_RPC_URL: ${{ secrets.SOLANA_DEVNET_NODE_RPC_URL }}
SOLANA_MAINNET_NODE_RPC_URL: ${{ secrets.SOLANA_MAINNET_NODE_RPC_URL }}
MPETH_GRAPHQL_PRICES_URL: ${{ secrets.MPETH_GRAPHQL_PRICES_URL }}
PRIVADO_VERIFIER_NETWORK_ID: ${{ secrets.PRIVADO_VERIFIER_NETWORK_ID }}

publish:
needs: test
Expand Down Expand Up @@ -161,4 +162,4 @@ jobs:
git pull
docker compose -f docker-compose-staging.yml pull
docker compose -f docker-compose-staging.yml up -d
docker image prune -a --force
docker image prune -a --force
9 changes: 1 addition & 8 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{$MY_URL} {
route {
@allowed {
path /*
remote_ip {$IP_WHITELIST}
}
reverse_proxy @allowed qacc-be:4000
respond 403
}
reverse_proxy qacc-be:4000
}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Impact Graph


---

### Build status
Expand Down Expand Up @@ -42,12 +41,12 @@ Edit the config/development.env file in your favorite code editor and the enviro

[Create a database](https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e) (we recommend Postgres) on your computer or server, we currently support for MySQL, MariaDB, Postgres, MongoDB and SQLite.
Or if you want, you can run the docker-compose like this:
`docker-compose -f docker-compose-local-postgres-redis.yml up -d`
`docker-compose -f docker-compose-local.yml --profile database up -d`
and put these to your `development.env`

```
TYPEORM_DATABASE_TYPE=postgres
TYPEORM_DATABASE_NAME=givethio
TYPEORM_DATABASE_NAME=qacc
TYPEORM_DATABASE_USER=postgres
TYPEORM_DATABASE_PASSWORD=postgres
TYPEORM_DATABASE_HOST=localhost
Expand Down
18 changes: 18 additions & 0 deletions config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,21 @@ ZKEVM_MAINNET_NODE_HTTP_URL=
ZKEVM_CARDONA_NODE_HTTP_URL=

ENDAOMENT_ADMIN_WALLET_ADDRESS=0xfE3524e04E4e564F9935D34bB5e80c5CaB07F5b4

ABC_LAUNCH_DB_CONNECTION_URL=

QACC_NETWORK_ID=
QACC_DONATION_TOKEN_ADDRESS=
QACC_DONATION_TOKEN_SYMBOL=
QACC_DONATION_TOKEN_NAME=
QACC_DONATION_TOKEN_DECIMALS=
QACC_EARLY_ACCESS_ROUND_FINISH_TIMESTAMP=
ABC_LAUNCHER_ADAPTER=

QACC_FETCH_ROUND_TOKEN_PRICE_CRONJOB_EXPRESSION

PRIVADO_VERIFIER_NETWORK_ID=
PRIVADO_VERIFIER_CONTRACT_ADDRESS=
PRIVADO_REQUEST_ID=

INVERTER_GRAPHQL_ENDPOINT=
15 changes: 13 additions & 2 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MAILER_JWT_SECRET=00000000000000000000000000000000000000000000000000000000000000
JWT_MAX_AGE=7d

TYPEORM_DATABASE_TYPE=postgres
TYPEORM_DATABASE_NAME=givethio
TYPEORM_DATABASE_NAME=qacc
TYPEORM_DATABASE_USER=postgres
TYPEORM_DATABASE_PASSWORD=postgres
TYPEORM_DATABASE_HOST=localhost
Expand Down Expand Up @@ -40,7 +40,7 @@ ETHERSCAN_ROPSTEN_API_URL=https://api-ropsten.etherscan.io/api
ETHERSCAN_GOERLI_API_URL=https://api-goerli.etherscan.io/api
POLYGON_SCAN_API_URL=https://api.polygonscan.com/api
OPTIMISTIC_SCAN_API_URL=https://api-optimistic.etherscan.io/api
OPTIMISTIC_SEPOLIA_SCAN_API_URL=https://api-sepolia-optimistic.etherscan.io/api
OPTIMISTIC_SEPOLIA_SCAN_API_URL=https://sepolia.optimism.io/
CELO_SCAN_API_URL=https://api.celoscan.io/api
CELO_ALFAJORES_SCAN_API_URL=https://api-alfajores.celoscan.io/api
ARBITRUM_SCAN_API_URL=https://api.arbiscan.io/api
Expand Down Expand Up @@ -220,3 +220,14 @@ ZKEVM_MAINNET_NODE_HTTP_URL=https://polygon-zkevm.drpc.org
ZKEVM_CARDONA_NODE_HTTP_URL=https://rpc.cardona.zkevm-rpc.com

ENDAOMENT_ADMIN_WALLET_ADDRESS=0xfE3524e04E4e564F9935D34bB5e80c5CaB07F5b4

ABC_LAUNCH_API_SECRET=
ABC_LAUNCH_API_URL=
ABC_LAUNCH_DATA_SOURCE=

PRIVADO_REQUEST_ID=111
PRIVADO_VERIFIER_NETWORK_ID=2442

INVERTER_GRAPHQL_ENDPOINT=https://indexer.bigdevenergy.link/a414bf3/v1/graphql

QACC_NETWORK_ID=11155420
48 changes: 44 additions & 4 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ services:
qacc-be:
container_name: qacc-be
build: .
profiles:
- server
command: npm run start:docker:locally
environment:
- ENVIRONMENT=local
Expand All @@ -11,12 +13,18 @@ services:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs:/usr/src/app/logs
networks:
- qacc
ports:
- "4001:4000"
- '4001:4000'

qacc-postgres:
container_name: qacc-postgres
image: postgres:16
profiles:
- server
- database
- local
restart: always
environment:
- POSTGRES_DB=qacc
Expand All @@ -25,20 +33,52 @@ services:
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- db-data:/var/lib/postgresql/data
networks:
- qacc
ports:
- "5432:5432"
- '5442:5432'

qacc-postgres-test:
container_name: qacc-postgres-test
image: postgres:16
profiles:
- test
- database
restart: always
environment:
- POSTGRES_DB=qacc
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- db-data-test:/var/lib/postgresql/data
networks:
- qacc
ports:
- '5443:5432'

qacc-redis:
container_name: qacc-redis
image: redis:7-alpine
profiles:
- server
- local
environment:
- REDIS_ALLOW_EMPTY_PASSWORD=yes
restart: always
volumes:
- redis-data:/data
networks:
- qacc
ports:
- "6379:6379"
- '6379:6379'

volumes:
db-data:
redis-data:
db-data-test:
redis-data:

networks:
qacc:
name: qacc-be
external: true
4 changes: 3 additions & 1 deletion docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ volumes:
caddy_data:

networks:
qacc:
qacc:
name: qacc-be_qacc
external: true
4 changes: 3 additions & 1 deletion docker-compose-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ volumes:
caddy_data:

networks:
qacc:
qacc:
name: qacc-be_qacc
external: true
8 changes: 7 additions & 1 deletion migration/1717646612482-ProjectActualMatchingView_V16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,11 @@ export class ProjectActualMatchingViewV161717646612482
`);
}

public async down(_queryRunner: QueryRunner): Promise<void> {}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`
DROP MATERIALIZED VIEW project_actual_matching_view;
`,
);
}
}
29 changes: 0 additions & 29 deletions migration/1723583534955-AddUserEmailVerificationFields.ts

This file was deleted.

45 changes: 45 additions & 0 deletions migration/1724143752405-EmailVerification.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class EmailVerification1724143752405 implements MigrationInterface {
name = 'EmailVerification1724143752405';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "user_email_verification" ("id" SERIAL NOT NULL, "userId" integer NOT NULL, "emailVerificationCode" text, "emailVerificationCodeExpiredAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_8ad3e54beb79f46d33950e9d487" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD "emailConfirmed" boolean NOT NULL DEFAULT false`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD "emailConfirmationSent" boolean NOT NULL DEFAULT false`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD "emailConfirmationSentAt" TIMESTAMP WITH TIME ZONE`,
);
await queryRunner.query(
`ALTER TABLE "user" ADD "emailConfirmedAt" TIMESTAMP WITH TIME ZONE`,
);
await queryRunner.query(
`ALTER TABLE "project" ADD "teaser" character varying`,
);
await queryRunner.query(`ALTER TABLE "project" ADD "teamMembers" jsonb`);
await queryRunner.query(`ALTER TABLE "project" ADD "abc" jsonb`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "abc"`);
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "teamMembers"`);
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "teaser"`);
await queryRunner.query(
`ALTER TABLE "user" DROP COLUMN "emailConfirmedAt"`,
);
await queryRunner.query(
`ALTER TABLE "user" DROP COLUMN "emailConfirmationSentAt"`,
);
await queryRunner.query(
`ALTER TABLE "user" DROP COLUMN "emailConfirmationSent"`,
);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "emailConfirmed"`);
await queryRunner.query(`DROP TABLE "user_email_verification"`);
}
}
19 changes: 19 additions & 0 deletions migration/1724231548035-ProjectIcon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ProjectIcon1724231548035 implements MigrationInterface {
name = 'ProjectIcon1724231548035';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "project" ADD "icon" character varying`,
);
await queryRunner.query(
`ALTER TABLE "project_update" ADD "icon" character varying`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "project_update" DROP COLUMN "icon"`);
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "icon"`);
}
}
Loading
Loading