-
Notifications
You must be signed in to change notification settings - Fork 5.5k
LinkedIn improvements and new action #17401
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe changes update several LinkedIn integration actions and the core app logic. They introduce a new action for retrieving a user's profile picture fields, refactor organization-related actions to use organization IDs instead of URNs, update API documentation links and versions, and simplify access control data retrieval. The core app method for access control was also refactored. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant LinkedInApp
participant LinkedInAPI
User->>Action: Trigger "Get Profile Picture Fields"
Action->>LinkedInApp: getProfilePictureFields({ projection })
LinkedInApp->>LinkedInAPI: GET /v2/me?projection=...
LinkedInAPI-->>LinkedInApp: Profile picture data
LinkedInApp-->>Action: Return profile picture fields
Action-->>User: Return profile picture fields
sequenceDiagram
participant User
participant Action
participant LinkedInApp
participant LinkedInAPI
User->>Action: Trigger "Get Member Organization Access Control"
Action->>LinkedInApp: getAccessControl({ strParams: "q=roleAssignee&..." })
LinkedInApp->>LinkedInAPI: GET /organizationAcls?q=roleAssignee&...
LinkedInAPI-->>LinkedInApp: Access control data
LinkedInApp-->>Action: Return first element
Action-->>User: Return single access control element
Assessment against linked issues
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/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ 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: 4
🧹 Nitpick comments (1)
components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (1)
21-26: Consider using the existing app method pattern.The
getProfilePictureFieldsmethod directly constructs the URL instead of using the established pattern withpathparameter.Apply this diff to align with the app's established pattern:
- getProfilePictureFields(args) { - return this.linkedin._makeRequest({ - url: `${constants.BASE_URL}v2/me`, - ...args, - }); - }, + getProfilePictureFields(args) { + return this.linkedin._makeRequest({ + path: "/me", + ...args, + }); + },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs(2 hunks)components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs(2 hunks)components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs(1 hunks)components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs(1 hunks)components/linkedin/linkedin.app.mjs(1 hunks)components/linkedin/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Ensure component commits modify component versions
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (10)
components/linkedin/linkedin.app.mjs (1)
237-246: LGTM! Method signature improvement enhances flexibility.The refactoring from
paramstostrParamsallows for pre-formatted query strings, which is more flexible than the previous object-based approach. The conditional query string appending and spread operator usage are implemented correctly.components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (2)
29-36: LGTM! Dynamic projection construction is well implemented.The conditional projection parameter building based on
includeOriginalImageis clean and handles the API requirements correctly.
45-49: LGTM! Appropriate summary messages based on response.The conditional summary export provides clear feedback about whether profile picture data was found or not.
components/linkedin/package.json (1)
3-3: LGTM! Version bump is appropriate for these changes.The minor version increment from 1.0.1 to 1.1.0 correctly reflects the addition of new functionality and API changes.
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs (1)
36-36: Confirm and document this intentional breaking changeAlthough no internal references to this action were found in the repo, changing from paginated results to a single‐item response is still a breaking change for any external workflows consuming it. Please:
• Review components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs around line 36 where you’ve added
- count: 20, // previous default page size + count: 1, // now fetching only the first element … - return elements; // previously returned an array + return elements[0]; // now returns a single object• Ensure downstream consumers (templates, integrations, or users of this action) are updated to handle a single object instead of an array.
• Consider bumping the action’s major version or providing a toggle/parameter to opt into single-item versus full pagination.components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs (3)
11-17: LGTM! Improved UX with predefined organization ID prop.Using the predefined
organizationIdprop definition provides better user experience with auto-complete options compared to requiring manual URN input.
24-26: LGTM! Proper URN construction and encoding.The URN construction and URL encoding using
replace(/:/g, "%3A")is implemented correctly for the API requirements.
31-31: LGTM! Correct usage of updated app method signature.The parameter passing using
strParamscorrectly aligns with the updatedgetAccessControlmethod signature in the LinkedIn app.components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs (2)
11-16: LGTM! Good use of prop definition for consistency.Using the
organizationIdprop definition from the LinkedIn app promotes consistency across actions and provides better reusability.
30-30: LGTM! Clear URN construction.The organization URN construction from the ID is clear and follows LinkedIn's URN format convention.
...in/actions/get-member-organization-access-control/get-member-organization-access-control.mjs
Show resolved
Hide resolved
| const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&count=${count}`; | ||
| const organizationUrn = `urn:li:organization:${this.organizationId}`; | ||
|
|
||
| const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`; |
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.
🛠️ Refactor suggestion
Replace manual URL encoding with proper encoding function.
The manual replacement of colons with %3A is not robust and could miss other characters that need encoding. Consider using JavaScript's built-in encodeURIComponent() function for proper URL encoding.
- const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
+ const params = `q=organization&organization=${encodeURIComponent(organizationUrn)}&count=${count}`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`; | |
| const params = `q=organization&organization=${encodeURIComponent(organizationUrn)}&count=${count}`; |
🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
at line 32, replace the manual colon replacement in the organizationUrn string
with a call to encodeURIComponent() to properly encode the entire parameter
value. This ensures all special characters are correctly encoded instead of only
colons.
| description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)", | ||
| version: "0.2.0", |
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 the updated documentation URL is accessible.
The documentation URL has been updated to Microsoft's LinkedIn API documentation. Please ensure this URL is accessible and points to the correct documentation for the organization access control endpoint.
🌐 Web query:
Is the LinkedIn API documentation URL https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control accessible and valid?
💡 Result:
The URL you provided for the LinkedIn API documentation:
https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control
is not valid or accessible as a current, up-to-date documentation page.
-
The URL points to a specific version of the documentation (
li-lms-2025-01), which appears to be outdated. According to LinkedIn's Microsoft Learn documentation, Marketing Version 202406 (June 2024) has been sunset, and developers are advised to migrate to the latest versioned APIs to avoid disruptions[3][6][7]. -
The current supported documentation for "Organization Access Control by Role" can be found under a newer version, such as
li-lms-2025-06(June 2025), for example:https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-06This version contains the latest information, deprecation warnings, and migration recommendations[3].
-
If you visit the URL with
view=li-lms-2025-01, it is likely to redirect, display a deprecation notice, or not show the most current API details[3][6][7]. Always use the documentation for the most recent supported version.
Recommendation:
Use the latest documentation version by replacing the version tag in the URL (e.g., ?view=li-lms-2025-06) to ensure you are seeing up-to-date and supported LinkedIn API information[3][6][7].
Citations:
- 1: https://evaboot.com/blog/what-is-linkedin-api
- 2: https://learn.microsoft.com/en-us/linkedin/compliance/integrations/organizations/organization-access-control
- 3: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-06
- 4: https://scrupp.com/blog/linkedin-api
- 5: https://www.unipile.com/linkedin-api-a-comprehensive-guide-to-integration/
- 6: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-lookup-api?view=li-lms-2025-06
- 7: https://learn.microsoft.com/en-us/linkedin/marketing/versioning?view=li-lms-2025-06
- 8: https://www.getphyllo.com/post/linkedin-api-ultimate-guide-on-linkedin-api-integration
- 9: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/community-management-overview?view=li-lms-2025-06
- 10: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api?view=li-lms-2025-06
Outdated LinkedIn API documentation version
The current link uses view=li-lms-2025-01, which is no longer up-to-date or accessible. Please update it to the latest supported version (li-lms-2025-06) to ensure developers see the correct endpoint details.
• File: components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)",
-version: "0.2.0",
+description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-06&tabs=http#find-organization-access-control)",
version: "0.2.0",Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
around lines 6 to 7, the LinkedIn API documentation URL uses an outdated version
parameter 'view=li-lms-2025-01'. Update this parameter to the latest supported
version 'li-lms-2025-06' in the description string to ensure the documentation
link points to the current API details.
| do { | ||
| const { data: { elements } } = await this.linkedin.getAccessControl({ | ||
| params: params + `&start=${start}`, | ||
| strParams: params + `&start=${start}`, |
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 parameter name consistency with LinkedIn app method.
The parameter name changed from params to strParams. Ensure this aligns with the updated method signature in the LinkedIn app and that all related actions use consistent parameter naming.
🏁 Script executed:
#!/bin/bash
# Description: Verify the getAccessControl method signature and parameter usage across LinkedIn actions
# Search for the getAccessControl method definition in the LinkedIn app
ast-grep --pattern 'getAccessControl($_, $_) {
$$$
}'
# Search for all usages of getAccessControl to ensure consistent parameter naming
rg -A 3 'getAccessControl\('Length of output: 1927
Ensure all getAccessControl calls use strParams
The app’s getAccessControl({ strParams, … }) signature requires a strParams key—only the member-organization action still passes params. Update this to prevent runtime errors.
• components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs
await this.linkedin.getAccessControl({
$,
- params,
+ strParams: params,
});Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
at line 37, the call to getAccessControl incorrectly uses params instead of
strParams. Update the call to pass strParams with the correct string parameter
value to match the expected function signature and avoid runtime errors.
jcortes
left a comment
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.
Hi @GTFalcao lgtm! Ready for QA!
|
/approve |
|
Hi @GTFalcao please fix component versions |
|
Thanks for the reminder Jorge. I've double checked that all components updated in this PR had their version updated, so I'll skip bumping the versions of ones that were not modified (since the automated check does not take that into account). |
Closes #17237
Closes #17250
Added async options to three existing actions as well
Note: I've only bumped the versions of components that were changed
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores