feat(cli): add `--require-active-version` to `coder templates push`

未关闭 适合新手
#32,004 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@jeremyruppel 已经在做这个了。

开始于 2026年11月30日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
cli

调研方向

阅读 coder templates push 的实现以及调度标志共用的许可证检查,然后比较 templates create 和 edit 如何检查 Access Control 权限。对于新模板,设置 CreateTemplateRequest.RequireActiveVersion;对于现有模板,仅在标志已设置时发送 UpdateTemplateMeta.RequireActiveVersion。为这两种路径添加测试,并确认权限检查在 API 调用之前运行。

由索引模型根据 Issue 内容生成。

描述

cli

Part of #31998.

coder templates create --require-active-version makes workspace builds use the template's active version (template admins are exempt). coder templates push has no equivalent flag.

What to change

  • New template: set CreateTemplateRequest.RequireActiveVersion.
  • Existing template: send UpdateTemplateMeta.RequireActiveVersion only when the user sets the flag.
  • License check required. This setting needs the Access Control entitlement. create and `edit` check it before calling the API. Reuse the shared license check from the scheduling flags.

Scope: Small (S), about 20 lines plus a test.

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 摘要。