jobs: 0.89.0 changed jobs result shapes from snake_case to camelCase

未關閉
#699 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript

研究方向

Start with packages/appkit/src/connectors/jobs/client.ts and reproduce the runNow() result using the TypeScript snippet in the issue; compare the affected methods and status payloads with the documented behavior. The issue offers two possible resolutions, so confirm which is intended before changing code; done means either restoring the described snake_case shapes or documenting the breaking change and affected fields in the 0.89.0 release notes.

由索引模型根據 Issue 內容生成。

描述

Summary

In 0.89.0, the jobs plugin returns camelCase keys wherever it passes Jobs API objects through: the programmatic API, two routes, and the run object in status payloads. Through 0.88.1 these were snake_case. #647 says "Translate camelCase/bigint models back to the snake_case/number wire shape at the connector boundary, so the plugin's HTTP, SSE and cache output is unchanged", but the merged connector doesn't do that. The release notes list it as a feature, with no breaking-change note. Verified live against a real job on both versions.

Not affected (the common path)

Apps that trigger jobs and react to the status string see no change:

  • POST /api/jobs/:jobKey/run returns { runId } in both versions (confirmed from source).
  • GET /api/jobs/:jobKey/status and the runAndWait() / POST /run?stream=true updates keep the same status values (RUNNING, TERMINATED, and so on).
  • Failure results keep the same shape ({ ok: false, status, message }).
  • @databricks/appkit-ui doesn't read jobs results, so no built-in UI is affected.

Affected

Code that reads fields from a run or job object:

  • appkit.jobs(key).runNow(): data was { run_id, number_in_job, wait } and is now { runId }.
  • getRun, listRuns, lastRun, getRunOutput, getJob: all keys are camelCase. For example, run_id is now runId, run_page_url is now runPageUrl, and state.life_cycle_state is now state.lifeCycleState. TypeScript flags these at compile time; JavaScript gets undefined.
  • GET /runs and GET /runs/:runId: they return result.data directly, so their JSON keys changed. Client code breaks silently.
  • The run object in GET /status and in runAndWait() / streamed status updates: same key change.

Cause

packages/appkit/src/connectors/jobs/client.ts:

  • runNow returns { runId: Number(waiter.runId) }.
  • The other methods pass the modular SDK models through toNumbers. That helper converts bigints to numbers but keeps the SDK's camelCase keys.

Repro

const result = await appkit.jobs("default").runNow();
console.log(Object.keys(result.data));
// 0.88.1: ["run_id", "number_in_job", "wait"]
// 0.89.0: ["runId"]

Why it matters

jobs is exported from the package root, not /beta. The stability doc says only /beta APIs "may change between minor releases".

Ask

Either restore the snake_case shape that #647 describes, or keep camelCase and add a breaking-change note to the 0.89.0 release notes listing the affected methods and fields. Related: docs/plugins/jobs.md already changed to result.data.runId in 0.89.0.

This issue was written by Isaac.

主要語言
TypeScript
星號
119
分支
36
平均合併
4 天 16 小時
30 天內合併 PR
37

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/appkit 的其他 Issue

查看 databricks/appkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。