Proposal: Make preview features configurable
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách truy vết cách các header Accept preview mặc định và ListOptions được xử lý; issue không nêu tên tệp hay test nào. Xác định API RequestOptions và làm rõ các API mới nên xử lý header preview như thế nào, sau đó xác minh rằng các request liệt kê repository có thể bỏ qua header không mong muốn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 11.3k
- Fork
- 2.5k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 51
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/go-github
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Add actions policies endpoints Đang mở
google/go-github#4583 · 2 bình luận · 1 reaction · 1 người được giao ·
-
google/go-github#4526 · 1 bình luận · 1 reaction · 1 người được giao ·
Tất cả issue của google/go-github
Issue tương tự
-
ai-generated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SiaFoundation/indexd#1116 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wakatime/wakatime-cli#1585 ·