Skip to content

Conversation

@GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Jul 2, 2025

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

    • Added an action to retrieve the authenticated user's LinkedIn profile picture data, with an option to include the original image if permissions allow.
  • Improvements

    • Simplified and improved the experience for retrieving organization access control and administrator information by allowing users to specify the organization by ID instead of a full URN.
    • Updated action descriptions with new documentation links and clearer information.
    • Refined access control data fetching to return only the first relevant item for streamlined results.
  • Bug Fixes

    • Adjusted data fetching in organization access control actions to improve reliability and consistency.
  • Chores

    • Updated the LinkedIn integration package version to 1.1.0.

@vercel
Copy link

vercel bot commented Jul 2, 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) Visit Preview Jul 2, 2025 5:38pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 2, 2025 5:38pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 2, 2025 5:38pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Walkthrough

The 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

File(s) Change Summary
components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs Updated description and version; simplified logic to fetch only a single access control element, removed pagination.
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs
Updated descriptions, versions, and documentation links; refactored to use organizationId prop instead of organizationUrn; updated API parameter handling.
components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs Introduced new action to retrieve authenticated user's profile picture fields with optional original image inclusion.
components/linkedin/linkedin.app.mjs Refactored getAccessControl method to use strParams and spread extra arguments, improved request path construction.
components/linkedin/package.json Bumped package version from 1.0.1 to 1.1.0.

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
Loading
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
Loading

Assessment against linked issues

Objective Addressed Explanation
Get current member's profile picture identifiers fields by including the projection parameter (#17237)
Submit GET https://api.linkedin.com/rest/organizationAcls?q=roleAssignee in member org access control action (#17250)

Poem

A bunny hops through LinkedIn code,
Fetching pictures, access bestowed.
IDs replace the URNs of old,
New docs and versions, changes bold.
With every hop, the features grow,
🐰✨ Profile pics and roles in tow!

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/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.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)


📜 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 f5ff6d1 and 973c26b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
✨ 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: 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 getProfilePictureFields method directly constructs the URL instead of using the established pattern with path parameter.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 85660f8 and f5ff6d1.

📒 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 params to strParams allows 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 includeOriginalImage is 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 change

Although 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 organizationId prop 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 strParams correctly aligns with the updated getAccessControl method 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 organizationId prop 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.

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}`;
Copy link
Contributor

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.

Suggested change
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.

Comment on lines +6 to +7
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",
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 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-06
    

    This 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:


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}`,
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 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.

Copy link
Collaborator

@jcortes jcortes left a 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!

@luancazarine luancazarine removed their request for review July 2, 2025 21:30
@GTFalcao
Copy link
Collaborator Author

GTFalcao commented Jul 4, 2025

/approve

@jcortes
Copy link
Collaborator

jcortes commented Jul 4, 2025

Hi @GTFalcao please fix component versions

@GTFalcao
Copy link
Collaborator Author

GTFalcao commented Jul 4, 2025

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).

@GTFalcao GTFalcao merged commit 6e90be3 into master Jul 4, 2025
10 of 11 checks passed
@GTFalcao GTFalcao deleted the 17237-linkedin-improvements branch July 4, 2025 17:23
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.

linkedin linkedin

3 participants