Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 22, 2025

Resolves #18423

Summary by CodeRabbit

  • Chores

    • Bumped HubSpot package version to 1.7.7.
    • Updated action versions to 0.0.8 for listing blog posts, campaigns, marketing emails, and marketing events.
  • Refactor

    • Improved internal consistency and clarity across list actions, aligning data accumulation and summaries without changing behavior.

End-user impact: No functional changes; actions continue to list items with pagination as before.

@vercel
Copy link

vercel bot commented Sep 22, 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 22, 2025 3:46pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 22, 2025 3:46pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

Walkthrough

Version numbers were incremented across HubSpot actions and package.json. In four actions, the internal accumulator variable was renamed (results → posts/campaigns/emails/events), and corresponding summary strings and return values now reference the new arrays. No method signatures or control flow changed; functionality remains to fetch paginated items.

Changes

Cohort / File(s) Summary of Changes
HubSpot actions: accumulator rename + version bump
components/hubspot/actions/list-blog-posts/list-blog-posts.mjs, components/hubspot/actions/list-campaigns/list-campaigns.mjs, components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs, components/hubspot/actions/list-marketing-events/list-marketing-events.mjs
Bumped action versions 0.0.7 → 0.0.8. Renamed internal accumulator from results to resource-specific arrays (posts, campaigns, emails, events). Updated pushes, summary counts, and return values to use the new arrays. No signature or control-flow changes.
Package version
components/hubspot/package.json
Version updated 1.7.6 → 1.7.7. No other field changes.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny taps keys with careful delight,
Renaming results in the soft twilight.
Posts, campaigns, emails, events—neat!
Versions hop forward on tidy feet.
Carrots aligned, packages set—
Another small merge, the cleanest yet. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning This pull request also renames accumulators and bumps versions for blog posts, campaigns, marketing events, and updates the package.json version, which are not related to the single linked issue that only concerns the “List Marketing Emails” action. Please split unrelated version bumps and accumulator renames for blog posts, campaigns, and events into separate pull requests or justify why they should be included alongside the email fix.
Description Check ⚠️ Warning The pull request description only contains “Resolves #18423” and does not follow the repository’s required template, which calls for a “## WHY” section explaining the motivation and context of the change. Please update the description to include the “## WHY” heading and provide a concise explanation of the bug being fixed, why the change is necessary, and any other relevant context per the repository’s template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly identifies that the Hubspot integration’s list actions are being fixed for bugs and is directly aligned with the main change in the pull request, making it clear to a reader what the PR addresses without extraneous detail.
Linked Issues Check ✅ Passed The pull request correctly implements the core fix for issue #18423 by renaming the internal accumulator from “results” to “emails” and updating the return value so that the “List Marketing Emails” action no longer returns an empty list.
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-18423

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

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-marketing-events/list-marketing-events.mjs (1)

21-23: Use dynamic limit tied to maxResults.

Avoid fetching 100 items per page when maxResults is smaller.

Example change (outside the changed hunk):

const params = {
  limit: Math.min(100, this.maxResults),
};
components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs (2)

91-101: Set limit to align with maxResults and reduce API calls.

Add a per-page limit (capped by HubSpot’s max) to minimize requests.

Example change (outside the changed hunk):

const params = {
  createdAt: this.createdAt,
  createdAfter: this.createdAfter,
  createdBefore: this.createdBefore,
  updatedAt: this.updatedAt,
  updatedAfter: this.updatedAfter,
  updatedBefore: this.updatedBefore,
  includeStats: this.includeStats,
  archived: this.archived,
  sort: this.sort,
  limit: Math.min(100, this.maxResults),
};

103-123: Minor pagination nit: avoid setting after when there’s no next page.

Harmless, but you can guard the assignment for readability.

-      hasMore = paging?.next.after;
-      params.after = paging?.next.after;
+      hasMore = paging?.next?.after;
+      if (hasMore) params.after = hasMore;
components/hubspot/actions/list-blog-posts/list-blog-posts.mjs (2)

81-82: Rename is correct; fix summary wording (“post” vs “page”).

The accumulator/return change is good. The summary string should say “post(s)”.

Apply:

-      `Found ${posts.length} page${posts.length === 1
+      `Found ${posts.length} post${posts.length === 1
         ? ""
         : "s"}`,

Also applies to: 107-108, 119-124


85-95: Add limit to pagination params (efficiency).

Same rationale as other actions: fewer requests when maxResults is small.

Example change (outside the changed hunk):

const params = {
  createdAt: this.createdAt,
  createdAfter: this.createdAfter,
  createdBefore: this.createdBefore,
  updatedAt: this.updatedAt,
  updatedAfter: this.updatedAfter,
  updatedBefore: this.updatedBefore,
  archived: this.archived,
  sort: this.sort,
  limit: Math.min(100, this.maxResults),
};
components/hubspot/actions/list-campaigns/list-campaigns.mjs (1)

39-41: Add per-page limit (cap 100) to HubSpot campaigns list params

Set per-page limit to Math.min(100, this.maxResults) to avoid extra requests when maxResults is small — HubSpot supports ?limit=1–100 (default 50, max 100).

File: components/hubspot/actions/list-campaigns/list-campaigns.mjs (around lines 39–41)

const params = {
  sort: this.sort,
  limit: Math.min(100, this.maxResults),
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6545da9 and f2c28bf.

📒 Files selected for processing (5)
  • components/hubspot/actions/list-blog-posts/list-blog-posts.mjs (4 hunks)
  • components/hubspot/actions/list-campaigns/list-campaigns.mjs (4 hunks)
  • components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs (4 hunks)
  • components/hubspot/actions/list-marketing-events/list-marketing-events.mjs (4 hunks)
  • components/hubspot/package.json (1 hunks)
⏰ 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
🔇 Additional comments (4)
components/hubspot/package.json (1)

3-3: Version bump aligns with action updates.

Patch version increment to 1.7.7 looks appropriate for a bug fix release linked to #18423.

Please confirm a release note/changelog entry calls out the fix for “List Marketing Emails returns empty array”.

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

35-36: Accumulator rename + return fix look good.

Using campaigns consistently and returning it should prevent empty outputs from variable mismatches.

Also applies to: 54-55, 66-71

components/hubspot/actions/list-marketing-events/list-marketing-events.mjs (1)

20-20: Good: consistent events accumulator and return.

Prevents the empty-array issue from mismatched identifiers.

Also applies to: 38-39, 50-55

components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs (1)

87-88: This likely fixes the “always empty” bug.

Collecting into emails and returning emails resolves the prior accumulator/return mismatch.

Please run a quick smoke test on an account with known emails to confirm non-empty results and correct pagination behavior.

Also applies to: 114-115, 126-131

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, LGTM! Ready for QA!

@vunguyenhung vunguyenhung merged commit 7fe3f13 into master Sep 24, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18423 branch September 24, 2025 05:27
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 marketing emails" in Hubspot always returns empty list

4 participants