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

Feat : Implemented field connection resolver for organization events #2532

Conversation

AnshulKahar2729
Copy link

@AnshulKahar2729 AnshulKahar2729 commented Sep 15, 2024

What kind of change does this PR introduce?

feature
Issue Number:

Fixes #2319

Did you add tests for your changes?

Yes

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features

    • Introduced pagination support for events with new EventsConnection and EventsConnectionEdge types.
    • Added a resolver for fetching organization-specific events.
    • Updated port mapping for Redis service to enhance connectivity.
    • Added a new command for Docker development to streamline setup.
  • Bug Fixes

    • Improved error handling in event fetching and cursor parsing.
  • Documentation

    • Expanded comments for clarity within the GraphQL schema.
  • Tests

    • Added unit tests for event resolvers and cursor parsing functionality.

Copy link

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

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.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

coderabbitai bot commented Sep 15, 2024

Walkthrough

The pull request introduces significant updates to the GraphQL schema, enhancing readability and organization. It adds pagination support for events through new types, EventsConnection and EventsConnectionEdge, and modifies existing types and resolvers to accommodate this functionality. Additionally, it includes unit tests for the new resolver to ensure robust error handling and correct data retrieval.

Changes

Files Change Summary
schema.graphql Added EventsConnection and EventsConnectionEdge types; reformatted union types and modified existing types for clarity.
src/resolvers/Organization/events.ts Implemented a resolver for organization-specific events with pagination support and error handling.
tests/resolvers/Organization/events.spec.ts Created unit tests for the events resolver and cursor parsing functions.
docker-compose.dev.yaml, package.json Updated port mapping for Redis service and added a new Docker development script.

Assessment against linked issues

Objective Addressed Explanation
Add pagination support to EventsByOrganization query (2319)

Possibly related PRs

Suggested labels

Ready 4 PR Review

Suggested reviewers

  • (No suggested reviewers provided)

Poem

🐰 In the meadow where events do play,
New paths of pagination light the way.
With edges and connections clear and bright,
Fetching data now feels just right!
Hops of joy for the code we see,
A better schema, oh so free! 🌼


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>, please review it.
    -- 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 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.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @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 do a full 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 configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 95.12195% with 4 lines in your changes missing coverage. Please review.

Project coverage is 99.08%. Comparing base (6093752) to head (dd74c7b).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/resolvers/Organization/events.ts 95.12% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2532      +/-   ##
===========================================
+ Coverage    98.89%   99.08%   +0.18%     
===========================================
  Files          349      350       +1     
  Lines        17769    17851      +82     
  Branches      2371     2374       +3     
===========================================
+ Hits         17573    17687     +114     
+ Misses         193      164      -29     
+ Partials         3        0       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnshulKahar2729
Copy link
Author

AnshulKahar2729 commented Sep 15, 2024

I will fix that code coverage soon; another failed one is schema.graphql which was needed to change

Copy link

@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)
package.json (1)

29-29: Approve the addition of the Docker development command.

The new "docker:dev" command is a useful addition to streamline the development setup process using Docker Compose. It enhances the project's functionality by providing a convenient way to start the development environment with a single command.

Consider making sudo optional.

Using sudo may not be necessary for all users, depending on their Docker configuration. Consider making it optional or providing instructions for users who may not need to use sudo to run Docker commands.

To make sudo optional, you can modify the command like this:

-"docker:dev" : "sudo /usr/libexec/docker/cli-plugins/docker-compose -f docker-compose.dev.yaml up"
+"docker:dev" : "/usr/libexec/docker/cli-plugins/docker-compose -f docker-compose.dev.yaml up"

And provide instructions in the project's documentation or README file for users who may need to use sudo.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 16c3996 and bd58553.

Files selected for processing (4)
  • docker-compose.dev.yaml (1 hunks)
  • package.json (1 hunks)
  • src/resolvers/Organization/events.ts (1 hunks)
  • tests/resolvers/Organization/events.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/resolvers/Organization/events.ts
  • tests/resolvers/Organization/events.spec.ts

@@ -11,7 +11,7 @@ services:
redis-stack-server:
image: redis/redis-stack-server:latest
ports:
- 6379:6379
- 6380:6379
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Port change inconsistency detected across project files

The change of the Redis external port from 6379 to 6380 in docker-compose.dev.yaml appears to be inconsistent with other parts of the project:

  • The production environment (docker-compose.prod.yaml) still uses port 6379 for both internal and external mapping.
  • Both development and production environments set REDIS_PORT=6379 as an environment variable.
  • The INSTALLATION.md file still refers to 6379 as the default Redis port in multiple places.

Please review the following action items:

  1. Determine if the port change to 6380 in docker-compose.dev.yaml is intentional.
  2. If intentional, update all relevant files for consistency:
    • Update docker-compose.prod.yaml to use the new port (6380).
    • Update the REDIS_PORT environment variable in both docker-compose.dev.yaml and docker-compose.prod.yaml.
    • Update the INSTALLATION.md file to reflect the new port number.
  3. If unintentional, revert the change in docker-compose.dev.yaml back to 6379.
  4. After making the necessary changes, review the application code to ensure it uses the correct port for Redis connections.
Analysis chain

Verify the reason for the Redis port change and ensure consistency.

The external port for the Redis service has been changed from 6379 to 6380. While this change does not affect the internal workings of the Redis container, it may impact how clients connect to the service.

Please provide the reason for this port change. Additionally, ensure that this change is consistently applied across the codebase, including any configuration files, connection strings, or documentation that references the Redis port.

To verify the impact of this change, please run the following script:

If the script yields any results, please update those instances to use the new port (6380) to maintain consistency across the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash

# Search for occurrences of the old Redis port (6379) in YAML files
echo "Searching for occurrences of the old Redis port (6379) in YAML files..."
rg --type yaml $'6379'

# Search for occurrences of the old Redis port (6379) in JavaScript files
echo "Searching for occurrences of the old Redis port (6379) in JavaScript files..."
rg --type js $'6379'

# Search for occurrences of the old Redis port (6379) in Markdown files (documentation)
echo "Searching for occurrences of the old Redis port (6379) in Markdown files..."
rg --type md $'6379'

Length of output: 1103

AnshulKahar2729 and others added 20 commits September 18, 2024 20:03
This reverts commit 9939f3f.
…n#2430)

* feat: added caddy support

* refactor: fixed Dockerfile.dev versions

* docs: removed the nginx and certbot docs

* refactor: removed not used ports from docker compose

* fix: minor trailing spaces and comma

* fix: trailing spaces
* add ts-doc comments

* restore unwanted changes

* fix formatting issue
…tion#2487)

Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.7 to 15.2.9.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v15.2.7...v15.2.9)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…n#2488)

Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) and [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8). These dependencies needed to be updated together.

Updates `vitest` from 1.6.0 to 2.0.5
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.0.5/packages/vitest)

Updates `@vitest/coverage-v8` from 1.6.0 to 2.0.5
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.0.5/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…dation#2489)

Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.6 to 4.17.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PalisadoesFoundation#2485)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.0.1 to 8.2.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.2.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [husky](https://github.com/typicode/husky) from 9.1.4 to 9.1.5.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](typicode/husky@v9.1.4...v9.1.5)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* reduced test run time

* reduced test cases run time

* issue 2236 reduced runtime and fixed changes
…ation#2498)

Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.9 to 15.2.10.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v15.2.9...v15.2.10)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.17.0 to 4.19.0.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.17.0...v4.19.0)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ndation#2501)

Bumps [@apollo/server](https://github.com/apollographql/apollo-server/tree/HEAD/packages/server) from 4.10.5 to 4.11.0.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/@apollo/[email protected]/packages/server)

---
updated-dependencies:
- dependency-name: "@apollo/server"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ation#2500)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.9 to 22.5.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
palisadoes and others added 12 commits September 18, 2024 20:23
* remove deprecated ban-types

* remove auto readme changes

* revert readme
* Add allotedHours in ActionItems & Add search/sort filters for action items & categories

* add tests

* update resolver

* add test for getSort
…utations (PalisadoesFoundation#2511)

* Add default agendaCategories

* remove removeFund mutation

* removed removeFundraisingCampaign Mutation

* Add test coverage for errorTypes
…ndation#2513)

Bumps [graphql-markdown](https://github.com/exogen/graphql-markdown) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/exogen/graphql-markdown/releases)
- [Commits](exogen/graphql-markdown@v7.0.0...v7.1.0)

---
updated-dependencies:
- dependency-name: graphql-markdown
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tion#2514)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.5.2 to 22.5.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ndation#2516)

Bumps [@types/yargs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/yargs) from 17.0.32 to 17.0.33.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/yargs)

---
updated-dependencies:
- dependency-name: "@types/yargs"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ion#2517)

Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 8.2.2 to 9.0.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](open-cli-tools/concurrently@v8.2.2...v9.0.0)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Added the field identifier

* fixed issues
* Fixed setup script

* Update package-lock.json

* Fixed linting error
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.

9 participants