v0.8.3
AutoCRUD v0.8.3 發布說明
AutoCRUD v0.8.3 是一個著重於平台成熟度、可擴充性與穩定性的版本。本次更新擴展了自訂商業流程的支援、強化了 schema 與型別處理能力、改善了 migration 與 revision 工具鏈,並大幅升級了自動生成的 Web Admin 體驗。
版本亮點
- 新增 Unique 欄位約束支援,提升資料一致性與完整性
- 擴充自訂商業流程能力,支援 create / update action,並可透過 job 或 background task 非同步執行
- 強化 job 系統穩定性,加入 heartbeat、stale job failover、retry 控制、logs 與 artifact 支援
- 重構 Web generator,改善既有 React 專案整合流程,並支援 Mantine 8 與更穩定的程式碼生成
- 大幅強化 union type、tagged union、ref、enum、nullable nested fields 等複雜型別在後端與前端生成結果中的正確性
- 改善指定 revision 的 migration 支援,並補強 Web 端 migration 流程
後端與 API 強化
這個版本進一步擴展了 AutoCRUD 可直接建模與自動化的能力。除了新增 custom POST endpoint,也讓 Ref 在 resource ID 與 revision ID 的處理更完整,並透過新的 action API,讓使用者能在標準 CRUD 之外更容易建立領域專屬流程。
重要後端改進包含:
- Unique 欄位限制支援
- 更完整的 typing introspection 工具
- 支援非同步 create / update action
- 改善 context-based usage,例如在操作中傳入 user context
- 新增 PostgreSQL resource store 與對應 storage factory
- 強化 blob upload 與 multipart 行為
- 集中式錯誤處理,讓 API 行為更一致
Web Generator 與 Admin UI 改進
本次版本在 Web 端投入了大量改進。新的 integrate command 讓 AutoCRUD 更容易整合進既有 React 專案,而 generator 與 app 本身也變得更穩定、更容易客製化。
重點包含:
- 新增 integrate command,方便整合到既有專案
- 重構 generator 架構,提升以 OpenAPI 為基礎的生成穩定性
- 支援 Mantine 8,並修正相關整合問題
- 生成 app 支援 dev proxy
- ResourceTable 導入 server/client hybrid 模式,資料抓取更聰明
- 更好的預設排序與表格使用體驗
- 支援 rerun button 與更完整的 job 視圖
- 增加更多元的元件客製化能力
- 改善 RefSelect 與 row selection 體驗
- 更清楚地區分 resource 與 job 頁面
Jobs、非同步工作流與可觀測性
AutoCRUD v0.8.3 對長時間執行工作流程做了明顯強化,使 async flow 更接近 production-ready。
主要提升包含:
- 加入 heartbeat 機制,可偵測 stale jobs 並標記為失敗
- 建立 job 時可設定 max retries
- Job 支援 artifacts 與 logs,後端與 Web UI 都能查看
- 改善 RabbitMQ 與 Celery 在長時間任務下的穩定性
- 支援以 background task 為基礎的 async job flow
- 改善 admin 介面的 rerun 與監控體驗
Schema、型別與表單穩定性
本次版本也針對複雜 schema 與自動生成 UI 的正確性進行了大量修正,讓 unions、巢狀模型、表單、refs 與 TypeScript 生成結果更可靠。
改善內容包含:
- 修正 union type 造成的名稱解析錯誤
- 修正 union type 作為 model 時的處理
- 修正複雜 union 表單欄位與 detail 頁面渲染
- 修正 tagged union 的 TypeScript 生成
- 修正 generated enum 與 OpenAPI schema 輸出
- 修正 nullable nested fields 與遞迴欄位結構
- 修正 int / float 等數值型別邊界情況
list[str]在 Web UI 中可更自然地映射為 tags input- 改善 Ref 在 path params、query params 與 embed body 下的處理
穩定性、效能與品質改善
這個版本也包含多項穩定性與效能提升:
- 修正 count API,讓它正確忽略 pagination 設定
- 加快 dump / load 效能
- 改善 query failure 時的資料庫連線清理
- 修正 timezone-aware datetime 行為
- 對 boto3 與 PostgreSQL 相關模組改為 lazy import,降低非必要依賴負擔
- 加入 benchmark 工具與更多 protection tests
- 修正 migration 限制與多項 generator / import 問題
- 在排序中加入額外 tiebreaker,讓結果更穩定
升級提醒
- 生成 app 的結構已有演進,generated code 的組織方式與先前版本不同
- 產生新 app 時,測試檔現在預設不會一併生成
- 如果你有使用 web integrate 流程,建議重新整合或重新產生,以套用最新修正
- 若專案使用 custom actions、jobs 或複雜 schema 型別,升級後會明顯感受到穩定性改善
完整變更
完整差異請參考:
v0.8.2...v0.8.3
What's Changed
- wizard add job handler template by @HYChou0515 in #144
- add Unique field constraint support by @HYChou0515 in #146
- fix union type causing .name attribute error by @HYChou0515 in #152
- fix dot in $ref by @HYChou0515 in #153
- add integrate command by @HYChou0515 in #154
- fix union type as model by @HYChou0515 in #164
- payloadConfig should not extract zodSchema by @HYChou0515 in #165
- add type_utils to handle typing introspection by @HYChou0515 in #171
- Ref support revision and resource id by @HYChou0515 in #173
- add rerun button by @HYChou0515 in #175
- add custom post endpoint by @HYChou0515 in #176
- avoid using deprecated endpoints for get by @HYChou0515 in #177
- fix count api, it should ignore page by @HYChou0515 in #178
- feat: ResourceTable server/client hybrid mode with smart data fetching by @HYChou0515 in #179
- fix imports by @HYChou0515 in #180
- fix complex union form fields and detail page by @HYChou0515 in #181
- fix job depth issue by @HYChou0515 in #182
- gen app support dev proxy by @HYChou0515 in #183
- change generated directory by @HYChou0515 in #184
- no test in generate by default by @HYChou0515 in #185
- list[str] is now tags input by @HYChou0515 in #194
- fix int|float both number error by @HYChou0515 in #195
- fix nullable nested fields, more recursive fields, binary for union by @HYChou0515 in #196
- fix integrate issues and add support for mantine 8 by @HYChou0515 in #197
- fix Ref for path and query param, and body(embed=True) by @HYChou0515 in #199
- fix custom add action by @HYChou0515 in #200
- fix #201 by @HYChou0515 in #202
- put conn when test_query failed by @HYChou0515 in #204
- add heartbeat and mark stale jobs as fail by @HYChou0515 in #205
- add include_delete in get requests and add permently delete route by @HYChou0515 in #206
- speed up dump load by @HYChou0515 in #209
- fix Schema encoder; should match resource managers's by @HYChou0515 in #210
- fix patch.py on unique constraint fail by @HYChou0515 in #214
- remove generated from .gitignore by @HYChou0515 in #215
- centralize error handling by @HYChou0515 in #219
- migration for revision and migration web by @HYChou0515 in #220
- fix generated enum by @HYChou0515 in #221
- fix generated typescript types for tagged union by @HYChou0515 in #222
- web support revision/ resource id reference by @HYChou0515 in #225
- add max_retries to job so it can be set during job creation by @HYChou0515 in #226
- support artifact and logs in jobs by @HYChou0515 in #227
- add support to migration function with struct instead of io[bytes] by @HYChou0515 in #228
- 問題:MigrateProgress 和 MigrateResult 沒有被加入 OpenAPI 的 components/schemas… by @HYChou0515 in #237
- 新增@crud.create_action(..., async_mode='job') by @HYChou0515 in #243
- Rearchitecture web generator by @HYChou0515 in #248
- add some protection tests by @HYChou0515 in #249
- add missing heartbeat for rabbitmq and celery, and fix connection closed for rabbitmq for long running job by @HYChou0515 in #250
- use dependency to get user for custom creation by @HYChou0515 in #251
- resource table sorted by updated time decr by default by @HYChou0515 in #253
- web component新增更多客製選項; custom create job resource預設不該有create button by @HYChou0515 in #254
- add benchmark.py by @HYChou0515 in #255
- fix union type and list type cannot be transformed into form correctly by @HYChou0515 in #264
- fix timezone aware datetime by @HYChou0515 in #265
- web enhance by @HYChou0515 in #271
- no remove mantine-form-zod-resolver for mantine 8 by @HYChou0515 in #275
- zod.array() to zod.array(zod.any()) by @HYChou0515 in #276
- boto3 and pg stuff should be lazily imported by @HYChou0515 in #277
- add python multipart by @HYChou0515 in #278
- impl relative walkup instead of pathlib walk_up by @HYChou0515 in #279
- 在排序中增加兩層 tiebreaker by @HYChou0515 in #280
- fix create action without params by @HYChou0515 in #281
- fix timeline squashed by @HYChou0515 in #282
- add loader on waiting for update result by @HYChou0515 in #284
- Revert "add loader on waiting for update result" by @HYChou0515 in #286
- use useQuery by @HYChou0515 in #285
- fix migration only 10 records by @HYChou0515 in #288
- add async job using background task by @HYChou0515 in #289
- fix tooltip text color by @HYChou0515 in #291
- limit playload show in json view by @HYChou0515 in #292
- add update_action by @HYChou0515 in #293
- separate resource and jobs by @HYChou0515 in #294
- add update action async (job and background task) by @HYChou0515 in #296
- add postgres resource store and postgresstoragefactory by @HYChou0515 in #297
- add usage like using context and create(..., user=...) by @HYChou0515 in #299
- add using ops by @HYChou0515 in #301
- apply app also auto apply openapi by @HYChou0515 in #302
- enhance blob upload by @HYChou0515 in #305
- refactor refselect and add row selection in ResourceTable for it by @HYChou0515 in #308
- Web cov by @HYChou0515 in #311
- Fix 309 by @HYChou0515 in #314
Full Changelog: v0.8.2...v0.8.3