-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThe 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
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
Poem
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
components/facebook_marketing/actions/add-email-to-custom-audience/add-email-to-custom-audience.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/facebook_marketing/actions/create-custom-audience/create-custom-audience.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/facebook_marketing/facebook_marketing.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
⛔ 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 componentThe 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 allimport
/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 CheckedAll references to
@pipedream/platform
in the Facebook Marketing component resolve to a single import ofaxios
, 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 incomponents/facebook_marketing
and found none that pass aheaders
option. Since_makeRequest
is only used internally by these methods, removing the explicitheaders
parameter won’t break existing usage.
_baseUrl() { | ||
return `https://graph.facebook.com/${this._apiVersion()}`; | ||
return "https://graph.facebook.com"; | ||
}, |
There was a problem hiding this comment.
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.
WHY
Resolves #17633
Summary by CodeRabbit
Refactor
Chores