-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add base chain #1579
Add base chain #1579
Conversation
#1573) * Ignore small differences of amounts when matching draft donation for erc20 * Fix eslint errors
* add activeQfRoundId to sortingBy InstantBoosting * add orderBy totalDonations and totalReactions * feat: add getRecurringDonationStats resolver * fix filtering by QF * remove qfRounds joins for non qf round filters * add some temp logs * remove temp logs * fix: changes test cases of recuring donations stats - create recored with createdAt field in past so test result won't be related to other endpoints test cases * Fix projectActualserviceView * fix stream balance depleted issue (#1496) Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * rebuild * refresh and fetch user address separately (#1499) * Added pg_trgm extension migration (#1502) * fix: change recurring donations stats query to single query * fix recurring donation count * WIP: projectIds textArea * fix actual matching cap (#1507) * fix query error * fix user donations count * fix recurring donation count tests * fix user recurring donation query * fix user recurring donation test * add donations relation to qfround * add findArchivedQfRounds endpoint * add findArchivedQfRounds endpoint * feat: add sponsors & banner images upload * add sortBy to findArchivedQfRounds * 1.23.3 * add new test graphql query * add tests for new QfArchivedRounds * fixes on qfArchivedRounds query * add new tests for qfArchivedRounds query * fix findArchivedQfRounds tests * fix: keep already uploaded sponsors images * fix skip and limit for findArchivedQfRounds * Add logs and refactor the bootstrap code to help investigate latency problem * Add poolSize to orm config * Fix eslint errors * remove changing squareRootSumOfProjects when cap is overflown * Trigger ortto activity when user saves their profile info for the first time (#1520) * add newUser to updateUser query * add createOrttoProfile * add createOrttoProfile to NotificationAdapterInterface * add createOrttoProfile to MockNotificationAdapter * add CREATE_ORTTO_PROFILE event * Allow to set the matching pool token & amount to be something other than usd (#1517) * Allow to set the matching pool token & amount to be something other than USD in adminjs * Allow to set the matching pool token & amount to be something other than USD in QFRound table * add null to allocatedTokenSymbol and allocatedTokenChainId * add nullable true to allocatedTokenSymbol and allocatedTokenChainId * add allocatedFundUSDPreferred and allocatedFundUSD to qfRound * Comment migrations * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * add qfRound to qfRoundStats * fix qfRoundStatsQuery * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add logs to projectVerificationForm * Add logs to projectVerificationForm * fix: add project Ids list textarea for qf round edit * Master to staging (#1543) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * Fix/word similarity - staging (#1546) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> * Fixed word similarity issue * Removed unused import --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * remove refresh_project_summary_from totals and add user cache (#1539) * Remove users field from project * Remove users field from filterProjectsQuery * Remove projects field from user * remove added logs * fix eslint errors * remove users from Project.create * remove users from Project.create in testUtils.ts * remove projectOwnerId * replace admin with adminUserId * Add recurring donation join to donations() endpoint (#1554) related to #1483 * replace admin with adminUserId in SEED data * replace admin with adminUserId * replace admin with adminUserId in projectResolver.ts * replace admin with adminUserId in projectsTab.ts * replace admin with adminUserId in projectResolver.test.ts * replace admin with adminUserId in projectResolver.ts * add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds * fix nullable * remove admin from project * replace admin with adminUserId * replace admin with adminUserId * add adminUserId field * drop admin column * fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url * Add some logs * Fix eslint errors * Add maxQueuedJobs for draft donation worker * Fix eslint errors * fix unstable test case * Disable concurrency for draft donation worker * add indexes to project_summary_view (#1568) * improve projectBySlug query * fix: change output types to float * Ignore small differences of amounts when matching draft donation for erc20 * add graphql-fields * add getVerificationFormStatusByProjectId * refactor projectBySlug * add findProjectIdBySlug * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * remove projectVerificationForm assert * add logs * fix title in should return projects with indicated slug test * Add streamed mini donations to qf round (#1557) * Add streamed mini donations to qf round related to Giveth/giveth-dapps-v2#3284 * Fix eslint error * Fix eslint errors * make verificationFormStatus field public * Reduce test runnning time (#1574) * fix: reduce test runnning time * fix: add permissions test case * fix: add permissions test case * fix: refactor (excluding permissions test cases from global beforeEach) --------- Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com> Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com>
WalkthroughThe updates primarily introduce support for Base Mainnet and Base Sepolia networks across various components, including environment configurations, migration scripts, and test cases. These changes ensure that the system can handle new network IDs, API keys, and URLs, and include the necessary logic for token management and project filtering based on these networks. Changes
Tip New Features and ImprovementsReview SettingsIntroduced new personality profiles for code reviews. Users can now select between "Chill" and "Assertive" review tones to tailor feedback styles according to their preferences. The "Assertive" profile posts more comments and nitpicks the code more aggressively, while the "Chill" profile is more relaxed and posts fewer comments. AST-based InstructionsCodeRabbit offers customizing reviews based on the Abstract Syntax Tree (AST) pattern matching. Read more about AST-based instructions in the documentation. Community-driven AST-based RulesWe are kicking off a community-driven initiative to create and share AST-based rules. Users can now contribute their AST-based rules to detect security vulnerabilities, code smells, and anti-patterns. Please see the ast-grep-essentials repository for more information. New Static Analysis ToolsWe are continually expanding our support for static analysis tools. We have added support for Tone SettingsUsers can now customize CodeRabbit to review code in the style of their favorite characters or personalities. Here are some of our favorite examples:
Revamped Settings PageWe have redesigned the settings page for a more intuitive layout, enabling users to find and adjust settings quickly. This change was long overdue; it not only improves the user experience but also allows our development team to add more settings in the future with ease. Going forward, the changes to Miscellaneous
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (21)
- .github/workflows/develop-pipeline.yml (1 hunks)
- .github/workflows/master-pipeline.yml (1 hunks)
- .github/workflows/staging-pipeline.yml (1 hunks)
- config/example.env (1 hunks)
- config/test.env (1 hunks)
- migration/1716367359560-add_base_chain_tokens.ts (1 hunks)
- migration/data/seedTokens.ts (1 hunks)
- src/entities/project.ts (1 hunks)
- src/provider.ts (2 hunks)
- src/resolvers/donationResolver.test.ts (1 hunks)
- src/resolvers/projectResolver.ts (1 hunks)
- src/resolvers/projectVerificationFormResolver.test.ts (1 hunks)
- src/server/adminJs/tabs/donationTab.ts (1 hunks)
- src/server/adminJs/tabs/qfRoundTab.ts (1 hunks)
- src/server/adminJs/tabs/tokenTab.ts (1 hunks)
- src/services/chains/index.test.ts (1 hunks)
- src/utils/networksConfig.ts (1 hunks)
- src/utils/validators/graphqlQueryValidators.ts (1 hunks)
- src/utils/validators/projectValidator.ts (1 hunks)
- test/pre-test-scripts.ts (1 hunks)
- test/testUtils.ts (1 hunks)
Files skipped from review due to trivial changes (8)
- .github/workflows/develop-pipeline.yml
- .github/workflows/master-pipeline.yml
- .github/workflows/staging-pipeline.yml
- migration/data/seedTokens.ts
- src/entities/project.ts
- src/resolvers/donationResolver.test.ts
- src/resolvers/projectVerificationFormResolver.test.ts
- src/utils/validators/graphqlQueryValidators.ts
Additional comments not posted (13)
src/utils/networksConfig.ts (1)
40-41
: The addition of BASE_MAINNET and BASE_SEPOLIA network configurations is correctly implemented.src/utils/validators/projectValidator.ts (1)
144-145
: The addition of BASE_MAINNET and BASE_SEPOLIA to the network IDs for smart contract validation is correctly implemented.config/test.env (1)
51-54
: The addition of environment variables for BASE_SCAN and BASE_SEPOLIA is correctly implemented.src/server/adminJs/tabs/tokenTab.ts (1)
200-201
: The addition of BASE_MAINNET and BASE_SEPOLIA to the network options in the admin interface is correctly implemented.config/example.env (1)
311-314
: The addition of environment variables for BASE_SCAN and BASE_SEPOLIA in the example configuration is correctly implemented.src/server/adminJs/tabs/qfRoundTab.ts (1)
124-125
: The addition of BASE_MAINNET and BASE_SEPOLIA to the network values is correctly implemented.src/provider.ts (1)
24-26
: The addition of BASE_MAINNET and BASE_SEPOLIA network IDs and their API URL configurations is correctly implemented.Also applies to: 404-411
test/pre-test-scripts.ts (1)
188-215
: The addition of seeding logic for BASE_MAINNET and BASE_SEPOLIA tokens is correctly implemented.src/server/adminJs/tabs/donationTab.ts (1)
606-607
: The addition ofBASE_MAINNET
andBASE_SEPOLIA
to the network options in the donation tab is correctly implemented.src/services/chains/index.test.ts (2)
543-560
: The test case for BASE_MAINNET is correctly implemented and aligns with the PR objectives.
562-579
: The test case for BASE_SEPOLIA is correctly implemented and aligns with the PR objectives.test/testUtils.ts (1)
1735-1752
: Addition ofbase_mainnet
andbase_sepolia
network configurations.The addition of these network configurations aligns with the PR's objective to support new networks. Ensure that these configurations are utilized appropriately in tests and other relevant parts of the application.
src/resolvers/projectResolver.ts (1)
530-533
: The addition ofFilterField.AcceptFundOnBase
with handling forBASE_MAINNET
andBASE_SEPOLIA
network IDs is correctly implemented.
public async down(_queryRunner: QueryRunner): Promise<void> { | ||
// | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing a rollback mechanism in the down
method to reverse the changes made by the up
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range and nitpick comments (2)
src/resolvers/donationResolver.test.ts (2)
Line range hint
809-813
: Consider usingfor...of
instead offorEach
for better performance and readability.- result.data.data.donationsFromWallets.forEach(item => { + for (const item of result.data.data.donationsFromWallets) { assert.equal(item.fromWalletAddress, walletAddress); assert.isNotOk(item.user.email); assert.isOk(item.user.walletAddress); - }); + }Also applies to: 884-886, 894-896, 2836-2840, 2862-2866, 2897-2904, 3023-3025, 3046-3048, 3072-3076, 3280-3282, 3321-3323, 3369-3371, 3417-3419, 3700-3702, 3917-3919
Line range hint
1891-1891
: Avoid using non-null assertions as they can lead to runtime errors if assumptions about non-nullability are incorrect.Consider adding null checks or handling potential null values gracefully.
Also applies to: 1919-1919, 1948-1948, 1977-1977, 2009-2009
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- migration/1716367359560-add_base_chain_tokens.ts (1 hunks)
- migration/data/seedTokens.ts (1 hunks)
- package.json (2 hunks)
- src/resolvers/donationResolver.test.ts (1 hunks)
- src/resolvers/projectResolver.allProject.test.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- migration/data/seedTokens.ts
Additional Context Used
Biome (42)
migration/1716367359560-add_base_chain_tokens.ts (2)
25-25: Avoid the delete operator which can impact performance.
1-1: All these imports are only used as types.
src/resolvers/donationResolver.test.ts (20)
809-813: Prefer for...of instead of forEach.
884-886: Prefer for...of instead of forEach.
894-896: Prefer for...of instead of forEach.
1891-1891: Forbidden non-null assertion.
1919-1919: Forbidden non-null assertion.
1948-1948: Forbidden non-null assertion.
1977-1977: Forbidden non-null assertion.
2009-2009: Forbidden non-null assertion.
2836-2840: Prefer for...of instead of forEach.
2862-2866: Prefer for...of instead of forEach.
2897-2904: Prefer for...of instead of forEach.
3023-3025: Prefer for...of instead of forEach.
3046-3048: Prefer for...of instead of forEach.
3072-3076: Prefer for...of instead of forEach.
3280-3282: Prefer for...of instead of forEach.
3321-3323: Prefer for...of instead of forEach.
3369-3371: Prefer for...of instead of forEach.
3417-3419: Prefer for...of instead of forEach.
3700-3702: Prefer for...of instead of forEach.
3917-3919: Prefer for...of instead of forEach.
src/resolvers/projectResolver.allProject.test.ts (20)
67-81: Prefer for...of instead of forEach.
134-138: Prefer for...of instead of forEach.
227-229: Prefer for...of instead of forEach.
244-247: Prefer for...of instead of forEach.
294-296: Prefer for...of instead of forEach.
312-314: Prefer for...of instead of forEach.
660-664: Prefer for...of instead of forEach.
678-684: Prefer for...of instead of forEach.
703-714: Prefer for...of instead of forEach.
736-745: Prefer for...of instead of forEach.
767-776: Prefer for...of instead of forEach.
797-807: Prefer for...of instead of forEach.
837-847: Prefer for...of instead of forEach.
874-883: Prefer for...of instead of forEach.
904-914: Prefer for...of instead of forEach.
943-953: Prefer for...of instead of forEach.
981-990: Prefer for...of instead of forEach.
1011-1021: Prefer for...of instead of forEach.
1050-1060: Prefer for...of instead of forEach.
1087-1097: Prefer for...of instead of forEach.
GitHub Check Runs (1)
test failure (6)
src/resolvers/projectResolver.allProject.test.ts: [failure] 966-966:
Delete⏎
Additional comments not posted (2)
migration/1716367359560-add_base_chain_tokens.ts (1)
52-54
: Duplicate comment: Consider implementing a rollback mechanism in thedown
method to reverse the changes made by theup
method.package.json (1)
148-148
: Updated test scripts to include new functionality.The addition of new test scripts for
projectResolver
andgivpower
ensures that the new functionality is adequately tested. This is a good practice to maintain the quality and stability of the application.Also applies to: 195-195
@@ -964,6 +963,113 @@ | |||
); | |||
}); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary newline.
- ⏎
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export class AddBaseChainTokens1716367359560 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const environment = config.get('ENVIRONMENT') as string; | ||
|
||
const networkId = | ||
environment === 'production' | ||
? NETWORK_IDS.BASE_MAINNET | ||
: NETWORK_IDS.BASE_SEPOLIA; | ||
|
||
await queryRunner.manager.save( | ||
Token, | ||
seedTokens | ||
.filter(token => token.networkId === networkId) | ||
.map(token => { | ||
const t = { | ||
...token, | ||
}; | ||
t.address = t.address?.toLowerCase(); | ||
delete t.chainType; | ||
return t; | ||
}), | ||
); | ||
const tokens = await queryRunner.query(` | ||
SELECT * FROM token | ||
WHERE "networkId" = ${networkId} | ||
`); | ||
const givethOrganization = ( | ||
await queryRunner.query(`SELECT * FROM organization | ||
WHERE label='giveth'`) | ||
)[0]; | ||
|
||
const traceOrganization = ( | ||
await queryRunner.query(`SELECT * FROM organization | ||
WHERE label='trace'`) | ||
)[0]; | ||
|
||
for (const token of tokens) { | ||
// Add all Base tokens to Giveth organization | ||
await queryRunner.query(`INSERT INTO organization_tokens_token ("tokenId","organizationId") VALUES | ||
(${token.id}, ${givethOrganization.id}), | ||
(${token.id}, ${traceOrganization.id}) | ||
;`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure proper transaction handling in the up
method.
Consider wrapping the database operations within a transaction to ensure atomicity. This is crucial for maintaining data integrity, especially in production environments.
+ await queryRunner.startTransaction();
try {
// existing code...
+ await queryRunner.commitTransaction();
} catch (error) {
+ await queryRunner.rollbackTransaction();
throw error;
}
Committable suggestion was skipped due low confidence.
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA), | ||
), | ||
); | ||
}); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(savedProject.id), | ||
), | ||
); | ||
}); | ||
it('should return projects, filter by accept donation on base', async () => { | ||
const savedProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA) && | ||
address.chainType === ChainType.EVM, | ||
), | ||
); | ||
}); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(savedProject.id), | ||
), | ||
); | ||
}); | ||
it('should return projects, filter by accept donation on base, not return when it doesnt have base address', async () => { | ||
const baseProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const polygonProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.POLYGON, | ||
}); | ||
|
||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
|
||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA) && | ||
address.chainType === ChainType.EVM, | ||
), | ||
); | ||
}); | ||
assert.isNotOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(polygonProject.id), | ||
), | ||
); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(baseProject.id), | ||
), | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor to use for...of
for better readability and performance.
- result.data.data.allProjects.projects.forEach(project => {
+ for (const project of result.data.data.allProjects.projects) {
assert.isOk(
project.addresses.find(
address =>
address.isRecipient === true &&
(address.networkId === NETWORK_IDS.BASE_MAINNET ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA) &&
address.chainType === ChainType.EVM,
),
);
- });
+ }
Committable suggestion was skipped due low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
src/resolvers/projectResolver.allProject.test.ts (1)
Line range hint
67-81
: Optimize iteration by usingfor...of
instead offorEach
.The use of
forEach
for iterating over arrays can be less performant and less flexible compared tofor...of
. Consider refactoring these to usefor...of
loops, which are generally more idiomatic in modern JavaScript for handling synchronous iteration scenarios.- result.data.data.allProjects.projects.forEach(project => { ... }); + for (const project of result.data.data.allProjects.projects) { ... }Also applies to: 134-138, 227-229, 244-247, 294-296, 312-314, 660-664, 678-684, 703-714, 736-745, 767-776, 797-807, 837-847, 874-883, 904-914, 943-953, 980-989, 1010-1020, 1049-1059, 1086-1096
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- config/example.env (1 hunks)
- src/provider.ts (3 hunks)
- src/resolvers/projectResolver.allProject.test.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- config/example.env
Additional Context Used
Biome (25)
src/provider.ts (5)
274-274: Template literals are preferred over string concatenation.
278-278: This variable implicitly has the any type.
279-279: This variable implicitly has the any type.
363-363: This variable implicitly has the any type.
364-364: This variable implicitly has the any type.
src/resolvers/projectResolver.allProject.test.ts (20)
67-81: Prefer for...of instead of forEach.
134-138: Prefer for...of instead of forEach.
227-229: Prefer for...of instead of forEach.
244-247: Prefer for...of instead of forEach.
294-296: Prefer for...of instead of forEach.
312-314: Prefer for...of instead of forEach.
660-664: Prefer for...of instead of forEach.
678-684: Prefer for...of instead of forEach.
703-714: Prefer for...of instead of forEach.
736-745: Prefer for...of instead of forEach.
767-776: Prefer for...of instead of forEach.
797-807: Prefer for...of instead of forEach.
837-847: Prefer for...of instead of forEach.
874-883: Prefer for...of instead of forEach.
904-914: Prefer for...of instead of forEach.
943-953: Prefer for...of instead of forEach.
980-989: Prefer for...of instead of forEach.
1010-1020: Prefer for...of instead of forEach.
1049-1059: Prefer for...of instead of forEach.
1086-1096: Prefer for...of instead of forEach.
Additional comments not posted (3)
src/provider.ts (3)
24-25
: The addition ofBASE_MAINNET
andBASE_SEPOLIA
toNETWORK_IDS
aligns with the PR's objectives to support these networks.
416-423
: The addition ofBASE_MAINNET
andBASE_SEPOLIA
cases ingetBlockExplorerApiUrl
function is correctly implemented and aligns with the PR's objectives.
325-335
: The addition ofBASE_MAINNET
andBASE_SEPOLIA
cases ingetProvider
function is correctly implemented. Consider using template literals for URL construction to improve readability.- `https://base-mainnet.infura.io/v3/${INFURA_ID}`; + `https://base-mainnet.infura.io/v3/${INFURA_ID}`; - `https://base-sepolia.infura.io/v3/${INFURA_ID}`; + `https://base-sepolia.infura.io/v3/${INFURA_ID}`;Likely invalid or redundant comment.
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA), | ||
), | ||
); | ||
}); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(savedProject.id), | ||
), | ||
); | ||
}); | ||
it('should return projects, filter by accept donation on base', async () => { | ||
const savedProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA) && | ||
address.chainType === ChainType.EVM, | ||
), | ||
); | ||
}); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(savedProject.id), | ||
), | ||
); | ||
}); | ||
it('should return projects, filter by accept donation on base, not return when it doesnt have base address', async () => { | ||
const baseProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.BASE_MAINNET, | ||
}); | ||
const polygonProject = await saveProjectDirectlyToDb({ | ||
...createProjectData(), | ||
title: String(new Date().getTime()), | ||
slug: String(new Date().getTime()), | ||
networkId: NETWORK_IDS.POLYGON, | ||
}); | ||
|
||
const result = await axios.post(graphqlUrl, { | ||
query: fetchMultiFilterAllProjectsQuery, | ||
variables: { | ||
filters: ['AcceptFundOnBase'], | ||
sortingBy: SortingField.Newest, | ||
}, | ||
}); | ||
|
||
result.data.data.allProjects.projects.forEach(project => { | ||
assert.isOk( | ||
project.addresses.find( | ||
address => | ||
address.isRecipient === true && | ||
(address.networkId === NETWORK_IDS.BASE_MAINNET || | ||
address.networkId === NETWORK_IDS.BASE_SEPOLIA) && | ||
address.chainType === ChainType.EVM, | ||
), | ||
); | ||
}); | ||
assert.isNotOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(polygonProject.id), | ||
), | ||
); | ||
assert.isOk( | ||
result.data.data.allProjects.projects.find( | ||
project => Number(project.id) === Number(baseProject.id), | ||
), | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor repeated test cases for better maintainability.
The test cases for filtering by 'AcceptFundOnBase' are repeated three times with slight variations. Consider refactoring these into a single parameterized test function to reduce code duplication and improve maintainability.
- it('should return projects, filter by accept donation on base', async () => { ... });
- it('should return projects, filter by accept donation on base', async () => { ... });
- it('should return projects, filter by accept donation on base, not return when it doesnt have base address', async () => { ... });
+ function testAcceptDonationOnBase(description, setup, assertCondition) {
+ it(description, async () => {
+ await setup();
+ const result = await axios.post(graphqlUrl, {
+ query: fetchMultiFilterAllProjectsQuery,
+ variables: {
+ filters: ['AcceptFundOnBase'],
+ sortingBy: SortingField.Newest,
+ },
+ });
+ result.data.data.allProjects.projects.forEach(project => {
+ assertCondition(project);
+ });
+ });
+ }
+ testAcceptDonationOnBase('should return projects, filter by accept donation on base', async () => {
+ await saveProjectDirectlyToDb({ ...createProjectData(), title: String(new Date().getTime()), slug: String(new Date().getTime()), networkId: NETWORK_IDS.BASE_MAINNET });
+ }, project => {
+ assert.isOk(project.addresses.find(address => address.isRecipient === true && (address.networkId === NETWORK_IDS.BASE_MAINNET || address.networkId === NETWORK_IDS.BASE_SEPOLIA) && address.chainType === ChainType.EVM));
+ });
Committable suggestion was skipped due low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
src/provider.ts (2)
Line range hint
297-297
: Prefer template literals over string concatenation.- 'impact-graph-' + SERVICE_NAME || 'unnamed'; + `impact-graph-${SERVICE_NAME || 'unnamed'}`;This change enhances readability and is more aligned with modern JavaScript practices.
Line range hint
301-302
: Implicit 'any' type for variables.Variables
url
andoptions
in thegetProvider
function are implicitly typed as 'any'. It's recommended to explicitly define types to improve code robustness and maintainability.- let url; - let options; + let url: string; + let options: { name: string; chainId: number; };Also applies to: 386-387
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/provider.ts (8 hunks)
Additional Context Used
Biome (5)
src/provider.ts (5)
297-297: Template literals are preferred over string concatenation.
301-301: This variable implicitly has the any type.
302-302: This variable implicitly has the any type.
386-386: This variable implicitly has the any type.
387-387: This variable implicitly has the any type.
Additional comments not posted (6)
src/provider.ts (6)
25-27
: Addition of BASE_MAINNET and BASE_SEPOLIA to NETWORK_IDS.This addition aligns with the PR's objective to support new networks. Ensure that these IDs are consistent with external documentation or specifications.
161-162
: Addition of BASE_MAINNET and BASE_SEPOLIA to NETWORK_NAMES.The naming convention used here is consistent with existing entries. This helps in maintaining uniformity across the codebase.
180-181
: Addition of BASE_MAINNET and BASE_SEPOLIA to NETWORK_NATIVE_TOKENS.Correctly setting the native token for these networks to 'ETH' is crucial for accurate network operations and integrations.
256-264
: Addition of BASE_MAINNET and BASE_SEPOLIA to networkNativeTokensList.This ensures that the new networks are properly recognized and handled within the system. It's important to verify that these entries are used consistently throughout the application.
348-358
: Proper configuration of network URLs for BASE_MAINNET and BASE_SEPOLIA.The use of environment variables for network URLs is a good practice, allowing for flexibility and configuration changes without code modifications.
439-446
: Configuration of API URLs and keys for BASE_MAINNET and BASE_SEPOLIA.Properly configuring these API details is essential for interacting with the respective block explorers. Ensure that these keys are securely managed and not exposed in public repositories.
related to #1564
related to #1561
@Meriem-BM The PR is now ready for review, you can test it locally on your system as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (5)
src/server/adminJs/tabs/tokenTab.ts (5)
Line range hint
92-92
: Avoid using non-null assertions.Non-null assertions can lead to runtime errors if the assumptions about non-nullability prove incorrect. Consider adding proper null checks or handling potential null values gracefully.
Also applies to: 101-101, 104-104
Line range hint
116-116
: Avoid unnecessary template literals.- `DELETE FROM organization_tokens_token WHERE "tokenId" = ${token!.id}` + 'DELETE FROM organization_tokens_token WHERE "tokenId" = ' + token!.idUsing simple concatenation here avoids the overhead of template literals when not needed.
Line range hint
118-118
: Specify explicit types instead of usingany
.Using
any
type defeats the purpose of TypeScript's static typing. It's safer and more maintainable to use specific types.Also applies to: 166-166, 167-167
Line range hint
276-291
: Preferfor...of
overforEach
for better readability and performance.- Object.keys(request?.payload).forEach(key => { + for (const key of Object.keys(request?.payload)) { if (key.includes('organizations.')) { delete request?.payload[key]; } }Using
for...of
allows for easier control flow management, such as breaking out of the loop if needed.
Line range hint
1-2
: Optimize imports used only as types.Consider importing these entities using
import type
to make it clear that they are only used for type checking and not included in the JavaScript output.Also applies to: 5-6
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- migration/data/seedTokens.ts (2 hunks)
- src/server/adminJs/tabs/tokenTab.ts (3 hunks)
Additional Context Used
Biome (10)
src/server/adminJs/tabs/tokenTab.ts (10)
92-92: Forbidden non-null assertion.
101-101: Forbidden non-null assertion.
104-104: Forbidden non-null assertion.
116-116: Do not use template literals if interpolation and special-character handling are not needed.
118-118: This variable implicitly has the any type.
166-166: Unexpected any. Specify a different type.
167-167: Unexpected any. Specify a different type.
276-291: Prefer for...of instead of forEach.
1-2: All these imports are only used as types.
5-6: All these imports are only used as types.
Additional comments not posted (3)
src/server/adminJs/tabs/tokenTab.ts (1)
202-203
: Added support forBASE_MAINNET
andBASE_SEPOLIA
in the network options.This addition aligns with the PR's objective to integrate new network configurations. Ensure that these new network IDs are consistently used across all relevant parts of the application.
migration/data/seedTokens.ts (2)
1598-1616
: Added new token entries for BASE Sepolia and BASE Mainnet.These additions align with the PR's objective to integrate new network configurations for
BASE_MAINNET
andBASE_SEPOLIA
. The properties such asname
,symbol
,address
,decimals
,networkId
,coingeckoId
, andisGivbackEligible
are correctly set according to the network specifications.
1618-1872
: Extended token entries for BASE Mainnet with various tokens.The detailed entries for tokens like
USDC
,Dai Stablecoin
,Rocket Pool ETH
, and others are well-defined with appropriate properties includingname
,symbol
,address
,decimals
,networkId
,coingeckoId
,isGivbackEligible
, andisStableCoin
where applicable. This comprehensive addition supports the integration of BASE Mainnet into the system.
* add activeQfRoundId to sortingBy InstantBoosting * add orderBy totalDonations and totalReactions * feat: add getRecurringDonationStats resolver * fix filtering by QF * remove qfRounds joins for non qf round filters * add some temp logs * remove temp logs * fix: changes test cases of recuring donations stats - create recored with createdAt field in past so test result won't be related to other endpoints test cases * Fix projectActualserviceView * fix stream balance depleted issue (#1496) Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * rebuild * refresh and fetch user address separately (#1499) * Added pg_trgm extension migration (#1502) * fix: change recurring donations stats query to single query * fix recurring donation count * WIP: projectIds textArea * fix actual matching cap (#1507) * fix query error * fix user donations count * fix recurring donation count tests * fix user recurring donation query * fix user recurring donation test * add donations relation to qfround * add findArchivedQfRounds endpoint * add findArchivedQfRounds endpoint * feat: add sponsors & banner images upload * add sortBy to findArchivedQfRounds * 1.23.3 * add new test graphql query * add tests for new QfArchivedRounds * fixes on qfArchivedRounds query * add new tests for qfArchivedRounds query * fix findArchivedQfRounds tests * fix: keep already uploaded sponsors images * fix skip and limit for findArchivedQfRounds * Add logs and refactor the bootstrap code to help investigate latency problem * Add poolSize to orm config * Fix eslint errors * remove changing squareRootSumOfProjects when cap is overflown * Trigger ortto activity when user saves their profile info for the first time (#1520) * add newUser to updateUser query * add createOrttoProfile * add createOrttoProfile to NotificationAdapterInterface * add createOrttoProfile to MockNotificationAdapter * add CREATE_ORTTO_PROFILE event * Allow to set the matching pool token & amount to be something other than usd (#1517) * Allow to set the matching pool token & amount to be something other than USD in adminjs * Allow to set the matching pool token & amount to be something other than USD in QFRound table * add null to allocatedTokenSymbol and allocatedTokenChainId * add nullable true to allocatedTokenSymbol and allocatedTokenChainId * add allocatedFundUSDPreferred and allocatedFundUSD to qfRound * Comment migrations * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * add qfRound to qfRoundStats * fix qfRoundStatsQuery * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add logs to projectVerificationForm * Add logs to projectVerificationForm * fix: add project Ids list textarea for qf round edit * Master to staging (#1543) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * Fix/word similarity - staging (#1546) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> * Fixed word similarity issue * Removed unused import --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * remove refresh_project_summary_from totals and add user cache (#1539) * Remove users field from project * Remove users field from filterProjectsQuery * Remove projects field from user * remove added logs * fix eslint errors * remove users from Project.create * remove users from Project.create in testUtils.ts * remove projectOwnerId * replace admin with adminUserId * Add recurring donation join to donations() endpoint (#1554) related to #1483 * replace admin with adminUserId in SEED data * replace admin with adminUserId * replace admin with adminUserId in projectResolver.ts * replace admin with adminUserId in projectsTab.ts * replace admin with adminUserId in projectResolver.test.ts * replace admin with adminUserId in projectResolver.ts * add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds * fix nullable * remove admin from project * replace admin with adminUserId * replace admin with adminUserId * add adminUserId field * drop admin column * Implementing read-only node replica in local * fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url * Add some logs * Fix eslint errors * Add maxQueuedJobs for draft donation worker * Fix eslint errors * fix unstable test case * Disable concurrency for draft donation worker * add indexes to project_summary_view (#1568) * improve projectBySlug query * fix: change output types to float * Ignore small differences of amounts when matching draft donation for erc20 * add graphql-fields * add getVerificationFormStatusByProjectId * refactor projectBySlug * add findProjectIdBySlug * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * remove projectVerificationForm assert * add logs * fix title in should return projects with indicated slug test * Add streamed mini donations to qf round (#1557) * Add streamed mini donations to qf round related to Giveth/giveth-dapps-v2#3284 * Fix eslint error * Fix eslint errors * make verificationFormStatus field public * Reduce test runnning time (#1574) * fix: reduce test runnning time * fix: add permissions test case * fix: add permissions test case * fix: refactor (excluding permissions test cases from global beforeEach) * add migration and columns for totals in project entity (#1571) * add migration and columns for totals in project entity * add service to update project totals * add filling the value for new fields * WIP add base network * add word similarity to search * fix word similarity test case * add defaultMode to replication * Continue on integrating with base chain * Fix migrations * Fix migrations * optimize projectById * add passport score to streams minidonations * Add methods for adding matching to totals usd received (#1582) * add methods for adding matching to totals usd received * Update src/repositories/qfRoundHistoryRepository.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * add coalesce to get 0 always incase null total matching * Add test cases about filteriing base network * Add BASE node http urls for rpc * Add BASE node http urls for rpc * Add missing things for integrating with base * merge stage * Limit characters of each cell to less than 5000 characters * Fix eslint errors * Fix creating new token with coingeckoId related to #1564 * Fill base mainnet tokens related to #1561 * optimize qfRounds query * Add base chain (#1579) * Ignore small differences of amounts when matching draft donation for … (#1573) * Ignore small differences of amounts when matching draft donation for erc20 * Fix eslint errors * Release Integrate QF with super fluid streamed donations (#1555) * add activeQfRoundId to sortingBy InstantBoosting * add orderBy totalDonations and totalReactions * feat: add getRecurringDonationStats resolver * fix filtering by QF * remove qfRounds joins for non qf round filters * add some temp logs * remove temp logs * fix: changes test cases of recuring donations stats - create recored with createdAt field in past so test result won't be related to other endpoints test cases * Fix projectActualserviceView * fix stream balance depleted issue (#1496) Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * rebuild * refresh and fetch user address separately (#1499) * Added pg_trgm extension migration (#1502) * fix: change recurring donations stats query to single query * fix recurring donation count * WIP: projectIds textArea * fix actual matching cap (#1507) * fix query error * fix user donations count * fix recurring donation count tests * fix user recurring donation query * fix user recurring donation test * add donations relation to qfround * add findArchivedQfRounds endpoint * add findArchivedQfRounds endpoint * feat: add sponsors & banner images upload * add sortBy to findArchivedQfRounds * 1.23.3 * add new test graphql query * add tests for new QfArchivedRounds * fixes on qfArchivedRounds query * add new tests for qfArchivedRounds query * fix findArchivedQfRounds tests * fix: keep already uploaded sponsors images * fix skip and limit for findArchivedQfRounds * Add logs and refactor the bootstrap code to help investigate latency problem * Add poolSize to orm config * Fix eslint errors * remove changing squareRootSumOfProjects when cap is overflown * Trigger ortto activity when user saves their profile info for the first time (#1520) * add newUser to updateUser query * add createOrttoProfile * add createOrttoProfile to NotificationAdapterInterface * add createOrttoProfile to MockNotificationAdapter * add CREATE_ORTTO_PROFILE event * Allow to set the matching pool token & amount to be something other than usd (#1517) * Allow to set the matching pool token & amount to be something other than USD in adminjs * Allow to set the matching pool token & amount to be something other than USD in QFRound table * add null to allocatedTokenSymbol and allocatedTokenChainId * add nullable true to allocatedTokenSymbol and allocatedTokenChainId * add allocatedFundUSDPreferred and allocatedFundUSD to qfRound * Comment migrations * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * add qfRound to qfRoundStats * fix qfRoundStatsQuery * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add logs to projectVerificationForm * Add logs to projectVerificationForm * fix: add project Ids list textarea for qf round edit * Master to staging (#1543) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * Fix/word similarity - staging (#1546) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> * Fixed word similarity issue * Removed unused import --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * remove refresh_project_summary_from totals and add user cache (#1539) * Remove users field from project * Remove users field from filterProjectsQuery * Remove projects field from user * remove added logs * fix eslint errors * remove users from Project.create * remove users from Project.create in testUtils.ts * remove projectOwnerId * replace admin with adminUserId * Add recurring donation join to donations() endpoint (#1554) related to #1483 * replace admin with adminUserId in SEED data * replace admin with adminUserId * replace admin with adminUserId in projectResolver.ts * replace admin with adminUserId in projectsTab.ts * replace admin with adminUserId in projectResolver.test.ts * replace admin with adminUserId in projectResolver.ts * add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds * fix nullable * remove admin from project * replace admin with adminUserId * replace admin with adminUserId * add adminUserId field * drop admin column * fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url * Add some logs * Fix eslint errors * Add maxQueuedJobs for draft donation worker * Fix eslint errors * fix unstable test case * Disable concurrency for draft donation worker * add indexes to project_summary_view (#1568) * improve projectBySlug query * fix: change output types to float * Ignore small differences of amounts when matching draft donation for erc20 * add graphql-fields * add getVerificationFormStatusByProjectId * refactor projectBySlug * add findProjectIdBySlug * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * remove projectVerificationForm assert * add logs * fix title in should return projects with indicated slug test * Add streamed mini donations to qf round (#1557) * Add streamed mini donations to qf round related to Giveth/giveth-dapps-v2#3284 * Fix eslint error * Fix eslint errors * make verificationFormStatus field public * Reduce test runnning time (#1574) * fix: reduce test runnning time * fix: add permissions test case * fix: add permissions test case * fix: refactor (excluding permissions test cases from global beforeEach) --------- Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com> Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> * WIP add base network * Continue on integrating with base chain * Fix migrations * Fix migrations * Add test cases about filteriing base network * Add BASE node http urls for rpc * Add BASE node http urls for rpc * Add missing things for integrating with base * Fix creating new token with coingeckoId related to #1564 * Fill base mainnet tokens related to #1561 --------- Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com> Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> * Add coingeckoId to BASE_SEPOLIA (#1592) * Ignore small differences of amounts when matching draft donation for … (#1573) * Ignore small differences of amounts when matching draft donation for erc20 * Fix eslint errors * Release Integrate QF with super fluid streamed donations (#1555) * add activeQfRoundId to sortingBy InstantBoosting * add orderBy totalDonations and totalReactions * feat: add getRecurringDonationStats resolver * fix filtering by QF * remove qfRounds joins for non qf round filters * add some temp logs * remove temp logs * fix: changes test cases of recuring donations stats - create recored with createdAt field in past so test result won't be related to other endpoints test cases * Fix projectActualserviceView * fix stream balance depleted issue (#1496) Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * rebuild * refresh and fetch user address separately (#1499) * Added pg_trgm extension migration (#1502) * fix: change recurring donations stats query to single query * fix recurring donation count * WIP: projectIds textArea * fix actual matching cap (#1507) * fix query error * fix user donations count * fix recurring donation count tests * fix user recurring donation query * fix user recurring donation test * add donations relation to qfround * add findArchivedQfRounds endpoint * add findArchivedQfRounds endpoint * feat: add sponsors & banner images upload * add sortBy to findArchivedQfRounds * 1.23.3 * add new test graphql query * add tests for new QfArchivedRounds * fixes on qfArchivedRounds query * add new tests for qfArchivedRounds query * fix findArchivedQfRounds tests * fix: keep already uploaded sponsors images * fix skip and limit for findArchivedQfRounds * Add logs and refactor the bootstrap code to help investigate latency problem * Add poolSize to orm config * Fix eslint errors * remove changing squareRootSumOfProjects when cap is overflown * Trigger ortto activity when user saves their profile info for the first time (#1520) * add newUser to updateUser query * add createOrttoProfile * add createOrttoProfile to NotificationAdapterInterface * add createOrttoProfile to MockNotificationAdapter * add CREATE_ORTTO_PROFILE event * Allow to set the matching pool token & amount to be something other than usd (#1517) * Allow to set the matching pool token & amount to be something other than USD in adminjs * Allow to set the matching pool token & amount to be something other than USD in QFRound table * add null to allocatedTokenSymbol and allocatedTokenChainId * add nullable true to allocatedTokenSymbol and allocatedTokenChainId * add allocatedFundUSDPreferred and allocatedFundUSD to qfRound * Comment migrations * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * add qfRound to qfRoundStats * fix qfRoundStatsQuery * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add logs to projectVerificationForm * Add logs to projectVerificationForm * fix: add project Ids list textarea for qf round edit * Master to staging (#1543) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * Fix/word similarity - staging (#1546) * Hotfix db improvements (#1523) (#1524) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * Fix/db replica production (#1525) * Hotfix db improvements (#1523) * add extra configurations for postgresql connections * add master and slave replication strategy for typeorm * Define db read only configs --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> * update comment * Hotfix latency issues for prod (#1529) * Hotfix staging fix latency (#1528) * add project donation summary view entity * convert projectQueries to querybuilder * add cache to projectDonationSummary queries * add configurable cache to slow queries * remove massive recurring donation log * add await for project queries * Add informative logs for draft donation service job (#1537) * Fix eslint errors * Fix/master test (#1541) * Fixed master test issue * Returned test to master pipeline * Comment executing donation summary view --------- Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> * Fixed word similarity issue * Removed unused import --------- Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> * remove refresh_project_summary_from totals and add user cache (#1539) * Remove users field from project * Remove users field from filterProjectsQuery * Remove projects field from user * remove added logs * fix eslint errors * remove users from Project.create * remove users from Project.create in testUtils.ts * remove projectOwnerId * replace admin with adminUserId * Add recurring donation join to donations() endpoint (#1554) related to #1483 * replace admin with adminUserId in SEED data * replace admin with adminUserId * replace admin with adminUserId in projectResolver.ts * replace admin with adminUserId in projectsTab.ts * replace admin with adminUserId in projectResolver.test.ts * replace admin with adminUserId in projectResolver.ts * add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds * fix nullable * remove admin from project * replace admin with adminUserId * replace admin with adminUserId * add adminUserId field * drop admin column * fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url * Add some logs * Fix eslint errors * Add maxQueuedJobs for draft donation worker * Fix eslint errors * fix unstable test case * Disable concurrency for draft donation worker * add indexes to project_summary_view (#1568) * improve projectBySlug query * fix: change output types to float * Ignore small differences of amounts when matching draft donation for erc20 * add graphql-fields * add getVerificationFormStatusByProjectId * refactor projectBySlug * add findProjectIdBySlug * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * fix projectBySlug tests with new changes * remove projectVerificationForm assert * add logs * fix title in should return projects with indicated slug test * Add streamed mini donations to qf round (#1557) * Add streamed mini donations to qf round related to Giveth/giveth-dapps-v2#3284 * Fix eslint error * Fix eslint errors * make verificationFormStatus field public * Reduce test runnning time (#1574) * fix: reduce test runnning time * fix: add permissions test case * fix: add permissions test case * fix: refactor (excluding permissions test cases from global beforeEach) --------- Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com> Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> * WIP add base network * Continue on integrating with base chain * Fix migrations * Fix migrations * Add test cases about filteriing base network * Add BASE node http urls for rpc * Add BASE node http urls for rpc * Add missing things for integrating with base * Fix creating new token with coingeckoId related to #1564 * Fill base mainnet tokens related to #1561 * add coingeckoId to BASE_SEPOLIA --------- Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com> Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Carlos <carlos.quintero096@gmail.com> Co-authored-by: Meriem-B <135605616+Meriem-B@users.noreply.github.com> * Deleting redis * sync all donations totals (#1594) * sync all donations totals * add update qfroundmatching * Add coingeckoId for BASE ETH * Changee isGivbaclEligble of base chain tokens to false --------- Co-authored-by: Ramin <raminramazanpour@gmail.com> Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com> Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com> Co-authored-by: Amin Latifi <a.latifi.al@gmail.com> Co-authored-by: Rolazo <nicobaena96@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Meriem-B <135605616+Meriem-B@users.noreply.github.com> Co-authored-by: Nicolas <38561963+Rolazo@users.noreply.github.com>
Summary by CodeRabbit
New Features
Tests
Chores
related to #1341