Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Sep 29, 2025

Resolves #17539

Summary by CodeRabbit

  • New Features

    • Export organization charts to PDF and Excel files.
    • Retrieve organization chart details for a selected company.
    • Search companies to find organization chart IDs, with result counts.
    • Search executives by name.
    • Fetch detailed executive biographies.
  • Chores

    • Bumped integration version to 0.1.0.
    • Added a platform dependency to support new actions.

…s for exporting org charts as PDF and XLSX, and retrieving executive and org chart information.
@luancazarine luancazarine linked an issue Sep 29, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Sep 29, 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 29, 2025 10:44pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 29, 2025 10:44pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Adds five new action modules for The Official Board (export org chart as PDF/XLSX, get org chart info, get executive info, search companies, search executives). Refactors the app module into a structured API client with request helpers and prop definitions. Updates package version and adds a platform dependency.

Changes

Cohort / File(s) Summary
Orgchart file export actions
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs, components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs
New actions to export organization charts as PDF/XLSX. Call app methods to fetch binary content, write to /tmp/<filename>, set $summary, and return file metadata.
Data retrieval/search actions
components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs, components/the_official_board/actions/get-executive-info/get-executive-info.mjs, components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs, components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs
New actions to get org chart info, get executive biography, search companies, and search executives. Each wires props to app propDefinitions, calls corresponding app method, sets $summary, and returns API response.
App client refactor
components/the_official_board/the_official_board.app.mjs
Replaces placeholder with REST client: adds propDefinitions (companyId, executiveId), request helpers (_baseApiUrl, _headers, _makeRequest), and endpoint methods (getExecutiveSearch, getCompanySearch, getCompanyOrgchart, exportOrgchartExcel, exportOrgchartPdf, getExecutiveBiography). Removes authKeys().
Package manifest
components/the_official_board/package.json
Bumps version to 0.1.0. Adds dependency @pipedream/platform ^3.1.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant A as Action (Create Orgchart PDF/XLSX)
  participant APP as App Client
  participant API as The Official Board API
  participant FS as /tmp Filesystem

  U->>A: Provide companyId, filename
  A->>APP: exportOrgchartPdf/Excel({ id: companyId })
  APP->>API: GET /companies/{id}/export(orgchart)
  API-->>APP: Binary content (PDF/XLSX)
  APP-->>A: Buffer/stream
  A->>FS: writeFileSync(/tmp/filename)
  A-->>U: { filename, filePath, contentType }
  note over A,APP: Sets $summary on success
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant A1 as Action (Get/Search)
  participant APP as App Client
  participant API as The Official Board API

  U->>A1: Provide inputs (name, companyName, ids)
  A1->>APP: getExecutiveSearch / getCompanySearch / getCompanyOrgchart / getExecutiveBiography
  APP->>API: GET respective endpoint with params
  API-->>APP: JSON response
  APP-->>A1: Data
  A1-->>U: Return data + $summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hopped through fields of JSON green,
Fetching charts where lines convene.
A PDF here, an XLSX there—
Executives found with tidy flair.
New headers set, requests in tune,
Org trees bloom beneath the moon.
Thump-thump—ship it soon! 🐇📄📊

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR includes two additional actions—Search Company Org Chart ID and Search Executive by Name—and their corresponding app method wrappers, which are not listed among the objectives in linked issue #17539, indicating features outside the stated scope of orgchart exports and executive/orgchart retrieval. Please move the search actions to a separate PR or update the linked issue to include these features, or remove the out-of-scope modules to keep this PR focused on the four specified actions.
Description Check ⚠️ Warning The PR description only includes a reference to the resolved issue and does not follow the repository’s required template, which expects a “## WHY” section to explain the motivation behind the changes, leaving readers without context for these additions. Please add a “## WHY” section under the description template and provide the rationale and context for these changes to satisfy the repository’s PR description requirements.
Title Check ❓ Inconclusive The title “17539 components the official board” includes the issue number and component name but does not concisely convey the primary changes introduced by the PR, making it too generic and unclear to readers scanning the repository history. A more descriptive title would help teammates immediately understand that this PR adds new TheOfficialBoard actions for exporting orgcharts and retrieving executive information. Please update the title to a concise summary of the main changes, such as “Add TheOfficialBoard actions for orgchart export and executive info,” to clearly communicate the PR’s purpose.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The PR implements each of the four specified actions from linked issue #17539—Create Orgchart XLSX File, Get Executive Info, Create Orgchart PDF File, and Get Orgchart Info—with appropriate metadata, props, and run methods that call the corresponding API endpoints, thereby fulfilling the core objectives.
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 17539-components-the-official-board

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

🧹 Nitpick comments (6)
components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs (2)

16-21: Consider making the amount parameter optional.

The amount prop lacks an optional field. If the API supports retrieving results without specifying an amount, consider making this parameter optional with a reasonable default or allowing users to omit it.


32-32: Add safety check for response format.

The code assumes response is an array with a .length property. If the API returns an error object or unexpected format, this will fail.

Consider adding a safety check:

-    $.export("$summary", `Successfully retrieved ${response.length} companies with name ${this.companyName}`);
+    const count = Array.isArray(response) ? response.length : 0;
+    $.export("$summary", `Successfully retrieved ${count} companies with name ${this.companyName}`);
components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (1)

24-28: Remove unused syncDir prop or integrate it into the workflow.

The syncDir prop is defined but never used in the code. Either remove it if it's not needed, or integrate it into the file writing logic if it's intended for syncing the exported file to a specific directory.

Can you verify whether syncDir is a platform-specific prop that's automatically handled, or if it needs explicit integration in the code?

components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs (1)

11-15: Consider adding validation for empty name input.

The name prop doesn't have validation to ensure it's not empty. Searching with an empty string might result in unexpected API behavior or excessive results.

Add validation to the name prop:

     name: {
       type: "string",
       label: "Name",
       description: "The name of the executive to search for",
+      optional: false,
     },
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (2)

24-28: Remove unused syncDir prop or integrate it into the workflow.

The syncDir prop is defined but never used in the code. This is the same issue as in the XLSX export action. Either remove it if it's not needed, or integrate it into the file writing logic if it's intended for syncing the exported file to a specific directory.

Can you verify whether syncDir is a platform-specific prop that's automatically handled, or if it needs explicit integration in the code?


1-49: Consider extracting common file export logic to reduce duplication.

The PDF and XLSX export actions share nearly identical code structure (file writing, error handling, prop definitions). Consider creating a shared helper function or base action to reduce duplication and improve maintainability.

Example approach:

// shared helper in the_official_board.app.mjs or a utils file
async exportOrgchartToFile({ $, companyId, filename, exportFn, contentType }) {
  const response = await exportFn({ $, params: { id: companyId } });
  const safeFilename = path.basename(filename);
  const filePath = `/tmp/${safeFilename}`;
  
  try {
    fs.writeFileSync(filePath, response);
  } catch (error) {
    throw new Error(`Failed to write file: ${error.message}`);
  }
  
  return { filename: safeFilename, filePath, contentType };
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb96c25 and b9d8871.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (1 hunks)
  • components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (1 hunks)
  • components/the_official_board/actions/get-executive-info/get-executive-info.mjs (1 hunks)
  • components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (1 hunks)
  • components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs (1 hunks)
  • components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs (1 hunks)
  • components/the_official_board/package.json (2 hunks)
  • components/the_official_board/the_official_board.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/the_official_board/the_official_board.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
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.

Applied to files:

  • components/the_official_board/package.json
🧬 Code graph analysis (6)
components/the_official_board/actions/get-executive-info/get-executive-info.mjs (5)
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (1)
  • response (31-36)
components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (1)
  • response (31-36)
components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (1)
  • response (20-25)
components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs (1)
  • response (24-30)
components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs (1)
  • response (18-23)
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (1)
components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (2)
  • response (31-36)
  • filePath (38-38)
components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (1)
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (2)
  • response (31-36)
  • filePath (38-38)
components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs (3)
components/the_official_board/actions/get-executive-info/get-executive-info.mjs (1)
  • response (19-24)
components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (1)
  • response (20-25)
components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs (1)
  • response (18-23)
components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs (3)
components/the_official_board/actions/get-executive-info/get-executive-info.mjs (1)
  • response (19-24)
components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (1)
  • response (20-25)
components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs (1)
  • response (24-30)
components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (2)
components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs (1)
  • response (31-36)
components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs (1)
  • response (31-36)
⏰ 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: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (12)
components/the_official_board/package.json (2)

3-3: LGTM! Appropriate version bump for new features.

The version bump from 0.0.1 to 0.1.0 correctly reflects the addition of new actions and functionality.


15-16: LGTM! Dependency addition is appropriate.

The @pipedream/platform dependency is correctly added to support the axios usage in the refactored app module.

components/the_official_board/actions/get-executive-info/get-executive-info.mjs (2)

11-16: LGTM! Proper use of propDefinition.

The executiveId prop correctly references the app's propDefinition, ensuring consistency across actions.


19-24: Confirm /executive/biography parameter name matches docs: check the Official Board REST API docs to see whether the endpoint expects bioID or executiveId and update the params key to match exactly.

components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs (2)

11-17: LGTM! Good practice extending the propDefinition.

The action correctly extends the companyId propDefinition with a more specific description for this use case.


19-29: LGTM! Clean action implementation.

The run method correctly calls the app's getCompanyOrgchart method and provides appropriate user feedback.

components/the_official_board/the_official_board.app.mjs (6)

1-1: LGTM! Correct import for Pipedream platform.

The axios import from @pipedream/platform is the correct way to make HTTP requests in Pipedream components.


6-17: LGTM! Well-structured propDefinitions.

The propDefinitions provide clear, reusable property definitions for companyId and executiveId that are correctly used across the new actions.


22-28: LGTM! Proper authentication header implementation.

The _headers method correctly includes the API token from this.$auth.api_token and allows header overrides.


29-39: LGTM! Clean request abstraction.

The _makeRequest method provides a solid foundation for all API calls with consistent URL construction and header management.


58-64: LGTM! Correct responseType for binary data.

The exportOrgchartExcel method correctly specifies responseType: "arraybuffer" to handle the Excel file binary data.


65-71: LGTM! Correct responseType for binary data.

The exportOrgchartPdf method correctly specifies responseType: "arraybuffer" to handle the PDF file binary data.

Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM! Ready for QA.

@vunguyenhung vunguyenhung merged commit 9b469a0 into master Oct 1, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the 17539-components-the-official-board branch October 1, 2025 03:44
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.

[Components] The Official Board

4 participants