-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Improve Apify actions #16384
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
base: master
Are you sure you want to change the base?
Improve Apify actions #16384
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis set of changes primarily updates version numbers across several Apify actions, sources, and the package metadata. In addition, the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RunActorAction
participant ApifyApp
User->>RunActorAction: Invoke Run Actor action
RunActorAction->>ApifyApp: Call runActor({ actorId, buildId, ...opts }) or runActorAsynchronously(...)
ApifyApp->>Apify API: POST /acts/${actorId}/run-sync (sync) or /acts/${actorId}/runs (async)
Apify API-->>ApifyApp: Return run result or run ID
ApifyApp-->>RunActorAction: Return result or run info
RunActorAction-->>User: Return result or summary message
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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/apify/actions/run-actor/run-actor.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/apify/common/constants.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 selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
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:
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.
Hi @michelle0927, LGTM! Ready for QA!
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: 1
🔭 Outside diff range comments (1)
components/apify/actions/run-actor/run-actor.mjs (1)
84-93
:⚠️ Potential issuePotential runtime crash if schema lacks the keyed property
prepareData()
assumes every key present indata
exists in the actor’s input schema:const editor = properties[key].editor;If the user supplies an extra property, or the schema was updated and a field was removed,
properties[key]
isundefined
, leading toTypeError: Cannot read property 'editor' of undefined
.Guard against missing entries:
- const editor = properties[key].editor; + if (!properties[key]) { + continue; // or throw a descriptive error + } + const editor = properties[key].editor;Failing fast (with a clear message) or skipping unknown keys will make the action more robust.
🧹 Nitpick comments (2)
components/apify/actions/run-actor/run-actor.mjs (2)
152-157
: Avoid “undefined Default” in generated descriptionsWhen a property in the actor schema has no
description
, you later append the default value:props[key].description += ` Default: \`${JSON.stringify(value.default)}\``;If
value.description
isundefined
, the UI will render"undefined Default: …"
.Safeguard the concatenation:
- props[key].description += ` Default: \`${JSON.stringify(value.default)}\``; + const baseDesc = props[key].description ?? ""; + props[key].description = `${baseDesc}${baseDesc ? " " : ""}Default: \`${JSON.stringify(value.default)}\``;This keeps the UX clean when the original description is missing.
206-224
: Consider filtering out undefined params before sending the requestAll optional parameters are forwarded even when
undefined
. Some HTTP clients omit such keys, but relying on that can be brittle:params: { outputRecordKey, timeout, ... }A quick utility to strip
undefined
(ornull
) keeps the payload minimal and avoids accidental API validation errors when Apify introduces stricter schemas:- params: { - outputRecordKey, - timeout, - ... - }, + params: Object.fromEntries( + Object.entries({ + outputRecordKey, + timeout, + memory, + maxItems, + maxTotalChargeUsd, + waitForFinish, + webhooks, + }).filter(([, v]) => v !== undefined), + ),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/apify/actions/run-actor/run-actor.mjs
(5 hunks)components/apify/apify.app.mjs
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- components/apify/apify.app.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/apify/actions/run-actor/run-actor.mjs (1)
3-3
: Confirm availability ofparseObject
helperA new import was added:
import { parseObject } from "../../common/utils.mjs";Please verify that:
parseObject
exists and is exported from the referenced path.- It is tree‑shakeable and does not pull heavy dependencies into every Apify action.
If the helper is trivial (e.g.,
JSON.parse
wrapper), consider inlining it to avoid an extra import.
/approve |
/approve |
Resolves #16305
Summary by CodeRabbit
New Features
Bug Fixes
Chores