Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Nov 7, 2025

Resolves #9741

Summary by CodeRabbit

  • New Features

    • Added arXiv article search with configurable parameters (query, ID list, pagination, result limits)
    • Option to return results in-memory or export results to a file
  • Chores

    • Version bumped to 0.1.0
    • Added platform dependency for HTTP/request handling

@vercel
Copy link

vercel bot commented Nov 7, 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 Nov 10, 2025 4:14pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 10, 2025 4:14pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Adds a new arXiv search action that calls the app client to fetch articles and optionally saves results to a file. Refactors the arXiv app to centralize HTTP requests with axios. Bumps package version and adds a platform dependency.

Changes

Cohort / File(s) Summary
New Search Action
components/arxiv/actions/search-articles/search-articles.mjs
New action module exposing props (arxiv client, searchQuery, idList, start, maxResults, filename, syncDir). Calls this.arxiv.search(...), exports a summary, and either returns the raw response or writes it to /tmp/{filename} and returns file metadata.
App Module Refactor
components/arxiv/arxiv.app.mjs
Removed authKeys(). Added _baseUrl() and _makeRequest({ $, path, ...opts }) that uses axios for HTTP calls. Updated search(opts={}) to delegate to _makeRequest() with path="/query". Added axios import from @pipedream/platform.
Package Update
components/arxiv/package.json
Version bumped from 0.0.10.1.0. Added dependencies with @pipedream/platform: ^3.1.1.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SearchAction as search-articles.mjs
    participant ArxivApp as arxiv.app.mjs
    participant Axios
    participant ArxivAPI as arXiv API

    User->>SearchAction: invoke run({ $ })
    SearchAction->>ArxivApp: search({search_query, id_list, start, max_results})
    ArxivApp->>ArxivApp: _baseUrl()
    ArxivApp->>Axios: _makeRequest(path="/query", params...)
    Axios->>ArxivAPI: HTTP GET /query?...
    ArxivAPI-->>Axios: Response
    Axios-->>ArxivApp: Return response
    ArxivApp-->>SearchAction: search results

    alt filename provided
        SearchAction->>SearchAction: write file -> /tmp/{filename}
        SearchAction-->>User: { filePath, fileContent } + summary
    else filename not provided
        SearchAction-->>User: raw response + summary
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to:
    • Parameter mapping and error handling in search-articles.mjs (file I/O edge cases).
    • URL composition and axios call options in _makeRequest() / _baseUrl().
    • Import and usage of @pipedream/platform axios — ensure correct API surface.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains 'Resolves #9741' without following the required template structure that includes a 'WHY' section for explaining the rationale and context. Complete the PR description by filling out the 'WHY' section from the template to explain the purpose, rationale, and context for adding the arxiv component.
Title check ❓ Inconclusive The title 'Arxiv - new component' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific implementation details or which component is being added. Consider providing a more specific title that describes what the arxiv component does, e.g., 'Add arxiv search article action' or similar, to better convey the primary change.
Linked Issues check ❓ Inconclusive The PR implements a search-articles action module for arxiv with an updated arxiv app client supporting HTTP requests; however, linked issue #9741 provides only a URL reference without specific acceptance criteria or implementation requirements to fully validate against. Verify against the arxiv API documentation referenced in issue #9741 (https://info.arxiv.org/help/api/index.html) that all required endpoints and parameters are correctly implemented.
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes are scoped to the arxiv component: search-articles action, arxiv app client, and package version/dependencies. No unrelated modifications to other components or systems were detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-9741

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7898384 and e459cc7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/arxiv/actions/search-articles/search-articles.mjs (1 hunks)
  • components/arxiv/arxiv.app.mjs (1 hunks)
  • components/arxiv/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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/arxiv/arxiv.app.mjs
📚 Learning: 2025-10-20T00:28:38.772Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack/slack.app.mjs:0-0
Timestamp: 2025-10-20T00:28:38.772Z
Learning: In components/slack/slack.app.mjs, the assistantSearch method uses sdk().apiCall() directly instead of makeRequest because the slack/web-api npm package doesn't expose assistant.search.context as a method on WebClient. This direct usage is intentional and necessary when Slack API methods are not yet exposed in the SDK.

Applied to files:

  • components/arxiv/arxiv.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/arxiv/package.json
⏰ 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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/arxiv/package.json (1)

3-3: LGTM! Version bump and dependency addition are appropriate.

The minor version bump (0.0.1 → 0.1.0) correctly reflects the addition of new functionality. The @pipedream/platform dependency is necessary for the axios usage in the updated app module.

Also applies to: 15-17

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

1-1: LGTM! Correct import for HTTP requests.

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


8-24: LGTM! Clean HTTP request infrastructure.

The implementation follows Pipedream best practices:

  • _baseUrl() provides the correct arXiv API endpoint
  • _makeRequest() properly uses axios with URL composition
  • search() correctly delegates to the query endpoint

The axios implementation will automatically exclude undefined parameters from requests.

components/arxiv/actions/search-articles/search-articles.mjs (1)

2-2: LGTM! Correct use of built-in fs module.

The fs import is correct. Built-in Node.js modules should be imported but not added to package.json dependencies.

Based on learnings.

jcortes
jcortes previously approved these changes Nov 8, 2025
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 @michelle0927 lgtm! Ready for QA!

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

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

♻️ Duplicate comments (3)
components/arxiv/actions/search-articles/search-articles.mjs (3)

17-28: Add validation that at least one search parameter is required.

Both searchQuery and idList are optional, but the arXiv API requires at least one to perform a search. Without this validation, the action makes an invalid API call.

Apply this diff to add validation:

 async run({ $ }) {
+  if (!this.searchQuery && (!this.idList || this.idList.length === 0)) {
+    throw new Error("Either searchQuery or idList must be provided");
+  }
+
   const response = await this.arxiv.search({

47-51: Remove unused syncDir prop or make it optional.

The syncDir prop is required but the action only writes files conditionally (when filename is provided). This forces users to provide a sync directory even when not saving files. Based on learnings, since this action doesn't always write files, the prop should either be optional or removed.

If sync functionality is not needed, apply this diff to remove the prop:

-    syncDir: {
-      type: "dir",
-      accessMode: "write",
-      sync: true,
-    },

Otherwise, make it optional:

     syncDir: {
       type: "dir",
       accessMode: "write",
       sync: true,
+      optional: true,
     },

Based on learnings.


71-72: Add error handling for file operations.

The file write operation lacks error handling. If the write fails, the error message may not be clear to users.

Apply this diff to add error handling:

 const filePath = `/tmp/${this.filename}`;
-fs.writeFileSync(filePath, response, "utf8");
+try {
+  fs.writeFileSync(filePath, response, "utf8");
+} catch (error) {
+  throw new Error(`Failed to write file to ${filePath}: ${error.message}`);
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e459cc7 and b2751ca.

📒 Files selected for processing (1)
  • components/arxiv/actions/search-articles/search-articles.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.

Applied to files:

  • components/arxiv/actions/search-articles/search-articles.mjs
📚 Learning: 2025-07-01T17:01:46.327Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/tinypng/actions/compress-image/compress-image.mjs:18-23
Timestamp: 2025-07-01T17:01:46.327Z
Learning: In TinyPNG compress-image action (components/tinypng/actions/compress-image/compress-image.mjs), the syncDir property uses accessMode: "read" because this action only reads input files and returns API responses without writing files to /tmp, unlike other TinyPNG actions that save processed files to disk.

Applied to files:

  • components/arxiv/actions/search-articles/search-articles.mjs
📚 Learning: 2025-07-01T16:56:20.177Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/tinypng/actions/convert-image/convert-image.mjs:33-37
Timestamp: 2025-07-01T16:56:20.177Z
Learning: 'dir' props with sync functionality do not expose a path to the sync directory directly. For files to be synced, they must be either: (1) written to `process.env.STASH_DIR` (`/tmp/__stash`), or (2) written to `/tmp` and have their file path returned from the `run` method as a string, `[filepath]`, `[_, filepath]`, `{ filePath }`, `{ filepath }`, or `{ path }`.

Applied to files:

  • components/arxiv/actions/search-articles/search-articles.mjs
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
🔇 Additional comments (3)
components/arxiv/actions/search-articles/search-articles.mjs (3)

1-2: LGTM!

Imports are appropriate for the action's functionality.


4-14: LGTM!

Component metadata and annotations are correctly configured for a search action.


29-46: LGTM!

Pagination and file configuration props are correctly defined.

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

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] arxiv

4 participants