-
-
Notifications
You must be signed in to change notification settings - Fork 997
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
Added Sample Data For AgendaCategory & Removed Delete Fund/Campaign Mutations #2511
Added Sample Data For AgendaCategory & Removed Delete Fund/Campaign Mutations #2511
Conversation
WalkthroughThis update introduces a new JSON file for agenda categories, enhancing sample data for better user experience. It also removes two mutation operations related to deleting funds and fundraising campaigns from the GraphQL schema and resolvers, reflecting a shift in functionality. Additionally, modifications are made to the data loading utilities to accommodate the new agenda category model. Changes
Assessment against linked issues
Poem
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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.yaml
Review profile: CHILL
Files selected for processing (7)
- sample_data/agendaCategories.json (1 hunks)
- schema.graphql (1 hunks)
- src/resolvers/Mutation/index.ts (3 hunks)
- src/typeDefs/mutations.ts (1 hunks)
- src/types/generatedGraphQLTypes.ts (3 hunks)
- src/utilities/loadSampleData.ts (5 hunks)
- tests/resolvers/Mutation/removeFundCampaignPledge.spec.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- sample_data/agendaCategories.json
- tests/resolvers/Mutation/removeFundCampaignPledge.spec.ts
Additional comments not posted (11)
src/utilities/loadSampleData.ts (4)
7-7
: Approved: Import ofAgendaCategoryModel
.The addition of
AgendaCategoryModel
to the imports list is correctly implemented and necessary for the new functionality.
67-67
: Approved: Addition toformatDatabase
.The inclusion of
AgendaCategoryModel.deleteMany({})
in theformatDatabase
function is appropriate for clearing the agenda categories during database formatting.Please ensure that this operation does not interfere with any existing data integrity constraints or triggers that might be set on the
agendaCategories
collection.
171-171
: Approved: Inclusion incheckCountAfterImport
.The addition of
agendaCategories
to the document count checks in thecheckCountAfterImport
function is appropriate and ensures that the new data model is accounted for in data integrity checks.Please verify that the document counts are accurate and reflect the expected numbers post-import, especially in scenarios with large data sets.
207-207
: Approved: Addition to collections array.The inclusion of
agendaCategories
in the collections array is correctly implemented, ensuring that this new collection is considered in data operations.schema.graphql (3)
Line range hint
1-1
: Review of Mutation RemovalsThe removal of
removeFund
andremoveFundraisingCampaign
mutations aligns with the PR objectives to shift from deletion to disabling functionalities for funds and campaigns. This change is consistent with the decision to enhance data integrity and prevent accidental deletions.
Line range hint
1-1
: Confirm Removal ofremoveFundraisingCampaign
MutationThe mutation
removeFundraisingCampaign
has been successfully removed from the schema. This change should be verified across the system to ensure that no residual code or functionality depends on this mutation.Run the following script to verify the removal of
removeFundraisingCampaign
mutation:Verification successful
Mutation
removeFundraisingCampaign
Successfully RemovedThe
removeFundraisingCampaign
mutation has been confirmed as removed from the codebase, with no residual references found. The search results only showed references toremoveFundraisingCampaignPledge
, which is unrelated.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `removeFundraisingCampaign` mutation is completely removed from the schema. # Test: Search for the mutation usage. Expect: No occurrences. rg --type graphql -A 5 $'removeFundraisingCampaign'Length of output: 82
Script:
#!/bin/bash # Description: Verify that `removeFundraisingCampaign` mutation is completely removed from the codebase. # Test: Search for the mutation usage across all files. Expect: No occurrences. rg -A 5 'removeFundraisingCampaign'Length of output: 6946
Line range hint
1-1
: Confirm Removal ofremoveFund
MutationThe mutation
removeFund
has been successfully removed from the schema. This change should be verified across the system to ensure that no residual code or functionality depends on this mutation.Run the following script to verify the removal of
removeFund
mutation:Verification successful
removeFund
Mutation Successfully RemovedThe
removeFund
mutation has been successfully removed from the codebase. However, there are multiple references toremoveFundraisingCampaignPledge
, which may indicate a related change or replacement. Ensure that any dependencies onremoveFund
have been appropriately updated or removed.
- No occurrences of
removeFund
found in the codebase.- Multiple occurrences of
removeFundraisingCampaignPledge
found, suggesting a possible replacement.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `removeFund` mutation is completely removed from the schema. # Test: Search for the mutation usage. Expect: No occurrences. rg --type graphql -A 5 $'removeFund'Length of output: 67
Script:
#!/bin/bash # Description: Verify that `removeFund` mutation is completely removed from the codebase. # Test: Search for the mutation usage across all files. Expect: No occurrences. rg 'removeFund'Length of output: 1552
src/types/generatedGraphQLTypes.ts (2)
Line range hint
1-1000
: Confirmed Removal of Mutations:The mutations
removeFund
andremoveFundraisingCampaign
along with their argument typesMutationRemoveFundArgs
andMutationRemoveFundraisingCampaignArgs
have been successfully removed from the file. This aligns with the PR objectives to disallow deletion operations for funds and campaigns.Please ensure that there are no residual references to these mutations or types elsewhere in the codebase that could lead to errors.
Line range hint
1-1000
: Review of File Structure and Consistency:The file maintains a consistent structure and naming convention across the type definitions. TypeScript features are appropriately used, and the GraphQL schema definitions are in line with best practices.
Ensure to maintain this consistency as new features or changes are introduced to the project.
src/resolvers/Mutation/index.ts (1)
Line range hint
1-1
: Removal of mutations approved.The removal of
removeFund
andremoveFundraisingCampaign
aligns with the PR's objectives. Ensure that there are no residual references to these mutations elsewhere in the codebase.Run the following script to verify that there are no residual references:
Verification successful
Removal of mutations verified successfully.
The removal of
removeFund
andremoveFundraisingCampaign
has been verified, and no residual references to these mutations were found in the codebase. The occurrences found were related to a different mutation,removeFundraisingCampaignPledge
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that there are no residual references to removed mutations. # Test: Search for the removed mutations. Expect: No occurrences. rg --type ts -A 5 $'removeFund|removeFundraisingCampaign'Length of output: 6493
src/typeDefs/mutations.ts (1)
Line range hint
1-1
: Removal of mutation type definitions approved.The removal of
removeFund
andremoveFundraisingCampaign
type definitions aligns with the PR's objectives. Ensure that there are no residual type definitions or references to these mutations elsewhere in the codebase.Run the following script to verify that there are no residual type definitions or references:
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2511 +/- ##
===========================================
- Coverage 98.89% 98.89% -0.01%
===========================================
Files 351 349 -2
Lines 17990 17766 -224
Branches 2403 2371 -32
===========================================
- Hits 17792 17570 -222
+ Misses 195 193 -2
Partials 3 3 ☔ View full report in Codecov by Sentry. |
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (4)
- src/resolvers/Mutation/forgotPassword.ts (1 hunks)
- tests/libraries/errors/inputValidationError.spec.ts (1 hunks)
- tests/libraries/errors/invalidFileTypeError.spec.ts (1 hunks)
- tests/resolvers/Mutation/forgotPassword.spec.ts (1 hunks)
Additional comments not posted (2)
tests/libraries/errors/invalidFileTypeError.spec.ts (1)
6-26
: Test implementation for InvalidFileTypeError is correct.The test is well-structured and correctly asserts the properties of the
InvalidFileTypeError
. It follows best practices for exception testing in JavaScript.tests/libraries/errors/inputValidationError.spec.ts (1)
6-26
: Test implementation for InputValidationError is correct.The test is well-structured and correctly asserts the properties of the
InputValidationError
. It follows best practices for exception testing in JavaScript.
b4099b9
into
PalisadoesFoundation:develop
…utations (PalisadoesFoundation#2511) * Add default agendaCategories * remove removeFund mutation * removed removeFundraisingCampaign Mutation * Add test coverage for errorTypes
What kind of change does this PR introduce?
refactoring
Issue Number:
Fixes #2510
Did you add tests for your changes?
Yes
Snapshots/Videos:
Default agendaCategories being created on importing sample data
Summary
AgendaCategories
for each organizationRemoveFund
MutationRemoveFundraisingCampaign
MutationDoes this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests
forgotPassword
mutation to validate handling of invalid OTP scenarios.