Skip to content

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 11, 2025

Resolves #18300
Resolves #18306

Summary by CodeRabbit

  • New Features
    • Create/Update Page and Create/Update Landing Page actions now accept optional widget containers and widgets data for richer page composition.
  • Chores
    • Bumped action versions to reflect payload enhancements (including listing pages).
    • Incremented HubSpot component package version to 1.7.3.

Copy link

vercel bot commented Sep 11, 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 11, 2025 9:44pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 11, 2025 9:44pm

Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Adds optional widgetContainers and widgets to the shared page-prop schema; includes those fields (parsed) in create/update payloads for pages and landing pages; bumps action and component versions; renames an internal accumulator from results to pages in list-pages without changing behavior.

Changes

Cohort / File(s) Summary of Changes
Schema augmentation
components/hubspot/actions/common/common-page-prop.mjs
Add optional object properties widgetContainers and widgets to the exported page-prop schema.
Create/Update payload extensions
components/hubspot/actions/create-page/create-page.mjs, components/hubspot/actions/update-page/update-page.mjs, components/hubspot/actions/create-landing-page/create-landing-page.mjs, components/hubspot/actions/update-landing-page/update-landing-page.mjs
Bump action versions. Include widgetContainers: parseObject(this.widgetContainers) and widgets: parseObject(this.widgets) in HubSpot create/update payloads.
List pages internal rename
components/hubspot/actions/list-pages/list-pages.mjs
Bump version. Rename internal accumulator from resultspages across initialization, pushes, summary, and return. No change to external behavior.
Package version bump
components/hubspot/package.json
Package version updated 1.7.21.7.3.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Create/Update Action
  participant Parser as parseObject
  participant HS as HubSpot CMS API

  User->>Action: invoke action (page inputs ...)
  rect rgba(200,230,255,0.25)
    note right of Action: New/changed payload fields
    Action->>Parser: parseObject(this.widgetContainers)
    Parser-->>Action: widgetContainers (object)
    Action->>Parser: parseObject(this.widgets)
    Parser-->>Action: widgets (object)
  end
  Action->>HS: POST/PATCH payload { ..., widgetContainers, widgets, ... }
  HS-->>Action: response (created/updated resource)
  Action-->>User: return result (summary, data)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitched my nose at page-time tricks,
Pulled widgets snug into their mix.
Containers, modules, packed just right,
Versions hopped up, ready for flight.
A rabbit’s cheer — deploy tonight! 🥕


📜 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 ce5171a and 8e6cff1.

📒 Files selected for processing (1)
  • components/hubspot/actions/create-page/create-page.mjs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/hubspot/actions/create-page/create-page.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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base

Pre-merge checks (3 passed, 2 warnings)

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR contains at least one change that appears unrelated to the linked issue: components/hubspot/actions/list-pages/list-pages.mjs renames the accumulator from results to pages and bumps that action's version, which is not part of the widgets objective; package.json version bump and updates to create/update-landing actions may also broaden the scope without explicit justification in the description. Either split the unrelated refactor/version changes (for example the list-pages accumulator rename and its version bump) into a separate PR or document and justify them in this PR description, and ensure any refactors include tests or release notes so reviewers can evaluate those changes independently of the widgets fix.
Description Check ⚠️ Warning The current PR description only lists "Resolves #18300" and "Resolves #18306" and does not follow the repository's required template which expects a "WHY" section describing the rationale. It lacks a concise summary of what changed, the motivation and impact, files modified, and any testing or migration notes, so reviewers cannot quickly assess intent or risk. Because the required template structure and essential contextual information are missing, the description check fails. Please update the PR description to follow the repository template by adding a "WHY" section that explains the motivation and links to the referenced issues, plus a brief summary of the changes (key files, public API or payload changes like widgetContainers/widgets, and version bumps). Also include testing/validation steps and any compatibility or migration considerations so reviewers can assess impact and verify behavior. Keeping the description aligned with the template will make review faster and reduce follow-up questions.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Hubspot - add widget props" is concise, focused, and accurately summarizes the primary change (adding widget-related properties to the HubSpot page actions and schema), so it communicates the main intent to reviewers at a glance.
Linked Issues Check ✅ Passed The changes directly address the linked issue: common-page-prop.mjs adds widgetContainers and widgets properties and components/hubspot/actions/update-page/update-page.mjs now includes widgetContainers and widgets in the payload (using parseObject), which enables supplying full widget definitions for page updates as required by the HubSpot CMS Pages API; create/update-landing-page and create-page were similarly extended.
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-18300

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.

@michelle0927 michelle0927 marked this pull request as ready for review September 11, 2025 19:46
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 (6)
components/hubspot/actions/list-pages/list-pages.mjs (1)

108-113: Avoid a no-op extra loop iteration at maxResults.

Set hasMore = false before breaking the inner loop.

Apply this diff:

         count++;
         if (count >= this.maxResults) {
-          break;
+          hasMore = false;
+          break;
         }
components/hubspot/actions/common/common-page-prop.mjs (1)

79-90: Add explicit guidance that HubSpot requires full widget definitions.

Tighten descriptions so users know partial updates aren’t supported.

Apply this diff:

   widgetContainers: {
     type: "object",
     label: "Widget Containers",
-    description: "A data structure containing the data for all the modules inside the containers for this page",
+    description: "JSON for all modules inside containers on this page. Provide full definitions; HubSpot does not support partial widget updates.",
     optional: true,
   },
   widgets: {
     type: "object",
     label: "Widgets",
-    description: "A data structure containing the data for all the modules for this page",
+    description: "JSON for all modules on this page (outside containers). Provide full definitions; HubSpot does not support partial widget updates.",
     optional: true,
   },
components/hubspot/actions/update-landing-page/update-landing-page.mjs (1)

56-58: Only include widget fields when provided to avoid undefined keys.

Prevents sending undefined and keeps payload minimal.

Apply this diff:

         templatePath: this.templatePath,
-        widgetContainers: parseObject(this.widgetContainers),
-        widgets: parseObject(this.widgets),
+        ...(this.widgetContainers !== undefined
+          ? { widgetContainers: parseObject(this.widgetContainers) }
+          : {}),
+        ...(this.widgets !== undefined
+          ? { widgets: parseObject(this.widgets) }
+          : {}),
components/hubspot/actions/create-page/create-page.mjs (1)

39-41: Only include widget fields when provided to avoid undefined keys.

Apply this diff:

         templatePath: this.templatePath,
-        widgetContainers: parseObject(this.widgetContainers),
-        widgets: parseObject(this.widgets),
+        ...(this.widgetContainers !== undefined
+          ? { widgetContainers: parseObject(this.widgetContainers) }
+          : {}),
+        ...(this.widgets !== undefined
+          ? { widgets: parseObject(this.widgets) }
+          : {}),
components/hubspot/actions/create-landing-page/create-landing-page.mjs (1)

47-49: Only include widget fields when provided to avoid undefined keys.

Apply this diff:

         templatePath: this.templatePath,
-        widgetContainers: parseObject(this.widgetContainers),
-        widgets: parseObject(this.widgets),
+        ...(this.widgetContainers !== undefined
+          ? { widgetContainers: parseObject(this.widgetContainers) }
+          : {}),
+        ...(this.widgets !== undefined
+          ? { widgets: parseObject(this.widgets) }
+          : {}),
components/hubspot/actions/update-page/update-page.mjs (1)

48-50: Only include widget fields when provided to avoid undefined keys.

Apply this diff:

         templatePath: this.templatePath,
-        widgetContainers: parseObject(this.widgetContainers),
-        widgets: parseObject(this.widgets),
+        ...(this.widgetContainers !== undefined
+          ? { widgetContainers: parseObject(this.widgetContainers) }
+          : {}),
+        ...(this.widgets !== undefined
+          ? { widgets: parseObject(this.widgets) }
+          : {}),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 944bcf0 and ce5171a.

📒 Files selected for processing (7)
  • components/hubspot/actions/common/common-page-prop.mjs (1 hunks)
  • components/hubspot/actions/create-landing-page/create-landing-page.mjs (2 hunks)
  • components/hubspot/actions/create-page/create-page.mjs (2 hunks)
  • components/hubspot/actions/list-pages/list-pages.mjs (4 hunks)
  • components/hubspot/actions/update-landing-page/update-landing-page.mjs (2 hunks)
  • components/hubspot/actions/update-page/update-page.mjs (2 hunks)
  • components/hubspot/package.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
components/hubspot/actions/create-page/create-page.mjs (1)
components/hubspot/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
components/hubspot/actions/create-landing-page/create-landing-page.mjs (1)
components/hubspot/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
components/hubspot/actions/update-landing-page/update-landing-page.mjs (1)
components/hubspot/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
components/hubspot/actions/update-page/update-page.mjs (1)
components/hubspot/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
🔇 Additional comments (7)
components/hubspot/package.json (1)

3-3: Patch bump looks right.

Aligns with action version bumps in this PR.

components/hubspot/actions/list-pages/list-pages.mjs (1)

8-8: Rename to pages + version bump — LGTM.

Naming is clearer and summary matches the return value.

Also applies to: 82-82, 108-108, 120-124, 124-124

components/hubspot/actions/common/common-page-prop.mjs (1)

79-90: Confirmed — CMS Pages v3 expects camelCase widgets and widgetContainers; include the full object when updating modules.

Neither field is universally required; include the full widgets object for top-level template modules or the full widgetContainers object for modules inside containers. Partial merges aren't supported — omitting the full object will overwrite/clear draft data.

File: components/hubspot/actions/common/common-page-prop.mjs (lines 79–90): property names are correct.

components/hubspot/actions/update-landing-page/update-landing-page.mjs (1)

10-10: Version bump — LGTM.

components/hubspot/actions/create-page/create-page.mjs (1)

10-10: Version bump — LGTM.

components/hubspot/actions/create-landing-page/create-landing-page.mjs (1)

10-10: Version bump — LGTM.

components/hubspot/actions/update-page/update-page.mjs (1)

10-10: Version bump — LGTM.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927. I just added a minor suggestion.

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] "list pages" in Hubspot always returns empty list [ACTION] Hubspot Page - Widgets missing from the update page action
2 participants