Skip to content

Conversation

@GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Apr 7, 2025

Added the option of retrieving page content as markdown to "Retrieve Block" which was renamed to "Retrieve Page Content".

Renamed "Retrieve Page" to "Retrieve Page Metadata" for clarity.

Summary by CodeRabbit

  • New Features
    • Renamed and enhanced actions to clearly differentiate between retrieving full page content and obtaining metadata. Users can now opt to receive page content as structured blocks or in Markdown format.
    • Added in-app guidance to help choose the appropriate action for their needs.
  • Chores
    • Updated the integration version to 0.5.0 with improved Markdown conversion support.

@vercel
Copy link

vercel bot commented Apr 7, 2025

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) Apr 7, 2025 11:27pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 7, 2025 11:27pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 7, 2025 11:27pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

Walkthrough

The changes update the Notion integration by broadening the functionality of the retrieve actions. The "Retrieve Block" action is now renamed to "Retrieve Page Content" with added support for markdown output via conditional logic in its run method. The "Retrieve Page" action is revised to "Retrieve Page Metadata" with an advisory label. Additionally, a new method for converting pages to markdown is added, and the package version and dependencies have been updated accordingly.

Changes

File(s) Change Summary
components/notion/actions/retrieve-block/retrieve-block.mjs Renamed action to "Retrieve Page Content", version updated from 0.0.6 to 0.1.0; removed label/description from blockId; renamed and updated retrieveChildren to "Retrieve Content (Child Blocks)"; added new optional boolean retrieveMarkdown property; added conditional logic in run method for markdown retrieval.
components/notion/actions/retrieve-page/retrieve-page.mjs Renamed action to "Retrieve Page Metadata", version updated from 0.0.6 to 0.0.7; added new infoLabel property (type: alert with info message advising use of "Retrieve Page Content" for page content retrieval).
components/notion/notion.app.mjs Added new asynchronous method getPageAsMarkdown(pageId) to convert a Notion page to markdown using a Notion client and an exporter.
components/notion/package.json Updated package version from 0.4.1 to 0.5.0; added dependency "notion-to-md": "^4.0.0-alpha.4".

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant A as Page Content Action
  participant N as Notion App
  U->>A: Invoke action with parameters (including retrieveMarkdown flag)
  alt retrieveMarkdown is true
    A->>N: Call getPageAsMarkdown(pageId)
    N-->>A: Return markdown content
    A-->>U: Return success message with markdown
  else
    A->>N: Retrieve block and child blocks
    N-->>A: Return block objects
    A-->>U: Return success message with block data
  end
Loading

Poem

Hop along the code trail, I cheer,
Updates and changes now appear!
Markdown flows with a twinkling light,
Blocks and metadata dance in delight.
A code rabbit's celebration takes flight! 🐇

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/notion/actions/retrieve-block/retrieve-block.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/notion/actions/retrieve-page/retrieve-page.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/notion/notion.app.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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

🧹 Nitpick comments (1)
components/notion/actions/retrieve-block/retrieve-block.mjs (1)

32-37: Good implementation of markdown retrieval logic.

The conditional handling for markdown retrieval is implemented correctly, calling the appropriate method and returning the result.

Consider standardizing the summary messages for consistency:

-      $.export("$summary", "Successfully retrieved page as markdown");
+      $.export("$summary", "Successfully retrieved page content as markdown");

And on lines 42-44:

-    $.export("$summary", `Successfully retrieved block${this.retrieveChildren
+    $.export("$summary", `Successfully retrieved page content${this.retrieveChildren
       ? ` with ${block.children.length ?? 0} children`
       : ""}`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01e0c2c and c0a9df2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/notion/actions/retrieve-block/retrieve-block.mjs (2 hunks)
  • components/notion/actions/retrieve-page/retrieve-page.mjs (1 hunks)
  • components/notion/notion.app.mjs (2 hunks)
  • components/notion/package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (9)
components/notion/package.json (2)

3-3: Version bump appropriately reflects new functionality.

The version increment from 0.4.1 to 0.5.0 follows semantic versioning principles, correctly indicating the addition of new functionality (markdown support) rather than just a bug fix.


16-17:

✅ Verification successful

Note the use of an alpha version dependency.

Adding the notion-to-md dependency is necessary for the new markdown conversion functionality. However, be aware that you're using an alpha version (4.0.0-alpha.4) which may not be fully stable for production use.


🌐 Web query:

Is notion-to-md@4.0.0-alpha.4 stable for production use? Are there any known issues?

💡 Result:

The notion-to-md@4.0.0-alpha.4 package is explicitly labeled as experimental in its documentation, with warnings that it is part of a "fundamental reimagining" of the library and not yet suitable for production use[5].

Key considerations:

  • The v4 release introduces architectural changes aimed at modularity and extensibility, but these are still in alpha testing[5].
  • The maintainers emphasize that this version is intended for early adopters and contributors, not production workflows[5].

No specific stability issues or bugs are mentioned in the available sources, but the alpha designation itself indicates inherent instability typical of early development phases. For production environments, the maintainers recommend waiting for stable releases[5].

Citations:


Attention: Experimental Dependency Usage

The inclusion of notion-to-md@4.0.0-alpha.4 enables the new markdown conversion functionality, but please be aware that this version is explicitly marked as experimental. As highlighted in the package documentation, this alpha release is undergoing significant architectural changes and is not considered stable for production environments. Use with caution and plan for potential updates or issues as the library matures.

components/notion/actions/retrieve-page/retrieve-page.mjs (2)

5-5: Improved action naming for clarity.

Renaming from "Retrieve Page" to "Retrieve Page Metadata" more accurately describes the functionality of this action, helping users understand its purpose.


11-15: Good user guidance with info label.

The added info label effectively guides users to the appropriate action for retrieving page content, improving the overall user experience and reducing potential confusion.

components/notion/notion.app.mjs (2)

4-5: Appropriate imports for new functionality.

The imports for NotionConverter and DefaultExporter are correctly added to support the new markdown conversion capability.


360-373: Well-implemented markdown conversion method.

The getPageAsMarkdown method properly initializes the necessary components from the notion-to-md library and follows the correct pattern for converting Notion pages to markdown. The implementation is concise and effective.

components/notion/actions/retrieve-block/retrieve-block.mjs (3)

5-7: Improved naming and description for expanded functionality.

The name change from "Retrieve Block" to "Retrieve Page Content" better reflects the expanded capabilities. The updated description clearly communicates the action's ability to retrieve content in both block and markdown formats.


19-20: Clearer label and description for child blocks retrieval.

The updated label and description for the retrieveChildren property provide better clarity regarding its purpose, making it easier for users to understand what this option does.


24-29: Well-defined property for markdown retrieval.

The addition of the retrieveMarkdown property gives users control over the output format, with clear labeling and description.

@GTFalcao GTFalcao merged commit 7de6b87 into master Apr 7, 2025
10 of 11 checks passed
@GTFalcao GTFalcao deleted the notion-markdown-addition branch April 7, 2025 23:40
@vunguyenhung
Copy link
Collaborator

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants