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

[Notion] config - ignore new pages but not updates #14144

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

andrewjschuang
Copy link
Collaborator

@andrewjschuang andrewjschuang commented Sep 30, 2024

Setting the includeNewPages prop to false should ignore newly created pages but not updates for them after they're created.

Summary by CodeRabbit

  • New Features

    • Enhanced control over new page detection in the Notion integration, allowing users to ignore new pages based on the includeNewPages setting.
    • Improved event emission logic for distinguishing between new and updated pages.
  • Bug Fixes

    • Adjusted handling of property changes to ensure only actual changes trigger events.
  • Version Updates

    • Updated version numbers for the Notion component and the "Updated Page in Database" source.

Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Sep 30, 2024 7:26pm
pipedream-docs ⬜️ Ignored (Inspect) Sep 30, 2024 7:26pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Sep 30, 2024 7:26pm

Copy link
Contributor

coderabbitai bot commented Sep 30, 2024

Walkthrough

The pull request introduces updates to the Notion integration, specifically modifying the version numbers in the package.json and updated-page.mjs files. The functionality of the "Updated Page in Database" source is enhanced by adding conditional logic for handling new pages based on the includeNewPages property. This change refines how new and updated pages are processed, ensuring that events are emitted only when necessary.

Changes

File Change Summary
components/notion/package.json Version updated from "0.2.0" to "0.2.1". No other changes made.
components/notion/sources/updated-page.mjs Version updated from "0.1.0" to "0.1.1". Logic modified to conditionally handle new pages based on includeNewPages, with refined event emission for new and updated pages.

Possibly related PRs

Suggested reviewers

  • michelle0927

🐰 In the garden of code, we hop with glee,
Version numbers change, as bright as can be!
New pages now check, with a flick of a tail,
Events are emitted, we’ll never fail!
With logic refined, our work is a treat,
Hopping along, our integration's complete! 🥕


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 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.

CodeRabbit Configuration 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.

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 (1)
components/notion/sources/updated-page/updated-page.mjs (1)

188-191: Use of console.log for logging

Consider replacing console.log with the source's logging mechanism to ensure consistent and configurable logging across the application. This helps in managing logs more effectively and adheres to best practices.

Apply this diff to use the source's logging method:

          if (isNewPage && !this.includeNewPages) {
-            console.log(`Ignoring new page: ${page.id}`);
+            this.log(`Ignoring new page: ${page.id}`);
             continue;
          }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a3c822c and e556583.

📒 Files selected for processing (2)
  • components/notion/package.json (1 hunks)
  • components/notion/sources/updated-page/updated-page.mjs (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/notion/package.json
🔇 Additional comments (2)
components/notion/sources/updated-page/updated-page.mjs (2)

12-12: Version updated appropriately

The version number has been incremented to "0.1.1" to reflect the new changes made in this update.


Line range hint 174-181: Correct handling of new pages in propertyValues

The logic correctly checks if a page does not exist in the propertyValues database and initializes its properties. It sets isNewPage to true, marks that a property has changed, updates propertyValues, and records the changes. This ensures new pages are properly tracked.

@andrewjschuang andrewjschuang merged commit afa8fb1 into master Sep 30, 2024
12 checks passed
@andrewjschuang andrewjschuang deleted the notion-fix-updated-pages-for-new-pages branch September 30, 2024 19:35
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