feat(cli): add `--failure-ttl` to `coder templates push`

未關閉 適合新手
#32,001 1 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@jeremyruppel 已經在處理了。

開始於 2026年11月30日。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
cli

研究方向

從 coder templates push 的實作著手,並比較 coder templates create 和 edit 如何檢查 Advanced Template Scheduling 權限。追蹤新建與既有範本請求的建構位置,並找到相關的 push 測試。新增 --failure-ttl,更新適當的請求欄位,並與 dormancy 旗標共用權限檢查;完成標準是:只有在設定旗標時才傳送,未獲授權的部署會回報此限制,且測試涵蓋兩種路徑。

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

描述

cli

Part of #31998.

coder templates create --failure-ttl sets how long after a failed start build Coder waits before stopping the workspace ("Failure cleanup" in the UI). coder templates push has no equivalent flag.

What to change

  • New template: set CreateTemplateRequest.FailureTTLMillis.
  • Existing template: send UpdateTemplateMeta.FailureTTLMillis only when the user sets the flag.
  • License check required. This setting needs the Advanced Template Scheduling entitlement. On unlicensed (AGPL) deployments, the server keeps the old value without returning an error, so push would look like it worked when it didn't. Check entitlements first, the same way `create` and `edit` do. --failure-ttl, --dormancy-threshold and --dormancy-auto-deletion should share one check.

Scope: Small (S), about 20 lines plus a test. Add another 20 to 30 lines for whichever of the three adds the shared license check first.

Created on behalf of @angrycub

主要語言
Go
星號
17.5k
分支
1.7k
平均合併
2 天 23 小時
30 天內合併 PR
575

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

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

coder/coder 的其他 Issue

查看 coder/coder 的全部 Issue

相似的 Issue

更多 Go Issue

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

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