Skip to content

[FEATURE] Facebook Pages - Migrate to Marketing API v23.0 #17701

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Jul 18, 2025

WHY

Resolves #17633

Summary by CodeRabbit

  • Refactor

    • Improved header management and simplified URL handling for Facebook Marketing integration.
    • Removed dynamic API versioning from Facebook Marketing requests.
    • Deleted the Facebook Pages app integration.
  • Chores

    • Updated documentation links in Facebook Marketing actions.
    • Increased version numbers for Facebook Marketing actions and package.
    • Updated dependencies for Facebook Marketing and Facebook Pages components.

@jcortes jcortes self-assigned this Jul 18, 2025
Copy link

vercel bot commented Jul 18, 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) Jul 18, 2025 10:50pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 18, 2025 10:50pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 18, 2025 10:50pm

Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Walkthrough

The changes update Facebook Marketing and Facebook Pages components. Documentation URLs in action metadata are updated to specify the English locale, and version numbers are incremented. The Facebook Marketing app refactors header and base URL logic, removing dynamic API versioning. The Facebook Pages app is deleted, and dependency versions are updated in both packages.

Changes

File(s) Change Summary
facebook_marketing/actions/add-email-to-custom-audience.mjs
.../create-custom-audience.mjs
Updated action metadata: documentation URLs now include ?locale=en_US; incremented version numbers.
facebook_marketing/facebook_marketing.app.mjs Refactored: removed _apiVersion, simplified _baseUrl, added _headers, updated _makeRequest.
facebook_marketing/package.json
facebook_pages/package.json
Updated @pipedream/platform dependency to ^3.1.0; incremented facebook_marketing package version.
facebook_pages/app/facebook_pages.app.ts Deleted Facebook Pages app definition and its authKeys method.

Sequence Diagram(s)

sequenceDiagram
    participant Action
    participant FacebookMarketingApp
    participant FacebookAPI

    Action->>FacebookMarketingApp: Call _makeRequest({ path, ... })
    FacebookMarketingApp->>FacebookMarketingApp: Call _headers() for Authorization
    FacebookMarketingApp->>FacebookAPI: Send request with fixed base URL and headers
    FacebookAPI-->>FacebookMarketingApp: Respond
    FacebookMarketingApp-->>Action: Return response
Loading

Poem

A bunny hopped through fields of code,
URLs now speak in English mode.
Headers tidied, versions rise,
Old app gone—no need for sighs!
With dependencies fresh and new,
Facebook’s APIs shine bright and true.
🐇✨

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/facebook_marketing/actions/add-email-to-custom-audience/add-email-to-custom-audience.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/facebook_marketing/actions/create-custom-audience/create-custom-audience.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/facebook_marketing/facebook_marketing.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202: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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d45031e and 115a1a5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • components/facebook_marketing/actions/add-email-to-custom-audience/add-email-to-custom-audience.mjs (1 hunks)
  • components/facebook_marketing/actions/create-custom-audience/create-custom-audience.mjs (1 hunks)
  • components/facebook_marketing/facebook_marketing.app.mjs (1 hunks)
  • components/facebook_marketing/package.json (2 hunks)
  • components/facebook_pages/app/facebook_pages.app.ts (0 hunks)
  • components/facebook_pages/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • components/facebook_pages/app/facebook_pages.app.ts
🧰 Additional context used
🧠 Learnings (5)
components/facebook_pages/package.json (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
components/facebook_marketing/actions/add-email-to-custom-audience/add-email-to-custom-audience.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/facebook_marketing/actions/create-custom-audience/create-custom-audience.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/facebook_marketing/facebook_marketing.app.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14906
File: components/chargebee/chargebee.app.mjs:44-68
Timestamp: 2024-12-11T20:39:04.063Z
Learning: In the new version of the Chargebee module, API method calls already execute the request and return a Promise, so there's no need to call the `.request()` method.
components/facebook_marketing/package.json (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
🔇 Additional comments (7)
components/facebook_pages/package.json (1)

16-16: Verify compatibility for @pipedream/platform v3 upgrade in facebook_pages component

The dependency was bumped from ^1.5.1 to ^3.1.0, a major release that may include breaking changes. Ensure the component code still works as expected:

  • components/facebook_pages/package.json
    • Dependency updated to "@pipedream/platform": "^3.1.0"
  • components/facebook_pages/facebook_pages.app.mjs
    • Confirm the file exists and review all import/require statements from @pipedream/platform
    • Update any changed method names or signatures per the v3.x release notes
  • Run the component’s unit/integration tests to catch any regressions
components/facebook_marketing/package.json (2)

3-3: LGTM: Appropriate version increment.

The patch version bump from 0.1.0 to 0.1.1 is appropriate for the metadata updates and refactoring changes made in this PR.


16-16: ✅ Platform v3 Compatibility Checked

All references to @pipedream/platform in the Facebook Marketing component resolve to a single import of axios, which remains available in v3.x:

  • components/facebook_marketing/facebook_marketing.app.mjs:1
    import { axios } from "@pipedream/platform";

No other platform APIs are used. No breaking changes detected.

components/facebook_marketing/actions/add-email-to-custom-audience/add-email-to-custom-audience.mjs (1)

7-8: LGTM: Improved documentation consistency.

The addition of the locale parameter (?locale=en_US) to the documentation URL ensures consistent English documentation, and the version increment appropriately reflects the metadata update.

components/facebook_marketing/actions/create-custom-audience/create-custom-audience.mjs (1)

6-7: LGTM: Consistent metadata improvements.

The documentation URL and version updates follow the same beneficial pattern as the other action, ensuring consistency across the component.

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

62-66: LGTM: Good refactoring of header management.

Centralizing header construction in the _headers method improves maintainability and consistency across API calls.


67-75: No callers pass custom headers—signature change is safe.

I searched all _makeRequest( calls in components/facebook_marketing and found none that pass a headers option. Since _makeRequest is only used internally by these methods, removing the explicit headers parameter won’t break existing usage.

Comment on lines 59 to +61
_baseUrl() {
return `https://graph.facebook.com/${this._apiVersion()}`;
return "https://graph.facebook.com";
},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify API versioning strategy for v23.0 migration.

The removal of dynamic API versioning from the base URL is a significant change. Ensure that the Facebook Marketing API v23.0 is properly specified elsewhere or that the default version aligns with the migration objective.


🏁 Script executed:

#!/bin/bash
# Check how API versioning is handled across the component

echo "=== Checking for API version references ==="
rg -A 3 -B 3 "v[0-9]+\." components/facebook_marketing/

echo "=== Checking API endpoint patterns ==="
rg -A 5 "graph\.facebook\.com" components/facebook_marketing/

echo "=== Checking for version-specific API calls ==="
ast-grep --pattern '$_/v$_/$_'

Length of output: 942


Enforce explicit Facebook API version (v23.0) in requests

I didn’t find any references to an API version in the codebase—calls will go to the default “graph.facebook.com” endpoint, which may break when Facebook deprecates older defaults.

• In components/facebook_marketing/facebook_marketing.app.mjs, update _baseUrl() to include /v23.0 (e.g. return "https://graph.facebook.com/v23.0").
• Or prepend /v23.0 to each request path in _makeRequest.
• Verify all endpoints now target v23.0 to align with the migration goal.

🤖 Prompt for AI Agents
In components/facebook_marketing/facebook_marketing.app.mjs around lines 59 to
61, the _baseUrl method returns the Facebook API base URL without specifying an
explicit API version, which risks breaking when defaults change. Update the
_baseUrl method to return "https://graph.facebook.com/v23.0" to enforce using
version v23.0 of the API consistently across all requests. Verify that all
request paths use this updated base URL to ensure alignment with the migration
goal.

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.

[FEATURE] Facebook Pages - Migrate to Marketing API v23.0
1 participant