-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Databricks API - Jobs action components #18371
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds many Databricks Jobs- and Runs-related actions, introduces versioned API URL construction, pagination and a paginate helper, new constants and a JSON parsing utility, updates the Databricks app methods to v2.2 endpoints, and bumps the databricks component package to 0.4.0. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Action as List Jobs Action
participant App as Databricks App
participant API as Databricks Jobs API
User->>Action: Trigger (expandTasks, name, maxRequests)
Action->>App: paginate(requestor=listJobs, requestorArgs={ $, params })
loop pages (<= maxRequests)
App->>API: GET /api/<version>/jobs/list?limit&expand_tasks&name&page_token
API-->>App: { jobs[], next_page_token }
App-->>Action: append jobs[]
end
Action-->>User: jobs[] and "$summary"
sequenceDiagram
autonumber
actor User
participant Action as Cancel Run Action
participant App as Databricks App
participant API as Databricks Jobs API
User->>Action: Trigger (runId)
Action->>App: cancelRun({ $, data: { run_id } })
App->>API: POST /api/<version>/jobs/runs/cancel
API-->>App: 200 Accepted
App-->>Action: resolved
Action-->>User: { success: true } and "$summary"
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 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. Comment |
8f6075d
to
a422717
Compare
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: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/databricks/common/utils.mjs (1)
2-2
: Bug:parseObject
coerces valid falsy values (false/0) to{}
.This corrupts payloads containing boolean/number fields. Only
null
/undefined
should short‑circuit.Apply this diff:
- if (!obj) return {}; + if (obj == null) return obj;components/databricks/databricks.app.mjs (1)
68-83
: Same prevContext bug here; also return {label,value} objects.- async options({ prevContext }) { - const { - endpoints, next_page_token, - } = await this.listEndpoints({ - params: { - page_token: prevContext.page_token, - }, - }); - - return { - options: endpoints.map(({ name }) => name), - context: { - page_token: next_page_token, - }, - }; - }, + async options({ prevContext } = {}) { + const page_token = prevContext?.page_token; + const { endpoints = [], next_page_token } = await this.listEndpoints({ + params: { + ...(page_token !== undefined ? { page_token } : {}), + }, + }); + return { + options: endpoints.map(({ name }) => ({ label: name, value: name })), + context: { + page_token: next_page_token ?? null, + }, + }; + },
🧹 Nitpick comments (15)
components/databricks/common/utils.mjs (1)
31-35
: Treat whitespace‑only strings as “unset” inparseJsonInput
.Avoid sending
" "
through to the API.Apply this diff:
- parseJsonInput: (value) => { - return value - ? parseObject(value) - : undefined; - }, + parseJsonInput: (value) => { + const v = typeof value === "string" ? value.trim() : value; + return v ? parseObject(v) : undefined; + },components/databricks/common/constants.mjs (1)
4-7
: Missing 2.1 path inVERSION_PATH
.Jobs endpoints commonly live under 2.1; include it for completeness.
Apply this diff:
const VERSION_PATH = { - V2_0: "/api/2.0", + V2_0: "/api/2.0", + V2_1: "/api/2.1", V2_2: "/api/2.2", };components/databricks/actions/get-job/get-job.mjs (1)
31-31
: Use inputjobId
in the summary to avoid relying on response shape.Some responses may omit
job_id
.Apply this diff:
- $.export("$summary", `Successfully retrieved job with ID \`${response.job_id}\`.`); + $.export("$summary", `Successfully retrieved job with ID \`${jobId}\`.`);components/databricks/actions/delete-run/delete-run.mjs (1)
18-24
: Minor consistency: use destructuredapp
like other actions.Keeps style uniform.
Apply this diff:
- async run({ $ }) { - const response = await this.app.deleteRun({ + async run({ $ }) { + const { app, runId } = this; + const response = await app.deleteRun({ data: { - run_id: this.runId, + run_id: runId, }, $, });components/databricks/actions/create-job/create-job.mjs (3)
12-29
: Prop type mismatch:tasks
should be a JSON string (array), notstring[]
.Current type suggests multiple JSON fragments; it increases user error. Accept a single JSON array string.
Apply this diff:
- tasks: { - type: "string[]", + tasks: { + type: "string", label: "Tasks", description: `A list of task specifications to be executed by this job. JSON string format. [See the API documentation](https://docs.databricks.com/api/workspace/jobs/create#tasks) for task specification details.
42-47
: Same here:jobClusters
should be a single JSON string, notstring[]
.Apply this diff:
- jobClusters: { - type: "string[]", + jobClusters: { + type: "string",
84-89
: Same foraccessControlList
: accept one JSON string (array).Apply this diff:
- accessControlList: { - type: "string[]", + accessControlList: { + type: "string",components/databricks/actions/export-run/export-run.mjs (1)
17-27
: Set an explicit default for viewsToExport to match the docs.The description says it defaults to CODE, but the prop has no
default
. Set it so users see the intended default in UI.viewsToExport: { type: "string", label: "Views to Export", description: "Which views to export. Defaults to `CODE`", optional: true, + default: "CODE", options: [ "CODE", "DASHBOARDS", "ALL", ], },
components/databricks/actions/get-run/get-run.mjs (1)
47-49
: Fix summary to use run_id (job_run_id may be undefined).Databricks Get Run returns
run_id
;job_run_id
isn’t guaranteed. Useresponse.run_id
with fallback to the input.- $.export("$summary", `Successfully retrieved run with ID \`${response.job_run_id}\`.`); + $.export("$summary", `Successfully retrieved run with ID \`${response.run_id ?? runId}\`.`);components/databricks/actions/list-jobs/list-jobs.mjs (1)
24-31
: Provide a sensible default for maxRequests.Helps avoid unbounded pagination for users who don’t set it explicitly.
maxRequests: { type: "integer", label: "Max Requests", description: "Maximum number of API requests to make when paginating", optional: true, min: 1, max: 10, + default: 5, },
components/databricks/actions/set-job-permissions/set-job-permissions.mjs (1)
42-48
: Return type is fine; consider echoing parsed ACL on success (optional).Not required, but returning the normalized ACL can help users verify what was sent.
components/databricks/actions/update-job/update-job.mjs (2)
18-31
: Consider using structured prop types to avoid manual JSON parsing.Define
newSettings
asobject
and keepfieldsToRemove
asstring[]
so users don’t have to craft JSON strings. Backwards compatible with the runtime guard above.
56-60
: Return the API response for downstream steps.Expose the Databricks response so users can reference fields in later steps.
- return { - success: true, - }; + return { success: true, job_id: jobId };components/databricks/databricks.app.mjs (2)
42-49
: Defaultpage
to 0 to avoidNaN
offsets.- async options({ - jobId, page, - }) { + async options({ jobId, page = 0 }) { const limit = 20; const params = { limit, offset: page * limit, };
88-98
: Nit: Warehouse description is misleading.“to get runs from” doesn’t apply to warehouses. Suggest “The ID of the SQL Warehouse.”
- description: "The ID of the SQL Warehouse to get runs from", + description: "The ID of the SQL Warehouse",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
components/databricks/actions/cancel-all-runs/cancel-all-runs.mjs
(1 hunks)components/databricks/actions/cancel-run/cancel-run.mjs
(1 hunks)components/databricks/actions/create-job/create-job.mjs
(1 hunks)components/databricks/actions/delete-job/delete-job.mjs
(1 hunks)components/databricks/actions/delete-run/delete-run.mjs
(1 hunks)components/databricks/actions/export-run/export-run.mjs
(1 hunks)components/databricks/actions/get-job-permissions/get-job-permissions.mjs
(1 hunks)components/databricks/actions/get-job/get-job.mjs
(1 hunks)components/databricks/actions/get-run/get-run.mjs
(1 hunks)components/databricks/actions/list-jobs/list-jobs.mjs
(1 hunks)components/databricks/actions/repair-run/repair-run.mjs
(1 hunks)components/databricks/actions/reset-job/reset-job.mjs
(1 hunks)components/databricks/actions/set-job-permissions/set-job-permissions.mjs
(1 hunks)components/databricks/actions/update-job/update-job.mjs
(1 hunks)components/databricks/common/constants.mjs
(2 hunks)components/databricks/common/utils.mjs
(1 hunks)components/databricks/databricks.app.mjs
(4 hunks)components/databricks/package.json
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (9)
components/databricks/actions/create-job/create-job.mjs (3)
components/databricks/actions/delete-run/delete-run.mjs (1)
response
(19-24)components/databricks/actions/get-job/get-job.mjs (1)
response
(24-29)components/databricks/actions/set-job-permissions/set-job-permissions.mjs (1)
response
(42-48)
components/databricks/actions/set-job-permissions/set-job-permissions.mjs (2)
components/databricks/actions/create-job/create-job.mjs (1)
response
(107-122)components/databricks/actions/get-job-permissions/get-job-permissions.mjs (1)
response
(24-27)
components/databricks/actions/repair-run/repair-run.mjs (2)
components/databricks/actions/create-job/create-job.mjs (1)
response
(107-122)components/databricks/actions/delete-run/delete-run.mjs (1)
response
(19-24)
components/databricks/actions/get-job/get-job.mjs (3)
components/databricks/actions/export-run/export-run.mjs (1)
response
(36-42)components/databricks/actions/get-run/get-run.mjs (1)
response
(38-45)components/databricks/databricks.app.mjs (1)
response
(385-391)
components/databricks/actions/get-job-permissions/get-job-permissions.mjs (2)
components/databricks/actions/get-job/get-job.mjs (1)
response
(24-29)components/databricks/actions/set-job-permissions/set-job-permissions.mjs (1)
response
(42-48)
components/databricks/actions/export-run/export-run.mjs (3)
components/databricks/actions/get-job/get-job.mjs (1)
response
(24-29)components/databricks/actions/get-run/get-run.mjs (1)
response
(38-45)components/databricks/databricks.app.mjs (1)
response
(385-391)
components/databricks/actions/get-run/get-run.mjs (2)
components/databricks/actions/export-run/export-run.mjs (1)
response
(36-42)components/databricks/actions/get-job/get-job.mjs (1)
response
(24-29)
components/databricks/actions/delete-run/delete-run.mjs (2)
components/databricks/actions/get-run/get-run.mjs (1)
response
(38-45)components/databricks/actions/repair-run/repair-run.mjs (1)
response
(51-61)
components/databricks/databricks.app.mjs (8)
components/databricks/actions/list-jobs/list-jobs.mjs (1)
jobs
(41-53)components/databricks/actions/create-job/create-job.mjs (1)
response
(107-122)components/databricks/actions/delete-run/delete-run.mjs (1)
response
(19-24)components/databricks/actions/export-run/export-run.mjs (1)
response
(36-42)components/databricks/actions/get-job-permissions/get-job-permissions.mjs (1)
response
(24-27)components/databricks/actions/get-job/get-job.mjs (1)
response
(24-29)components/databricks/actions/get-run-output/get-run-output.mjs (1)
response
(29-34)components/databricks/actions/run-job-now/run-job-now.mjs (1)
response
(49-59)
⏰ 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). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (10)
components/databricks/package.json (1)
3-3
: Version bump looks good; ensure release notes and compatibility.Please add/confirm a CHANGELOG entry and verify any downstream references to
@pipedream/databricks@^0.3.x
are updated if needed.components/databricks/actions/get-job/get-job.mjs (1)
24-29
: No change required — app.getJob accepts args (params). databricks.app.mjs defines getJob(args = {}) and forwards ...args to _makeRequest, so app.getJob({ $, params: { job_id: jobId } }) is correct.components/databricks/actions/get-job-permissions/get-job-permissions.mjs (1)
24-27
: Confirmed: app.getJobPermissions expects a top-level jobId.
Verified in components/databricks/databricks.app.mjs — getJobPermissions({ jobId, ...args }) — and the action already calls app.getJobPermissions({ $, jobId }); no change required.components/databricks/common/constants.mjs (1)
2-2
: Make BASE_URL cloud-agnostic (don’t hardcode .cloud.databricks.com)
- Edit components/databricks/common/constants.mjs to remove the AWS-only suffix:
-const BASE_URL = `https://${DOMAIN_PLACEHOLDER}.cloud.databricks.com`; +const BASE_URL = `https://${DOMAIN_PLACEHOLDER}`;
- Ensure any URL builder/consumer (the repo does not contain components/databricks/app.mjs) receives a full host from config/app settings (e.g., adb-*.azuredatabricks.net, *.gcp.databricks.com) instead of concatenating a cloud-specific domain.
components/databricks/actions/delete-job/delete-job.mjs (1)
24-35
: LGTM — correct HTTP shape and summary.Body uses
data
withjob_id
as expected for delete; summary and return are consistent with other actions.components/databricks/actions/cancel-run/cancel-run.mjs (1)
24-35
: LGTM — matches API and action patterns.Correct payload (
data.run_id
) and concise summary/return.components/databricks/actions/list-jobs/list-jobs.mjs (1)
41-53
: Nice use of app.paginate with DEFAULT_LIMIT.Clean pagination wiring and result extraction.
components/databricks/actions/reset-job/reset-job.mjs (1)
31-37
: LGTM — correct use of parseJsonInput and payload shape.
new_settings
is parsed once and passed as object; summary and return align with other actions.components/databricks/databricks.app.mjs (2)
102-119
: LGTM: URL builder and request wrapper are clean and reusable.
120-173
: Confirmed: Jobs API v2.2 and Permissions API v2.0 — methods correct.
All listed Jobs endpoints use /api/2.2 with the HTTP methods shown, and job permissions use /api/2.0 (GET/PUT); no changes required.
components/databricks/actions/set-job-permissions/set-job-permissions.mjs
Show resolved
Hide resolved
a422717
to
491ef6c
Compare
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: 2
♻️ Duplicate comments (3)
components/databricks/actions/create-job/create-job.mjs (1)
107-121
: Parse once, validatetasks
, and avoid sending undefined keys.Prevents double parsing, clearer errors, and cleaner payload.
Apply this diff:
- const response = await app.createJob({ - $, - data: { - name, - tags, - tasks: utils.parseJsonInput(tasks), - job_clusters: utils.parseJsonInput(jobClusters), - email_notifications: utils.parseJsonInput(emailNotifications), - webhook_notifications: utils.parseJsonInput(webhookNotifications), - timeout_seconds: timeoutSeconds, - schedule: utils.parseJsonInput(schedule), - max_concurrent_runs: maxConcurrentRuns, - git_source: utils.parseJsonInput(gitSource), - access_control_list: utils.parseJsonInput(accessControlList), - }, - }); + const parsedTasks = utils.parseJsonInput(tasks); + if (!Array.isArray(parsedTasks) || parsedTasks.length === 0) { + throw new Error("Tasks must be a non-empty JSON array."); + } + const parsedJobClusters = jobClusters && utils.parseJsonInput(jobClusters); + const parsedEmail = emailNotifications && utils.parseJsonInput(emailNotifications); + const parsedWebhook = webhookNotifications && utils.parseJsonInput(webhookNotifications); + const parsedSchedule = schedule && utils.parseJsonInput(schedule); + const parsedGit = gitSource && utils.parseJsonInput(gitSource); + const parsedAcl = accessControlList && utils.parseJsonInput(accessControlList); + + const data = { + ...(name !== undefined ? { name } : {}), + ...(tags !== undefined ? { tags } : {}), + tasks: parsedTasks, + ...(parsedJobClusters !== undefined ? { job_clusters: parsedJobClusters } : {}), + ...(parsedEmail !== undefined ? { email_notifications: parsedEmail } : {}), + ...(parsedWebhook !== undefined ? { webhook_notifications: parsedWebhook } : {}), + ...(timeoutSeconds !== undefined ? { timeout_seconds: timeoutSeconds } : {}), + ...(parsedSchedule !== undefined ? { schedule: parsedSchedule } : {}), + ...(maxConcurrentRuns !== undefined ? { max_concurrent_runs: maxConcurrentRuns } : {}), + ...(parsedGit !== undefined ? { git_source: parsedGit } : {}), + ...(parsedAcl !== undefined ? { access_control_list: parsedAcl } : {}), + }; + + const response = await app.createJob({ $, data });components/databricks/databricks.app.mjs (2)
12-23
: Harden options pagination: handle undefinedprevContext
and omit unsetpage_token
.
Prevents first-load crashes and 400s.Apply this diff:
- async options({ prevContext }) { - if (prevContext.pageToken === null) { + async options({ prevContext } = {}) { + const pageToken = prevContext?.pageToken; + if (pageToken === null) { return []; } - const { - jobs, next_page_token: pageToken, + const { + jobs, next_page_token: nextPageToken, } = await this.listJobs({ params: { - page_token: prevContext.pageToken, + ...(pageToken !== undefined ? { page_token: pageToken } : {}), limit: constants.DEFAULT_LIMIT, }, }); @@ return { options, context: { - pageToken: pageToken || null, + pageToken: nextPageToken ?? null, }, };Also applies to: 31-35
374-413
: Fix paginate: don’t sendpage_token: null
and honor initial caller token.
Prevents 400s and enables resume.Apply this diff:
- async paginate({ - requestor, requestorArgs = {}, - maxRequests = 3, resultsKey = "jobs", - }) { + async paginate({ + requestor, requestorArgs = {}, + maxRequests = 3, resultsKey = "jobs", + }) { const allResults = []; let requestCount = 0; - let nextPageToken = null; + let nextPageToken = requestorArgs?.params?.page_token; let hasMore = true; while (hasMore && requestCount < maxRequests) { try { - const response = await requestor({ - ...requestorArgs, - params: { - ...requestorArgs.params, - page_token: nextPageToken, - }, - }); + const params = { + ...requestorArgs.params, + ...(nextPageToken != null ? { page_token: nextPageToken } : {}), + }; + const response = await requestor({ ...requestorArgs, params }); requestCount++; const results = response[resultsKey] || []; allResults.push(...results); nextPageToken = response.next_page_token; hasMore = !!nextPageToken; if (results.length === 0) { hasMore = false; } } catch (error) { console.error(`Pagination error on request ${requestCount}:`, error); throw error; } } return allResults; },
🧹 Nitpick comments (1)
components/databricks/databricks.app.mjs (1)
68-83
: Make endpoint options resilient and align context key withjobId
paging.Avoids crash on first load and inconsistent context naming.
Apply this diff:
- async options({ prevContext }) { - const { - endpoints, next_page_token, - } = await this.listEndpoints({ - params: { - page_token: prevContext.page_token, - }, - }); + async options({ prevContext } = {}) { + const pageToken = prevContext?.pageToken; + const { endpoints = [], next_page_token: nextPageToken } = await this.listEndpoints({ + params: { + ...(pageToken !== undefined ? { page_token: pageToken } : {}), + }, + }); return { - options: endpoints.map(({ name }) => name), + options: endpoints.map(({ name }) => name), context: { - page_token: next_page_token, + pageToken: nextPageToken ?? null, }, }; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (36)
components/databricks/actions/cancel-all-runs/cancel-all-runs.mjs
(1 hunks)components/databricks/actions/cancel-run/cancel-run.mjs
(1 hunks)components/databricks/actions/create-endpoint/create-endpoint.mjs
(1 hunks)components/databricks/actions/create-job/create-job.mjs
(1 hunks)components/databricks/actions/create-sql-warehouse/create-sql-warehouse.mjs
(1 hunks)components/databricks/actions/delete-endpoint/delete-endpoint.mjs
(1 hunks)components/databricks/actions/delete-job/delete-job.mjs
(1 hunks)components/databricks/actions/delete-run/delete-run.mjs
(1 hunks)components/databricks/actions/delete-sql-warehouse/delete-sql-warehouse.mjs
(1 hunks)components/databricks/actions/edit-sql-warehouse/edit-sql-warehouse.mjs
(1 hunks)components/databricks/actions/export-run/export-run.mjs
(1 hunks)components/databricks/actions/get-endpoint/get-endpoint.mjs
(1 hunks)components/databricks/actions/get-job-permissions/get-job-permissions.mjs
(1 hunks)components/databricks/actions/get-job/get-job.mjs
(1 hunks)components/databricks/actions/get-run-output/get-run-output.mjs
(1 hunks)components/databricks/actions/get-run/get-run.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse-config/get-sql-warehouse-config.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse-permissions/get-sql-warehouse-permissions.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse/get-sql-warehouse.mjs
(1 hunks)components/databricks/actions/list-endpoints/list-endpoints.mjs
(1 hunks)components/databricks/actions/list-jobs/list-jobs.mjs
(1 hunks)components/databricks/actions/list-runs/list-runs.mjs
(1 hunks)components/databricks/actions/list-sql-warehouses/list-sql-warehouses.mjs
(1 hunks)components/databricks/actions/repair-run/repair-run.mjs
(1 hunks)components/databricks/actions/reset-job/reset-job.mjs
(1 hunks)components/databricks/actions/run-job-now/run-job-now.mjs
(1 hunks)components/databricks/actions/set-job-permissions/set-job-permissions.mjs
(1 hunks)components/databricks/actions/set-sql-warehouse-config/set-sql-warehouse-config.mjs
(1 hunks)components/databricks/actions/set-sql-warehouse-permissions/set-sql-warehouse-permissions.mjs
(1 hunks)components/databricks/actions/start-sql-warehouse/start-sql-warehouse.mjs
(1 hunks)components/databricks/actions/stop-sql-warehouse/stop-sql-warehouse.mjs
(1 hunks)components/databricks/actions/update-job/update-job.mjs
(1 hunks)components/databricks/common/constants.mjs
(2 hunks)components/databricks/common/utils.mjs
(1 hunks)components/databricks/databricks.app.mjs
(4 hunks)components/databricks/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (18)
- components/databricks/actions/set-sql-warehouse-config/set-sql-warehouse-config.mjs
- components/databricks/actions/delete-endpoint/delete-endpoint.mjs
- components/databricks/actions/delete-sql-warehouse/delete-sql-warehouse.mjs
- components/databricks/actions/list-runs/list-runs.mjs
- components/databricks/actions/list-sql-warehouses/list-sql-warehouses.mjs
- components/databricks/actions/stop-sql-warehouse/stop-sql-warehouse.mjs
- components/databricks/actions/list-endpoints/list-endpoints.mjs
- components/databricks/actions/start-sql-warehouse/start-sql-warehouse.mjs
- components/databricks/actions/edit-sql-warehouse/edit-sql-warehouse.mjs
- components/databricks/actions/set-sql-warehouse-permissions/set-sql-warehouse-permissions.mjs
- components/databricks/actions/get-run-output/get-run-output.mjs
- components/databricks/actions/get-endpoint/get-endpoint.mjs
- components/databricks/actions/get-sql-warehouse-permissions/get-sql-warehouse-permissions.mjs
- components/databricks/actions/create-sql-warehouse/create-sql-warehouse.mjs
- components/databricks/actions/get-sql-warehouse/get-sql-warehouse.mjs
- components/databricks/actions/run-job-now/run-job-now.mjs
- components/databricks/actions/get-sql-warehouse-config/get-sql-warehouse-config.mjs
- components/databricks/actions/create-endpoint/create-endpoint.mjs
🚧 Files skipped from review as they are similar to previous changes (16)
- components/databricks/actions/get-run/get-run.mjs
- components/databricks/actions/list-jobs/list-jobs.mjs
- components/databricks/common/constants.mjs
- components/databricks/actions/export-run/export-run.mjs
- components/databricks/actions/reset-job/reset-job.mjs
- components/databricks/package.json
- components/databricks/common/utils.mjs
- components/databricks/actions/get-job/get-job.mjs
- components/databricks/actions/delete-job/delete-job.mjs
- components/databricks/actions/cancel-run/cancel-run.mjs
- components/databricks/actions/set-job-permissions/set-job-permissions.mjs
- components/databricks/actions/cancel-all-runs/cancel-all-runs.mjs
- components/databricks/actions/update-job/update-job.mjs
- components/databricks/actions/repair-run/repair-run.mjs
- components/databricks/actions/delete-run/delete-run.mjs
- components/databricks/actions/get-job-permissions/get-job-permissions.mjs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
PR: PipedreamHQ/pipedream#14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.
Applied to files:
components/databricks/databricks.app.mjs
🧬 Code graph analysis (1)
components/databricks/databricks.app.mjs (3)
components/databricks/actions/list-jobs/list-jobs.mjs (1)
jobs
(41-53)components/databricks/actions/create-job/create-job.mjs (1)
response
(107-122)components/databricks/actions/delete-run/delete-run.mjs (1)
response
(19-24)
⏰ 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: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (2)
components/databricks/databricks.app.mjs (2)
102-105
: Good: centralized, versioned URL construction.
getUrl
withversionPath
improves consistency across endpoints.
120-173
: Good: Jobs and Runs methods consistently target v2.2.
Clear routing and HTTP methods look correct.
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.
LGTM
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check the test report below for more information |
491ef6c
to
4e09b7e
Compare
Hi @vunguyenhung can you please make sure the JSON format in Webhooks Notifications input looks similar to the example, I've made some description improvements so the user can have a guide: {
"on_success": [
{ "id": "https://eoiqkb8yzox6u2n.m.pipedream.net" }
],
"on_failure": [
{ "id": "https://another-webhook-url.com/notify" }
]
} |
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/databricks/databricks.app.mjs (1)
68-83
: Fix: options() should default prevContext and omit page_token when unset.
Prevents first-load crash and avoids sending page_token: undefined.Apply:
- async options({ prevContext }) { - const { - endpoints, next_page_token, - } = await this.listEndpoints({ - params: { - page_token: prevContext.page_token, - }, - }); + async options({ prevContext } = {}) { + const token = prevContext?.page_token; + const { endpoints = [], next_page_token } = await this.listEndpoints({ + params: { + ...(token !== undefined ? { page_token: token } : {}), + }, + }); return { - options: endpoints.map(({ name }) => name), + options: endpoints.map(({ name }) => name), context: { - page_token: next_page_token, + page_token: next_page_token ?? null, }, }; },
♻️ Duplicate comments (2)
components/databricks/databricks.app.mjs (2)
12-23
: Fix: guard prevContext and avoid sending undefined/nullable page_token.
Accessing prevContext.pageToken can throw on first load; also don’t send page_token when undefined. Initializes pagination end with null sentinel.Apply:
- async options({ prevContext }) { - if (prevContext.pageToken === null) { + async options({ prevContext } = {}) { + const pageToken = prevContext?.pageToken; + if (pageToken === null) { return []; } const { - jobs, next_page_token: pageToken, + jobs, next_page_token: nextPageToken, } = await this.listJobs({ - params: { - page_token: prevContext.pageToken, - limit: constants.DEFAULT_LIMIT, - }, + params: { + ...(pageToken !== undefined ? { page_token: pageToken } : {}), + limit: constants.DEFAULT_LIMIT, + }, }); const options = jobs?.map(({ job_id: value, settings, }) => ({ value, - label: settings?.name || value, + label: settings?.name || value, })) || []; return { options, context: { - pageToken: pageToken || null, + pageToken: nextPageToken ?? null, }, };Also applies to: 30-35
374-413
: Fix pagination: preserve initial token, don’t send null token, and sanitize error logging.
Current code starts withnextPageToken = null
(sendspage_token: null
) and overwrites a caller-supplied token. Also avoid logging full error objects (may leak headers).Apply:
- async paginate({ - requestor, requestorArgs = {}, - maxRequests = 3, resultsKey = "jobs", - }) { + async paginate({ + requestor, requestorArgs = {}, + maxRequests = 3, resultsKey = "jobs", + }) { const allResults = []; let requestCount = 0; - let nextPageToken = null; + let nextPageToken = requestorArgs?.params?.page_token; let hasMore = true; while (hasMore && requestCount < maxRequests) { try { - const response = await requestor({ - ...requestorArgs, - params: { - ...requestorArgs.params, - page_token: nextPageToken, - }, - }); + const params = { + ...requestorArgs.params, + ...(nextPageToken != null ? { page_token: nextPageToken } : {}), + }; + const response = await requestor({ ...requestorArgs, params }); requestCount++; const results = response[resultsKey] || []; allResults.push(...results); nextPageToken = response.next_page_token; hasMore = !!nextPageToken; if (results.length === 0) { hasMore = false; } } catch (error) { - console.error(`Pagination error on request ${requestCount}:`, error); + const status = error?.response?.status; + const message = error?.response?.data?.message || error.message; + console.error(`Pagination error on request ${requestCount}: status=${status}, message=${message}`); throw error; } } return allResults; },
🧹 Nitpick comments (1)
components/databricks/databricks.app.mjs (1)
234-250
: Permissions endpoints — minor nit.
They rely on default v2.0 via getUrl. Optional: passversionPath: constants.VERSION_PATH.V2_0
explicitly for clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (36)
components/databricks/actions/cancel-all-runs/cancel-all-runs.mjs
(1 hunks)components/databricks/actions/cancel-run/cancel-run.mjs
(1 hunks)components/databricks/actions/create-endpoint/create-endpoint.mjs
(1 hunks)components/databricks/actions/create-job/create-job.mjs
(1 hunks)components/databricks/actions/create-sql-warehouse/create-sql-warehouse.mjs
(1 hunks)components/databricks/actions/delete-endpoint/delete-endpoint.mjs
(1 hunks)components/databricks/actions/delete-job/delete-job.mjs
(1 hunks)components/databricks/actions/delete-run/delete-run.mjs
(1 hunks)components/databricks/actions/delete-sql-warehouse/delete-sql-warehouse.mjs
(1 hunks)components/databricks/actions/edit-sql-warehouse/edit-sql-warehouse.mjs
(1 hunks)components/databricks/actions/export-run/export-run.mjs
(1 hunks)components/databricks/actions/get-endpoint/get-endpoint.mjs
(1 hunks)components/databricks/actions/get-job-permissions/get-job-permissions.mjs
(1 hunks)components/databricks/actions/get-job/get-job.mjs
(1 hunks)components/databricks/actions/get-run-output/get-run-output.mjs
(1 hunks)components/databricks/actions/get-run/get-run.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse-config/get-sql-warehouse-config.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse-permissions/get-sql-warehouse-permissions.mjs
(1 hunks)components/databricks/actions/get-sql-warehouse/get-sql-warehouse.mjs
(1 hunks)components/databricks/actions/list-endpoints/list-endpoints.mjs
(1 hunks)components/databricks/actions/list-jobs/list-jobs.mjs
(1 hunks)components/databricks/actions/list-runs/list-runs.mjs
(1 hunks)components/databricks/actions/list-sql-warehouses/list-sql-warehouses.mjs
(1 hunks)components/databricks/actions/repair-run/repair-run.mjs
(1 hunks)components/databricks/actions/reset-job/reset-job.mjs
(1 hunks)components/databricks/actions/run-job-now/run-job-now.mjs
(1 hunks)components/databricks/actions/set-job-permissions/set-job-permissions.mjs
(1 hunks)components/databricks/actions/set-sql-warehouse-config/set-sql-warehouse-config.mjs
(1 hunks)components/databricks/actions/set-sql-warehouse-permissions/set-sql-warehouse-permissions.mjs
(1 hunks)components/databricks/actions/start-sql-warehouse/start-sql-warehouse.mjs
(1 hunks)components/databricks/actions/stop-sql-warehouse/stop-sql-warehouse.mjs
(1 hunks)components/databricks/actions/update-job/update-job.mjs
(1 hunks)components/databricks/common/constants.mjs
(2 hunks)components/databricks/common/utils.mjs
(1 hunks)components/databricks/databricks.app.mjs
(4 hunks)components/databricks/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- components/databricks/actions/stop-sql-warehouse/stop-sql-warehouse.mjs
- components/databricks/actions/create-endpoint/create-endpoint.mjs
- components/databricks/actions/delete-sql-warehouse/delete-sql-warehouse.mjs
🚧 Files skipped from review as they are similar to previous changes (31)
- components/databricks/actions/create-sql-warehouse/create-sql-warehouse.mjs
- components/databricks/actions/list-sql-warehouses/list-sql-warehouses.mjs
- components/databricks/package.json
- components/databricks/actions/get-sql-warehouse/get-sql-warehouse.mjs
- components/databricks/actions/edit-sql-warehouse/edit-sql-warehouse.mjs
- components/databricks/actions/get-run-output/get-run-output.mjs
- components/databricks/actions/export-run/export-run.mjs
- components/databricks/actions/list-endpoints/list-endpoints.mjs
- components/databricks/actions/reset-job/reset-job.mjs
- components/databricks/actions/set-sql-warehouse-permissions/set-sql-warehouse-permissions.mjs
- components/databricks/actions/get-endpoint/get-endpoint.mjs
- components/databricks/actions/start-sql-warehouse/start-sql-warehouse.mjs
- components/databricks/actions/repair-run/repair-run.mjs
- components/databricks/actions/get-sql-warehouse-config/get-sql-warehouse-config.mjs
- components/databricks/actions/get-job-permissions/get-job-permissions.mjs
- components/databricks/actions/list-runs/list-runs.mjs
- components/databricks/actions/get-sql-warehouse-permissions/get-sql-warehouse-permissions.mjs
- components/databricks/actions/list-jobs/list-jobs.mjs
- components/databricks/common/utils.mjs
- components/databricks/actions/cancel-run/cancel-run.mjs
- components/databricks/actions/delete-run/delete-run.mjs
- components/databricks/actions/set-sql-warehouse-config/set-sql-warehouse-config.mjs
- components/databricks/actions/run-job-now/run-job-now.mjs
- components/databricks/actions/delete-job/delete-job.mjs
- components/databricks/actions/create-job/create-job.mjs
- components/databricks/actions/get-run/get-run.mjs
- components/databricks/actions/set-job-permissions/set-job-permissions.mjs
- components/databricks/actions/update-job/update-job.mjs
- components/databricks/common/constants.mjs
- components/databricks/actions/get-job/get-job.mjs
- components/databricks/actions/cancel-all-runs/cancel-all-runs.mjs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
PR: PipedreamHQ/pipedream#14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.
Applied to files:
components/databricks/databricks.app.mjs
📚 Learning: 2025-09-15T22:01:11.431Z
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.431Z
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/databricks/databricks.app.mjs
🧬 Code graph analysis (1)
components/databricks/databricks.app.mjs (3)
components/databricks/actions/list-jobs/list-jobs.mjs (1)
jobs
(41-53)components/databricks/actions/create-job/create-job.mjs (1)
response
(216-231)components/databricks/actions/delete-run/delete-run.mjs (1)
response
(19-24)
⏰ 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: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/databricks/actions/delete-endpoint/delete-endpoint.mjs (1)
7-7
: Version bump only — LGTM.
No behavior change. Safe to merge.components/databricks/databricks.app.mjs (4)
102-105
: getUrl abstraction — LGTM.
Consistent versioned URL construction via constants.
112-116
: Confirm axios context default.
Defaulting$ = this
may break telemetry/retries if callers omit$
. Most call sites pass$
, but please confirm that using the app object as axios context is intentional.
120-173
: Jobs API surface — LGTM.
Endpoints target v2.2 with correct verbs; naming is consistent and matches usage in actions.Also applies to: 174-187, 188-203, 204-210, 211-233
1-1
: Import changes — LGTM.
Using shared constants aligns with versioned URL strategy.Also applies to: 2-2
Hi everyone, all test cases are passed! Ready for release! Test report |
* Leonardo AI components * added unzoom image action * fixing link errors * more lint fixes * Merging pull request #18359 * fix: pagination prop and params struct * fix: no need for paginate here * chore: update version * chore: cleanup * chore: update package * feat: allow raw response * chore: bump package * fix: buffer response instead * Update components/google_drive/actions/download-file/download-file.mjs Co-authored-by: Jorge Cortes <[email protected]> * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * feat: add content selector * chore: bump package * fix: comments * chore: bump versions * chore: fix versions * fixes: QA fixes * feat: add cursor to req * package.json --------- Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> * Merging pull request #18361 * update siteId prop * pnpm-lock.yaml * package.json version * Google Sheets - update row refresh fields (#18369) * change prop order and refresh fields * bump package.json * Pipedrive - fix app name (#18370) * use pipedriveApp instead of app * bump package.json * Pipedrive - pipelineId integer (#18372) * pipelineId - integer * bump versions * Adding app scaffolding for lightspeed_ecom_c_series * Adding app scaffolding for financial_data * Adding app scaffolding for microsoft_authenticator * Merging pull request #18345 * updates * versions * versions * Merging pull request #18368 * updates * remove console.log * versions * Coinbase Developer Platform - New Wallet Event (#18342) * new component * pnpm-lock.yaml * updates * updates * Hubspot - update search-crm (#18360) * update search-crm * limit results to one page * update version * package.json version * Merging pull request #18347 * widget props * fix version * Adding app scaffolding for rundeck * Merging pull request #18378 * Update Taiga component with new actions and sources - Bump version to 0.1.0 in package.json and add dependency on @pipedream/platform. - Introduce new actions for creating, updating, and deleting issues, tasks, and user stories. - Add sources for tracking changes and deletions of issues and tasks. - Implement utility functions for parsing and cleaning objects in common/utils.mjs. - Enhance prop definitions for better integration with Taiga API. * pnpm update * Refactor Taiga actions to utilize parseObject utility - Added parseObject utility for tags, watchers, and points in update-issue, update-task, and update-userstory actions. - Removed the update-project action as it is no longer needed. - Enhanced base source to include secret key validation for webhook security. * Merging pull request #18382 * add testSources prop * pnpm-lock.yaml * fix * Merging pull request #18323 * Added actions * Added actions * Added actions * Merging pull request #18377 * Added actions * Update components/weaviate/actions/create-class/create-class.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Merging pull request #18376 * Adding app scaffolding for etrusted * Adding app scaffolding for intelliflo_office * Adding app scaffolding for thoughtspot * Adding app scaffolding for kordiam * Adding app scaffolding for ticketsauce * trustpilot fixes (#18152) * trustpilot fixes * more fixes * update versions * more version updates * fixes * Bump all Trustpilot actions to version 0.1.0 Major improvements and API updates across all actions: - Enhanced private API support with proper authentication - Improved parameter handling and validation - Better error handling and response structures - Added new conversation flow for product reviews - Fixed endpoint URLs to match latest API documentation - Streamlined request/response processing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * up version and clean up sources * merge * fix business ID * delete temp action * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-service-reviews/new-service-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * comments * Pagination * fixes * comments * missed some `$`'s * unduplicated * more fixes * final comments * more comments * . --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Adding app scaffolding for peekalink * 18314 twilio (#18350) * Update Twilio component versions and dependencies - Update Twilio Send Message action adding detailed description for 'from' prop and refactoring phone number validation logic. - Incremented action versions for several Twilio actions. * pnpm update * Updating LinkedIn API version (#18399) * Merging pull request #18394 * Databricks API - Jobs action components (#18371) * Notion property building improvements (#18381) * validate property types * versions * Google Business - add debug log (#18407) * add debug log * bump versions * Notion API Key - update @pipedream/notion version (#18409) * update @pipedream/notion dependency version * pnpm-lock.yaml * Adding app scaffolding for reduct_video * Adding app scaffolding for shopware * Adding app scaffolding for instamojo * Hubspot - bug fix to sources w/ property changes (#18379) * updates * versions * Google sheets type fix (#18411) * Fixing worksheetId prop type from string to integer * Version bumps --------- Co-authored-by: Leo Vu <[email protected]> * Merging pull request #18393 * new components * remove console.log * versions * update * Merging pull request #18408 * 403 error message * versions * update * Merging pull request #18419 * Changes per PR Review * Removes leonardo_ai_actions.mdc not indented for merging * synced lockfile after install * fully lock form-data for leonardo_ai * conflict solving * lint fixes * Chipped down Readme, implemented async options in gen motion --------- Co-authored-by: jocarino <[email protected]> Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: michelle0927 <[email protected]> Co-authored-by: Andrew Chuang <[email protected]> Co-authored-by: danhsiung <[email protected]> Co-authored-by: Lucas Caresia <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Job <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Guilherme Falcão <[email protected]> Co-authored-by: Leo Vu <[email protected]>
WHY
Resolves #18126
Summary by CodeRabbit
New Features
Refactor
Chores