Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Aug 27, 2025

Resolves #18167

Summary by CodeRabbit

  • New Features

    • Added OAuth-enabled Apify actions (dataset items, run actor, run task synchronously, scrape single URL, set key-value record) and OAuth-enabled real-time sources for finished actor/task runs.
    • Added a utility to adapt action/source input definitions for OAuth app usage.
    • Consolidated and expanded app methods and prop definitions to surface shared functionality.
  • Chores

    • Bumped Apify OAuth package to 0.1.0 and added the @pipedream/apify dependency.
    • Standardized Bearer-based Authorization headers for API requests.

@vercel
Copy link

vercel bot commented Aug 27, 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 Aug 29, 2025 2:40pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 29, 2025 2:40pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Adds OAuth-wrapped variants for multiple Apify actions and sources, a shared prop-adjustment utility, updates the Apify OAuth app with shared propDefinitions and a _headers() method using oauth_access_token, and bumps the apify_oauth package version and dependency.

Changes

Cohort / File(s) Summary
OAuth-wrapped Actions
components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs, components/apify_oauth/actions/run-actor/run-actor.mjs, components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs, components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs, components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs
Add OAuth-specific wrappers that import the OAuth app and base action, destructure base metadata, adjust prop definitions for the app, set new key/version, and export defaults with props: { apify: app, ...adjustedProps }.
OAuth-wrapped Sources
components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs, components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs
Add OAuth-wrapped source modules mirroring base sources, compute adjusted props via helper, and export defaults with apify: app plus adjusted props and new key/version.
OAuth App updates
components/apify_oauth/apify_oauth.app.mjs
Replace empty propDefinitions with ...common.propDefinitions; replace explicit authKeys() with ...common.methods; add _headers() returning headers including Authorization: Bearer ${this.$auth.oauth_access_token} and x-apify-integration-platform: "pipedream".
Shared Utils
components/apify_oauth/common/utils.mjs
Add export function adjustPropDefinitions(props, app) that rewrites propDefinition arrays to target the OAuth app, filters unsupported app-typed props, and returns adjusted props.
Package metadata
components/apify_oauth/package.json
Bump package version to 0.1.0 and add dependency "@pipedream/apify": "^0.3.0".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Wrapper as OAuth Wrapper (action/source)
  participant App as Apify OAuth App
  participant API as Apify API

  User->>Wrapper: invoke action/source with inputs
  Wrapper->>App: request headers via _headers()
  Note right of App #DDEEFF: reads this.$auth.oauth_access_token
  App-->>Wrapper: headers { Authorization: Bearer ... , x-apify-integration-platform: "pipedream" }
  Wrapper->>API: HTTP request with OAuth headers
  API-->>Wrapper: response (data / status)
  Wrapper-->>User: return result / emit event
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Clone Apify (API Key) components to Apify (OAuth) (#18167) Adds multiple wrapped actions/sources and app/helpers, but not a complete clone of all Apify API Key components—coverage appears partial.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
None detected Changes are focused on creating OAuth-wrapped components, app updates, utils, and package metadata; no unrelated functional code changes observed.

Poem

I nibble keys and hop with glee,
OAuth carrots now feed me.
Props rearranged, headers bright,
Tokens tucked in bearer's light.
New wrappers sprout — the burrow's free.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 66d5999 and 995c764.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/apify_oauth/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/apify_oauth/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: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18167

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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: 0

♻️ Duplicate comments (4)
components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs (1)

1-22: DRY via shared wrapper helper (see earlier comment)

This file can also use the proposed wrap() helper to cut repetition.

components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs (1)

1-22: Apply the shared wrap() helper to reduce boilerplate

Same refactor opportunity as other wrappers.

components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1)

1-22: Use the common wrap() helper

Same optional refactor to minimize duplication.

components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs (1)

1-22: Consider the shared wrap() helper here as well

Keeps all OAuth wrappers consistent and concise.

🧹 Nitpick comments (5)
components/apify_oauth/common/utils.mjs (1)

1-1: Guard against undefined props (minor).
Default props to {} to avoid crashes if a caller passes undefined.

-export function adjustPropDefinitions(props, app) {
+export function adjustPropDefinitions(props = {}, app) {
components/apify_oauth/apify_oauth.app.mjs (1)

11-16: Fail fast if the OAuth access token is missing.
Prevents confusing 401s downstream.

   _headers() {
-      return {
+      const token = this.$auth?.oauth_access_token;
+      if (!token) {
+        throw new Error("Missing OAuth access token (apify_oauth connection).");
+      }
+      return {
         "Content-Type": "application/json",
-        "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
+        "Authorization": `Bearer ${token}`,
         "x-apify-integration-platform": "pipedream",
       };
   },
components/apify_oauth/actions/run-actor/run-actor.mjs (1)

18-21: Ensure apify app prop cannot be overridden by base props.
Place apify last so it wins if present in others.props (even though adjustPropDefinitions should drop it).

   props: {
-    apify: app,
-    ...props,
+    ...props,
+    apify: app,
   },
components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs (1)

18-21: Same apify prop ordering nit.
Put apify last for defensive override.

   props: {
-    apify: app,
-    ...props,
+    ...props,
+    apify: app,
   },
components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (1)

1-22: Reduce duplication with a tiny wrapper helper

Many files repeat the same wrapper boilerplate. Consider centralizing it.

Apply:

- import app from "../../apify_oauth.app.mjs";
- import common from "@pipedream/apify/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs";
-
- import { adjustPropDefinitions } from "../../common/utils.mjs";
-
- const { name, description, type, ...others } = common;
- const props = adjustPropDefinitions(others.props, app);
-
- export default {
-   ...others,
-   key: "apify_oauth-new-finished-task-run-instant",
-   version: "0.0.1",
-   name,
-   description,
-   type,
-   props: {
-     apify: app,
-     ...props,
-   },
- };
+import app from "../../apify_oauth.app.mjs";
+import common from "@pipedream/apify/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs";
+import wrap from "../../common/wrap.mjs";
+
+export default wrap(common, "apify_oauth-new-finished-task-run-instant", app, "0.0.1");

New file (supporting util):

// components/apify_oauth/common/wrap.mjs
import { adjustPropDefinitions } from "./utils.mjs";

export default function wrap(common, key, app, version = "0.0.1") {
  const { name, description, type, ...others } = common;
  const props = adjustPropDefinitions(others.props ?? {}, app);
  return {
    ...others,
    key,
    version,
    name,
    description,
    type,
    props: {
      apify: app,
      ...props,
    },
  };
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a692936 and 66d5999.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs (1 hunks)
  • components/apify_oauth/actions/run-actor/run-actor.mjs (1 hunks)
  • components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs (1 hunks)
  • components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs (1 hunks)
  • components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs (1 hunks)
  • components/apify_oauth/apify_oauth.app.mjs (1 hunks)
  • components/apify_oauth/common/utils.mjs (1 hunks)
  • components/apify_oauth/package.json (2 hunks)
  • components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1 hunks)
  • components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/common/utils.mjs (8)
components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs (1)
  • props (9-9)
components/apify_oauth/actions/run-actor/run-actor.mjs (1)
  • props (9-9)
components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs (1)
  • props (9-9)
components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs (1)
  • props (9-9)
components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs (1)
  • props (9-9)
components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1)
  • props (9-9)
components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (1)
  • props (9-9)
components/monday_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/actions/run-actor/run-actor.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1)
components/apify_oauth/common/utils.mjs (1)
  • adjustPropDefinitions (1-40)
⏰ 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: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (12)
components/apify_oauth/package.json (2)

3-3: Version bump looks good.
Matches a minor feature addition (new OAuth wrappers).


15-17: No action required: @pipedream/apify@^0.2.2 exports verified
The published tarball for version 0.2.2 includes the action modules you import in your wrappers:

  • package/actions/run-actor/run-actor.mjs
  • package/actions/get-dataset-items/get-dataset-items.mjs

All required export paths are present.

components/apify_oauth/common/utils.mjs (1)

1-40: Utility mirrors prior implementation and reads clean.
Logic for replacing the propDefinition’s first arg and dropping type==="app" props is sound.

components/apify_oauth/apify_oauth.app.mjs (1)

1-19: Solid reuse of common app surface with OAuth headers.
Spreading common.propDefinitions/methods and centralizing headers is a good approach.

components/apify_oauth/actions/run-actor/run-actor.mjs (1)

1-17: Wrapper structure is correct.
Name/description/type passthrough and others spread look good.

components/apify_oauth/actions/get-dataset-items/get-dataset-items.mjs (1)

1-17: Consistent wrapper pattern.
Mirrors run-actor; good reuse of adjustPropDefinitions.

components/apify_oauth/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (2)

11-22: Wrapper pattern looks correct and safe to merge

PropDefinitions are adjusted to the OAuth app, base fields are preserved via spread, and apify is injected correctly. Order of spreads ensures overrides work as intended.


13-14: Please manually verify OAuth component key and version alignment

It wasn’t possible to confirm uniqueness and version consistency automatically. Before merging, please ensure:

  • The key: "apify_oauth-new-finished-task-run-instant" value does not appear in any other components/apify_oauth/**/*.mjs file.
  • The version: "0.0.1" matches the versioning used by your existing OAuth wrappers (e.g. bump together or reset as needed).

You can run these commands locally to inspect:

# List any duplicate keys
rg --glob 'components/apify_oauth/**/*.mjs' -o "key: ['\"][^'\"]+['\"]" \
  | sed -E "s/key: ['\"]([^'\"]+)['\"]/\\1/" \
  | sort \
  | uniq -d

# Show all version values and their counts
rg --glob 'components/apify_oauth/**/*.mjs' -o "version: ['\"][^'\"]+['\"]" \
  | sed -E "s/version: ['\"]([^'\"]+)['\"]/\\1/" \
  | sort \
  | uniq -c
components/apify_oauth/actions/set-key-value-store-record/set-key-value-store-record.mjs (1)

11-22: Wrapper wiring looks good

Props are properly adjusted and the OAuth app is injected under apify; base action fields are preserved.

components/apify_oauth/actions/run-task-synchronously/run-task-synchronously.mjs (1)

11-22: LGTM on the OAuth adaptation

Spread order, adjusted propDefinitions, and explicit apify app prop are all correct.

components/apify_oauth/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1)

11-22: Source wrapper looks correct

Correctly rebinds propDefinitions to OAuth app and overrides key/version cleanly.

components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs (1)

11-22: Action wrapper is properly configured

All fields and props are adapted as expected; no issues spotted.

luancazarine
luancazarine previously approved these changes Aug 27, 2025
Copy link
Collaborator

@luancazarine luancazarine 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!

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 5040561 into master Sep 1, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-18167 branch September 1, 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.

[FEATURE] Clone Apify (API Key) components to Apify (OAuth)

3 participants