uber / uber/submitqueue

Consider a generic change-URI metadata/augmentation language (Change API)

Đang mở
#209 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Go
Star
225
Fork
11
Merge trung bình
3 ngày 8 giờ
Pull request đã merge (30 ngày)
61

Mô tả

Context

In #197, the extension fakes inject failures via an ad-hoc sq-fake=<token>
marker embedded in a change URI, parsed by the test-only core/fakemarker
package (Token([]string) / TokenInChanges([]entity.Change)).

Reviewing that PR, @sbalabanov raised two related design questions:

  • Should we build a generic augmentation / metadata language into change
    URIs, usable by these fakes and similar tooling — rather than a
    fake-specific marker convention?
  • The marker lookup (TokenInChanges) arguably belongs on the Change API
    (entity.Change) rather than living in a test-only helper.

This issue captures that idea as a follow-up so #197 can land as-is (the marker
stays test-only there).

Design considerations

A generic change-URI metadata facility would need to reconcile with the
strict provider change-ID parsers, which today reject anything that isn't a
canonical resource identifier:

  • submitqueue/entity/github/change_id.go — requires a full 40-char lowercase
    hex head SHA; a ?key=value query string would not parse.
  • submitqueue/entity/phabricator/change_id.go — fixed phab:// form.
  • submitqueue/extension/changeprovider/github/validate.go — rejects
    unexpected schemes.

Open questions:

  1. Scope — is URI-attached metadata a production capability, or strictly a
    test/example affordance? Putting parsing on entity.Change couples the
    production type to the convention; keeping it in core/fakemarker keeps the
    separation the fakes deliberately maintain ("never production").
  2. Shape — RFC-3986 query params (?k=v) vs. fragment vs. a dedicated
    sidecar field on Change. Query params collide with the strict parsers
    above; a typed field avoids string-encoding entirely.
  3. Generality — a neutral key → value accessor (e.g.
    Change.URIParam(key)) that fakemarker layers sq-fake semantics on top
    of, vs. a richer metadata model.

References

  • PR #197 — fake implementations with error injection
  • Threads: the core/fakemarker.go discussion in #197.

Filed as a follow-up per the #197 review discussion. Not blocking.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách đọc Change API và các parser được tham chiếu: submitqueue/entity/github/change_id.go, submitqueue/entity/phabricator/change_id.go và submitqueue/extension/changeprovider/github/validate.go. Xem lại PR #197 và cuộc thảo luận về core/fakemarker trước khi so sánh các tham số truy vấn, fragment và một trường Change có kiểu. Được xem là hoàn tất khi đã giải quyết các câu hỏi về phạm vi, hình dạng và tính tổng quát, đồng thời ghi lại hoặc triển khai thiết kế đã chọn mà không làm hỏng việc xác thực change-ID nghiêm ngặt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go
Lĩnh vực
backend-api-design
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.