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

Add base chain #1579

Merged
merged 13 commits into from
May 27, 2024
Merged

Add base chain #1579

merged 13 commits into from
May 27, 2024

Conversation

mohammadranjbarz
Copy link
Collaborator

@mohammadranjbarz mohammadranjbarz commented May 22, 2024

Summary by CodeRabbit

  • New Features

    • Added support for Base Mainnet and Base Sepolia networks across various functionalities, including token seeding, network configurations, and filtering projects based on donation acceptance criteria.
    • Enhanced admin interfaces with new network options for Base and Base Sepolia.
  • Tests

    • Introduced new test cases for Base Mainnet and Base Sepolia networks, covering transaction details, token seeding, and project filtering.
  • Chores

    • Updated environment configurations to include API URLs and keys for Base Mainnet and Base Sepolia networks.

related to #1341

mohammadranjbarz and others added 3 commits May 20, 2024 17:05
#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>
Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

The 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

Files Change Summaries
.github/workflows/develop-pipeline.yml, .github/workflows/master-pipeline.yml, .github/workflows/staging-pipeline.yml Added BASE_SCAN_API_KEY and BASE_SEPOLIA_SCAN_API_KEY to environment variables.
config/example.env, config/test.env Added new environment variables for Base Scan API URLs and keys.
migration/1716367359560-add_base_chain_tokens.ts Implemented migration to add base chain tokens to specific organizations.
migration/data/seedTokens.ts Added new token entries in the seedTokens array.
package.json Updated test scripts to include projectResolver.allProject.test.ts.
src/entities/project.ts Added AcceptFundOnBase to the FilterField enum.
src/provider.ts Added new network IDs and corresponding API configurations for Base Mainnet and Base Sepolia.
src/resolvers/donationResolver.test.ts Updated valid transaction network IDs to include 8453 and 84532.
src/resolvers/projectResolver.ts Added case for FilterField.AcceptFundOnBase to include Base Mainnet and Base Sepolia.
src/resolvers/projectResolver.allProject.test.ts Added new test cases for filtering projects based on donation acceptance criteria on different networks.
src/server/adminJs/tabs/donationTab.ts, src/server/adminJs/tabs/qfRoundTab.ts, src/server/adminJs/tabs/tokenTab.ts Added network options for Base Mainnet and Base Sepolia.
src/services/chains/index.test.ts Added test cases for retrieving transaction details on Base Mainnet and Base Sepolia.
src/utils/networksConfig.ts Added network configurations for Base Mainnet and Base Sepolia.
src/utils/validators/graphqlQueryValidators.ts Updated managingFundsValidator to include Base Mainnet and Base Sepolia.
src/utils/validators/projectValidator.ts Added support for Base Mainnet and Base Sepolia in isWalletAddressSmartContract.
test/pre-test-scripts.ts Added token seeding logic for Base Mainnet and Base Sepolia.
test/testUtils.ts Added entries for Base Mainnet and Base Sepolia in SEED_DATA.

In fields of code, where logic flows,
New networks rise where data goes.
With keys and URLs, they stand,
Base Mainnet, Sepolia, hand in hand.
Tokens seeded, tests aligned,
A future bright, with code refined.

Tip

New Features and Improvements

Review Settings

Introduced 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 Instructions

CodeRabbit 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 Rules

We 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 Tools

We are continually expanding our support for static analysis tools. We have added support for biome, hadolint, and ast-grep. Update the settings in your .coderabbit.yaml file or head over to the settings page to enable or disable the tools you want to use.

Tone Settings

Users can now customize CodeRabbit to review code in the style of their favorite characters or personalities. Here are some of our favorite examples:

  • Mr. T: "You must talk like Mr. T in all your code reviews. I pity the fool who doesn't!"
  • Pirate: "Arr, matey! Ye must talk like a pirate in all yer code reviews. Yarrr!"
  • Snarky: "You must be snarky in all your code reviews. Snark, snark, snark!"

Revamped Settings Page

We 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 .coderabbit.yaml will be reflected in the settings page, and vice versa.

Miscellaneous

  • Turn off free summarization: You can switch off free summarization of PRs opened by users not on a paid plan using the enable_free_tier setting.
  • Knowledge-base scope: You can now set the scope of the knowledge base to either the repository (local) or the organization (global) level using the knowledge_base setting. In addition, you can specify Jira project keys and Linear team keys to limit the knowledge base scope for those integrations.
  • High-level summary placement: You can now customize the location of the high-level summary in the PR description using the high_level_summary_placeholder setting (default @coderabbitai summary).
  • Revamped request changes workflow: You can now configure CodeRabbit to auto-approve or request changes on PRs based on the review feedback using the request_changes_workflow setting.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mohammadranjbarz mohammadranjbarz marked this pull request as ready for review May 23, 2024 07:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 0db090e and 197f7ea.
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 of BASE_MAINNET and BASE_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 of base_mainnet and base_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 of FilterField.AcceptFundOnBase with handling for BASE_MAINNET and BASE_SEPOLIA network IDs is correctly implemented.

Comment on lines +52 to +54
public async down(_queryRunner: QueryRunner): Promise<void> {
//
}
Copy link
Contributor

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 using for...of instead of forEach 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

Commits Files that changed from the base of the PR and between 197f7ea and b48c030.
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 the down method to reverse the changes made by the up method.

package.json (1)

148-148: Updated test scripts to include new functionality.

The addition of new test scripts for projectResolver and givpower 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 @@
);
});


Copy link
Contributor

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.

Suggested change

Comment on lines +7 to +49
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})
;`);
}
Copy link
Contributor

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.

Comment on lines 966 to 1071
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),
),
);
});
Copy link
Contributor

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 using for...of instead of forEach.

The use of forEach for iterating over arrays can be less performant and less flexible compared to for...of. Consider refactoring these to use for...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

Commits Files that changed from the base of the PR and between b48c030 and 8895529.
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 of BASE_MAINNET and BASE_SEPOLIA to NETWORK_IDS aligns with the PR's objectives to support these networks.


416-423: The addition of BASE_MAINNET and BASE_SEPOLIA cases in getBlockExplorerApiUrl function is correctly implemented and aligns with the PR's objectives.


325-335: The addition of BASE_MAINNET and BASE_SEPOLIA cases in getProvider 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.

Comment on lines +966 to +1070
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),
),
);
});
Copy link
Contributor

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 and options in the getProvider 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

Commits Files that changed from the base of the PR and between 8895529 and 28cf3eb.
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.

@mohammadranjbarz mohammadranjbarz marked this pull request as draft May 26, 2024 06:50
@mohammadranjbarz mohammadranjbarz marked this pull request as ready for review May 26, 2024 13:23
@mohammadranjbarz
Copy link
Collaborator Author

@Meriem-BM The PR is now ready for review, you can test it locally on your system as well

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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!.id

Using simple concatenation here avoids the overhead of template literals when not needed.


Line range hint 118-118: Specify explicit types instead of using any.

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: Prefer for...of over forEach 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

Commits Files that changed from the base of the PR and between 28cf3eb and dc7e7fb.
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 for BASE_MAINNET and BASE_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 and BASE_SEPOLIA. The properties such as name, symbol, address, decimals, networkId, coingeckoId, and isGivbackEligible 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 including name, symbol, address, decimals, networkId, coingeckoId, isGivbackEligible, and isStableCoin where applicable. This comprehensive addition supports the integration of BASE Mainnet into the system.

@mohammadranjbarz mohammadranjbarz merged commit b1ce41c into staging May 27, 2024
3 checks passed
@mohammadranjbarz mohammadranjbarz deleted the add_base_chain branch May 27, 2024 14:29
@mohammadranjbarz mohammadranjbarz restored the add_base_chain branch May 30, 2024 07:11
mohammadranjbarz added a commit that referenced this pull request Jun 2, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant