Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 24, 2025

Resolves #18447

Summary by CodeRabbit

  • New Features
    • Choose property types to control which Notion database properties are available when creating a page.
    • Properties now auto-populate from the selected data source and are filtered by chosen types.
  • Improvements
    • Property options refresh automatically when the parent data source changes.
  • Documentation
    • Clarified that selected property types override manual Properties selection.
  • Chores
    • Bumped Notion integration version to 1.0.3.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Adds dynamic property fetching to the Notion "Create Page from Data Source" action: introduces a new propertyTypes prop, sets reloadProps: true on relevant props, implements additionalProps() to fetch and filter data source properties, and bumps action/package version to 1.0.3.

Changes

Cohort / File(s) Summary
Notion action: dynamic properties restore
components/notion/actions/create-page-from-database/create-page-from-database.mjs
Import lodash-es/pick.js; bump action version to 1.0.3; add public prop propertyTypes (with parentId, parentType, description, reloadProps: true); set reloadProps: true on parentDataSource; add public async additionalProps() to fetch data source properties, filter by propertyTypes using pick, and return via buildAdditionalProps; wire additionalProps() to populate dynamic Properties.
Package version bump
components/notion/package.json
Bump package version from 1.0.2 to 1.0.3.
Whitespace only
components/cratedb_cloud/cratedb_cloud.app.mjs
Trailing newline added at EOF (no behavioral change).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Action UI
  participant Action as create-page-from-database
  participant Notion as Notion API

  User->>UI: Select Parent Data Source
  UI-->>Action: trigger reloadProps (parentDataSource)
  Action->>Notion: fetch database properties
  Notion-->>Action: return properties metadata

  User->>UI: Select propertyTypes
  UI-->>Action: trigger reloadProps (propertyTypes)
  Action->>Action: additionalProps() -> pick(selected propertyTypes)
  Action-->>UI: buildAdditionalProps() -> dynamic Properties fields

  User->>UI: Fill Properties and run action
  UI->>Action: execute create-page
  Action->>Notion: create page with selected properties
  Notion-->>Action: creation result
  Action-->>UI: show result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit nibbles through property trees,
Picks the keys you want with nimble ease.
Reloads the props, then hops away —
Pages created in a single day.
Version bumped, the burrow beams 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request includes an unrelated formatting change in the cratedb_cloud app file (a trailing newline addition) that is outside the scope of the Notion action update. Remove or isolate the formatting change to cratedb_cloud.app.mjs into a separate commit or PR to keep this changeset focused on the Notion action fix.
Description Check ⚠️ Warning The pull request description only includes a link to the issue resolution and does not follow the required template, as it lacks the “## WHY” section and an explanation of the changes’ purpose. Please update the description to include the “## WHY” heading and a brief summary explaining why these property updates and dynamic fetching were implemented.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title clearly and concisely describes the main change by indicating updates to the Notion Create Page from Data Source action’s property handling. It accurately reflects the enhanced property fetching functionality and is specific enough for team members to understand the purpose at a glance.
Linked Issues Check ✅ Passed The changes restore dynamic fetching of database properties by implementing the additionalProps method, integrating it into the action to generate individual fields for each property, thus fulfilling the core requirements of issue #18447.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18447

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38d7917 and 6ed3018.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/cratedb_cloud/cratedb_cloud.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/cratedb_cloud/cratedb_cloud.app.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 25, 2025 2:37pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 25, 2025 2:37pm

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/notion/actions/create-page-from-database/create-page-from-database.mjs (1)

109-111: Replace parent.data_source_id with parent.database_id. Notion’s pages.create API requires parent.database_id for database parents; using data_source_id will return a 400.

-      parent: { data_source_id: this.parentDataSource },
+      parent: { database_id: this.parentDataSource },

(components/notion/actions/create-page-from-database/create-page-from-database.mjs:109)

🧹 Nitpick comments (2)
components/notion/actions/create-page-from-database/create-page-from-database.mjs (2)

5-5: Optional: import without extension for consistency.

Using extensionless subpath imports is the common pattern in this repo.

Apply this diff:

-import pick from "lodash-es/pick.js";
+import pick from "lodash-es/pick";

31-42: Fix typo and clarify properties description
Update the description in components/notion/actions/create-page-from-database/create-page-from-database.mjs:

- description: "Select one or more page properties. Willl override properties set in the `Properties` prop below.",
+ description: "Select one or more page properties. If none are selected, all properties will be exposed. This overrides the `Properties` prop below.",

ParentType remains "data_source"—consistent with all other Notion components.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5742b2 and 38d7917.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/notion/actions/create-page-from-database/create-page-from-database.mjs (3 hunks)
  • components/notion/package.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/notion/actions/create-page-from-database/create-page-from-database.mjs (1)
components/notion/actions/update-page/update-page.mjs (2)
  • selectedProperties (64-64)
  • properties (89-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/notion/package.json (1)

3-3: Version bump aligns with action changes. LGTM.

components/notion/actions/create-page-from-database/create-page-from-database.mjs (2)

12-12: Action version bump looks correct.


23-23: Good: reloadProps on parent data source.

lcaresia
lcaresia previously approved these changes Sep 24, 2025
@michelle0927
Copy link
Collaborator Author

/approve

1 similar comment
@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 0b8ba5c into master Sep 29, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-18447 branch September 29, 2025 14: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.

[BUG] Notion: Create Page from Data Source action has major regression

3 participants