Proposal: Make preview features configurable
还没有人认领这个 Issue。
评估
调研方向
首先追踪默认 preview Accept 标头和 ListOptions 的处理方式;该 issue 未指定任何文件或测试。定义 RequestOptions API,并确定新 API 应如何处理 preview 标头,然后验证 repository-list 请求可以省略不需要的标头。
由索引模型根据 Issue 内容生成。
描述
Problem
A project I'm working on has an issue where a list of repos is returning a Server Error due to an additional Accept header being added (The "mediaTypeCodesOfConductPreview" header).
Removing this header fixes the problem but I can't do this with the current library implementation.
Solution
Instead of adding these headers by default, we could move them to an Options parameter similar to ListOptions.
type RequestOptions {
acceptHeaders []string
}
Pros
- Allows developers to control which headers to add (including headers the library may not control)
- Removes the maintenance of adding / removing headers from library owners
- Opens the door for any additional request options in the future.
- This will remove the need for comments like
// TODO: remove custom Accept headers when APIs fully launch.
Cons
- Forces users to care about headers
- While a con, users should know if a feature they are using is preview or not and subject to change
Concerns
The only major concern I have with this is approach is that it gets fuzzy what to do with entirely new API's (for example the checks API).
For consistency the API could still require the developer to add the header.
For a sane API the API could add the header with the expectation that the header is removed as soon as possible, but again moves the burden on to the library.
- 主要语言
- Go
- 星标
- 11.3k
- 派生
- 2.5k
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 51
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/go-github 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
prometheus/procfs#872 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
bazel-contrib/rules_go#4726 · 1 条评论 ·
-
area/auto-scaling area/monitoring area/ops-productivity kind/enhancement
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 75/100