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

Added 12 new posts to sample_data/posts.json #2837

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

im-vedant
Copy link

@im-vedant im-vedant commented Jan 8, 2025

What kind of change does this PR introduce?

Issue Number:

Fixes #2833

Did you add tests for your changes?

Snapshots/Videos:

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

Other information

Have you read the contributing guide?

Summary by CodeRabbit

  • New Features

    • Added 12 new winter-themed pinned posts to the sample data.
    • Updated post pinning functionality to allow posts without titles.
  • Data

    • Expanded sample posts dataset with winter experience narratives.
    • All new posts marked as pinned with unique winter-related themes.
  • Tests

    • Updated expected count of posts in sample data tests from 17 to 29.

Copy link

coderabbitai bot commented Jan 8, 2025

Walkthrough

The pull request introduces multiple new winter-themed pinned posts to the sample_data/posts.json file and modifies the togglePostPin resolver to remove the title validation requirement when pinning a post. The changes add 12 unique posts with winter-related narratives, each marked as pinned and created by different users across various organizations. The togglePostPin mutation has been updated to allow pinning posts without mandating a title.

Changes

File Change Summary
sample_data/posts.json Added 12 new pinned posts with winter-themed titles and descriptions, each with unique _id, creatorId, and timestamps
src/resolvers/Mutation/togglePostPin.ts Removed title validation check when pinning a post, allowing posts to be pinned without a mandatory title
tests/utilities/loadSampleData.spec.ts Updated expected post count from 17 to 29 in the test for sample data import

Assessment against linked issues

Objective Addressed Explanation
Ensure 12 pinned posts in sample DB [#2833]
Posts have different content [#2833]
Posts successfully load during setup [#2833] Requires verification during actual setup process

Possibly related PRs

  • fixed loadSampleData.ts and added tests  #2807: This PR modifies the loadSampleData.ts file, which is relevant to the main PR as it also involves sample data handling, specifically for posts, ensuring that the sample data import process is accurate and effective.

Poem

🐰 Winter's Tale in Pinned Delight
Snowflakes dance, posts take flight
Twelve stories frozen in time's embrace
Rabbit hops through data's winter space
Pinned memories, cold and bright! 🌨️

Finishing Touches

  • 📝 Generate Docstrings

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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

github-actions bot commented Jan 8, 2025

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

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 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.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3600eaa and 14a228f.

📒 Files selected for processing (2)
  • sample_data/posts.json (1 hunks)
  • src/resolvers/Mutation/togglePostPin.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/resolvers/Mutation/togglePostPin.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Testing Application (22.x)
  • GitHub Check: Analyse Code With CodeQL (typescript)
🔇 Additional comments (2)
sample_data/posts.json (2)

290-493: Well-structured winter-themed content

The new posts demonstrate:

  • Consistent structure and formatting
  • Well-crafted winter-themed narratives
  • Appropriate use of the pinned attribute
  • Good distribution across different creators and organizations

321-491: Verify the chronological order of posts

The createdAt dates for the new posts span from April 2-13, 2023, which are in the past. Consider whether these should be updated to more recent dates for consistency with the current timeline.

Run this script to check the date distribution:

sample_data/posts.json Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 8, 2025
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.68%. Comparing base (3600eaa) to head (f818e9e).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2837      +/-   ##
===========================================
- Coverage    97.72%   97.68%   -0.05%     
===========================================
  Files          364      364              
  Lines        18569    18563       -6     
  Branches      2682     2677       -5     
===========================================
- Hits         18147    18133      -14     
- Misses         417      425       +8     
  Partials         5        5              

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

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

  1. All pinned posts have titles. That is part of the logic. You have changed the logic of the application. Please fix this.
  2. Please attach a video showing the new pinned posts in the application

@palisadoes palisadoes added the ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files label Jan 9, 2025
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: 0

🧹 Nitpick comments (1)
tests/utilities/loadSampleData.spec.ts (1)

46-46: LGTM! The updated post count matches the PR changes.

The change from 17 to 29 posts correctly reflects the addition of 12 new winter-themed posts to sample_data/posts.json.

Consider adding a comment to document the breakdown of posts for better maintainability:

+    // Expect 29 posts: 17 original + 12 winter-themed posts
     expect(postCount).toBe(29);
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14a228f and f818e9e.

📒 Files selected for processing (1)
  • tests/utilities/loadSampleData.spec.ts (1 hunks)

@im-vedant
Copy link
Author

im-vedant commented Jan 9, 2025

@palisadoes If you check the togglePostPin.ts file, the title field is optional for toggling a pinned post. However, when unpinning a post, we are not passing the title in the arguments, which is currently causing an error. Therefore, I have removed the code that requires it.
https://www.loom.com/share/af41106f507c4fb1b53eda354b9aed80

Video showing new pinned post : https://www.loom.com/share/5c1ec14e20514dc0b47c47b65cd8ff40

@palisadoes
Copy link
Contributor

@palisadoes If you check the togglePostPin.ts file, the title field is optional for toggling a pinned post. However, when unpinning a post, we are not passing the title in the arguments, which is currently causing an error. Therefore, I have removed the code that requires it. https://www.loom.com/share/af41106f507c4fb1b53eda354b9aed80

Video showing new pinned post : https://www.loom.com/share/5c1ec14e20514dc0b47c47b65cd8ff40

@aashimawadhwa PTAL.

  1. We need to maintain pinned post functionality. Removing the ability to pin a post means that we'll never have pinned posts. We may need to create an issue for this
  2. Unpinned posts must not have titles and cause an error.

@noman2002
Copy link
Member

@palisadoes If you check the togglePostPin.ts file, the title field is optional for toggling a pinned post. However, when unpinning a post, we are not passing the title in the arguments, which is currently causing an error. Therefore, I have removed the code that requires it. https://www.loom.com/share/af41106f507c4fb1b53eda354b9aed80

Video showing new pinned post : https://www.loom.com/share/5c1ec14e20514dc0b47c47b65cd8ff40

Looks like the error is fixed, right ??
Also confirm if the pinning and unpinning is working fine ?

@im-vedant
Copy link
Author

@noman2002 The error is fixed. Toggling is working fine.

@palisadoes palisadoes requested review from noman2002 and removed request for palisadoes and aashimawadhwa January 13, 2025 15:23
@palisadoes palisadoes dismissed their stale review January 13, 2025 15:24

Noman is looking at it

Copy link
Member

@noman2002 noman2002 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants