Enforce fields using explicit presence in CI

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

Maintainer thường phản hồi trong vòng 1 ngày

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

Bắt đầu bằng việc xem xét khuyến nghị về explicit presence, quy trình của Buf để yêu cầu các quy tắc lint và tài liệu về Buf check-plugin được liên kết trong issue. Đồng thời xem issue #19 để biết thêm ngữ cảnh liên quan. Công việc được xem là hoàn tất khi dự án có một cơ chế enforcement được duy trì, đảm bảo mọi trường schema đều sử dụng explicit presence.

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

Mô tả

Because protobuf recommends explicit presence for maximum compatibility with protobuf editions, we should enforce that all fields in our schema use explicit presence.

There are at least two good options to support this enforcement:

  • Adding a new lint rule to the Buf CLI: We could make a feature request to Buf that they add a new lint rule enforcing explicit field presence, following their preferred process. They say they'll add rules if they "think they're maintainable and could have widespread value", and since explicit field presence is a documented recommendation directly from the protobuf team, it would be worth giving this approach a shot especially since it is less maintenance work for us in the long run.
  • Creating a Buf check plugin: We could make a custom Buf check plugin following Buf's documentation which enforces explicit presence on all fields. This would probably we less that 50 lines of code, and we could use it in the future to enforce other Accrescent-specific protobuf rules. Since we don't yet have another need for a Buf check plugin, it would be better if we can get an explicit presence lint rule in the Buf CLI isntead, but if that's not possible, writing a Buf check plugin is an acceptable way to go.

See also https://github.com/accrescent/appstore-api/issues/19.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1
Fork
0
Merge trung bình
21 phút
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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.

Issue tương tự

Thêm issue về Backend & API Design

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.