-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - skyvern #14629
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
New Components - skyvern #14629
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request introduces several new modules and functionalities within the Skyvern application. Key additions include modules for creating and running tasks, retrieving workflow details, and triggering workflows. A utility function for parsing objects has also been implemented. The Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
Sources - New Or Updated Workflow Actions - Get Workflow - Run Workflow - Create Run Task
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: 9
🧹 Outside diff range and nitpick comments (8)
components/skyvern/common/utils.mjs (2)
1-24
: Add JSDoc documentation for better type safety and usage clarity.The function would benefit from comprehensive documentation explaining its purpose, parameters, return types, and behavior.
Add this documentation at the start of the function:
+/** + * Safely parses JSON strings and arrays containing JSON strings. + * @param {any} obj - The input to parse. Can be a string, array, or any other type + * @returns {any} Parsed object if successful, original input if parsing fails + * @example + * parseObject('{"key": "value"}') // Returns: { key: 'value' } + * parseObject(['{"key": "value"}', '{"key2": "value2"}']) // Returns: [{ key: 'value' }, { key2: 'value2' }] + * parseObject(null) // Returns: undefined + */ export const parseObject = (obj) => {
7-11
: Consider logging parse errors for debugging.Silent error swallowing could make it difficult to debug issues in production.
Add error logging:
try { return JSON.parse(item); } catch (e) { + console.debug(`Failed to parse JSON string: ${item}`, e); return item; }
components/skyvern/sources/new-or-updated-workflow/test-event.mjs (1)
12-26
: Add JSDoc comments and improve test data for workflow definitionThe workflow definition structure lacks documentation about the purpose of parameters and blocks. Additionally, the test data should reflect real-world scenarios.
Here's a suggested improvement:
+ /** + * @typedef {Object} WorkflowDefinition + * @property {Array<Parameter>} parameters - Input parameters for the workflow + * @property {Array<Block>} blocks - Execution blocks defining workflow steps + */ "workflow_definition": { "parameters": [ { - "parameter_type": "string", - "key": "string", - "description": "string | null" + "parameter_type": "text", + "key": "search_query", + "description": "The search term to process" } ], "blocks": [ { - "label": "string", - "block_type": "string" + "label": "Process Search", + "block_type": "search_processor" } ] }components/skyvern/actions/run-workflow/run-workflow.mjs (1)
18-23
: Consider adding schema validation for the data prop.While the data prop is correctly defined as an optional object, adding schema validation would help users understand the expected structure and catch potential issues early.
Consider enhancing the data prop definition:
data: { type: "object", label: "Data", description: "The data field is used to pass in required and optional parameters that a workflow accepts. [See the documentation](https://docs.skyvern.com/workflows/running-workflows) for further information.", optional: true, + additionalProperties: true, + examples: [{ + "input": "example input", + "parameters": { + "key": "value" + } + }] },components/skyvern/actions/create-run-task/create-run-task.mjs (2)
1-9
: LGTM! Consider enhancing the documentation link.The component setup follows Pipedream conventions correctly. However, consider adding more specific documentation links for each feature (task creation, navigation, data extraction) rather than just the general docs URL.
- description: "Create a new task and run it instantly in Skyvern. Useful for one-off automations. [See the documentation](https://docs.skyvern.com/)", + description: "Create a new task and run it instantly in Skyvern. Useful for one-off automations. See docs for [task creation](https://docs.skyvern.com/tasks), [navigation](https://docs.skyvern.com/navigation), and [data extraction](https://docs.skyvern.com/extraction).",
49-60
: Review security implications of TOTP verification.The TOTP verification implementation requires careful security review:
- Ensure the TOTP verification URL uses HTTPS
- Consider rate limiting for TOTP requests
- Verify secure handling of TOTP identifiers
Consider adding these security enhancements:
- Add URL validation to ensure HTTPS for
totpVerificationUrl
- Implement rate limiting for TOTP requests
- Add masking for TOTP identifiers in logs
components/skyvern/skyvern.app.mjs (2)
40-48
: Consider adding error handling to_makeRequest
method.Currently,
_makeRequest
does not handle errors that may occur during API requests. Adding error handling or retry logic can improve the robustness of your application.
11-23
: Handle pagination appropriately inoptions
method.While fetching workflow options, consider implementing pagination handling to accommodate scenarios where workflows exceed a single page. This ensures all workflows are available for selection.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
components/skyvern/actions/create-run-task/create-run-task.mjs
(1 hunks)components/skyvern/actions/get-workflow/get-workflow.mjs
(1 hunks)components/skyvern/actions/run-workflow/run-workflow.mjs
(1 hunks)components/skyvern/common/utils.mjs
(1 hunks)components/skyvern/package.json
(2 hunks)components/skyvern/skyvern.app.mjs
(1 hunks)components/skyvern/sources/new-or-updated-workflow/new-or-updated-workflow.mjs
(1 hunks)components/skyvern/sources/new-or-updated-workflow/test-event.mjs
(1 hunks)
🔇 Additional comments (18)
components/skyvern/package.json (3)
3-3
: LGTM! Version follows semver conventions.
Starting with version 0.1.0 is appropriate for a new component package.
15-17
: Verify @pipedream/platform version compatibility
Let's ensure we're using a suitable version of the platform package.
#!/bin/bash
# Description: Check latest @pipedream/platform version and its usage
# Expected: Confirm if 3.0.3 is the latest stable version and verify breaking changes
# Check latest version from npm
echo "Latest @pipedream/platform version:"
npm view @pipedream/platform version
# Check for any components using different platform versions
echo -e "\nChecking for version inconsistencies across components:"
fd package.json components/ -x jq -r 'select(.dependencies."@pipedream/platform" != null) | "\(.name): \(.dependencies."@pipedream/platform")"'
Line range hint 1-18
: Verify package structure completeness
The package structure looks good, but let's verify all required files are present for the declared functionalities.
✅ Verification successful
Please re-run the verification with the corrected script below.
Package structure is complete and all required files are present.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify presence of all required component files
# Expected: Find source and action files mentioned in PR objectives
echo "Checking for required component files:"
fd -e mjs . components/skyvern/ -x echo "Found: {}"
# Verify specific required files
required_files=(
"new-or-updated-workflow.mjs" # Polling source
"get-workflow.mjs" # Get workflow action
"run-workflow.mjs" # Run workflow action
"create-run-task.mjs" # Create task action
"skyvern.app.mjs" # Main app file
)
echo -e "\nVerifying required files:"
for file in "${required_files[@]}"; do
if fd -q "$file" components/skyvern/; then
echo "✓ $file exists"
else
echo "✗ Missing: $file"
fi
done
Length of output: 39299
Script:
#!/bin/bash
# Description: Verify presence of all required component files
# Expected: Find source and action files mentioned in PR objectives
echo "Checking for required component files:"
fd -e mjs . components/skyvern/ -x echo "Found: {}"
# Verify specific required files
required_files=(
"new-or-updated-workflow.mjs" # Polling source
"get-workflow.mjs" # Get workflow action
"run-workflow.mjs" # Run workflow action
"create-run-task.mjs" # Create task action
"skyvern.app.mjs" # Main app file
)
echo -e "\nVerifying required files:"
for file in "${required_files[@]}"; do
if fd -q "$file" components/skyvern/; then
echo "✓ $file exists"
else
echo "✗ Missing: $file"
fi
done
Length of output: 1530
components/skyvern/common/utils.mjs (1)
1-24
: Verify usage in dependent modules.
The function is used in other modules for processing specific properties. Let's verify its usage to ensure compatibility.
components/skyvern/sources/new-or-updated-workflow/test-event.mjs (1)
1-27
: Verify alignment with Skyvern's API contract
Let's ensure this test event structure matches Skyvern's actual API response format for workflows.
components/skyvern/actions/get-workflow/get-workflow.mjs (2)
3-8
: Verify documentation link and consider version strategy
The metadata is well-structured, but there are two points to consider:
- The documentation link should be verified to ensure it's accessible
- Starting with version 0.0.1 is appropriate for a new component, but consider documenting the versioning strategy for future updates
#!/bin/bash
# Description: Verify the documentation link is valid and check for version consistency
# Check if other Skyvern components exist and their versions
rg '"version":\s*"[0-9]+\.[0-9]+\.[0-9]+"' components/skyvern/
1-1
: Verify the skyvern app module import
The import statement looks correct, but let's verify the referenced module exists and exports the expected interface.
components/skyvern/actions/run-workflow/run-workflow.mjs (3)
1-2
: LGTM! Imports are clean and well-structured.
The imports are appropriate for the module's functionality, using relative paths correctly.
4-9
: Verify the documentation link accessibility.
The component metadata is well-structured, but let's ensure the documentation link is accessible and points to the correct resource.
✅ Verification successful
Documentation link is accessible.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the documentation link is accessible
curl -I https://docs.skyvern.com/workflows/running-workflows
Length of output: 817
33-41
: Verify integration with other Skyvern components.
Let's ensure the triggerWorkflow method signature matches the implementation in the Skyvern app module.
components/skyvern/actions/create-run-task/create-run-task.mjs (1)
43-48
: Verify schema validation implementation.
The extractedInformationSchema
property mentions JSON Schema compatibility, but we should verify how this validation is implemented in the Skyvern backend.
components/skyvern/skyvern.app.mjs (7)
32-34
: LGTM!
The _baseUrl
method correctly returns the base URL for API requests.
35-39
: Verify the API key configuration in authentication settings.
Ensure that this.$auth.api_key
is properly configured in the authentication settings to provide the API key for header construction.
49-60
: LGTM!
The listWorkflows
method correctly fetches workflows with the appropriate parameters.
61-69
: LGTM!
The getWorkflowRunDetails
method correctly constructs the path and makes the API request to retrieve workflow run details.
70-78
: Ensure required data is passed when triggering a workflow.
When using triggerWorkflow
, verify that any necessary data or parameters required by the API are included in ...opts
. This ensures the workflow is triggered with the correct context.
79-85
: Ensure required data is provided for task creation.
In the createAndRunTask
method, make sure that all necessary data for task creation is passed through opts
. Missing required fields may lead to API errors.
86-109
: Confirm the structure of paginated data in paginate
method.
The paginate
method assumes that the data returned from fn
is an array. Ensure that the API responses are arrays or adjust the method to handle the actual data structure (e.g., if data is nested within an object).
components/skyvern/sources/new-or-updated-workflow/new-or-updated-workflow.mjs
Show resolved
Hide resolved
components/skyvern/sources/new-or-updated-workflow/new-or-updated-workflow.mjs
Show resolved
Hide resolved
* skyvern init * [Components] skyvern #14566 Sources - New Or Updated Workflow Actions - Get Workflow - Run Workflow - Create Run Task * pnpm update * fix action key
Resolves #14566.
Summary by CodeRabbit
Release Notes
New Features
Improvements
Documentation