Patching with comments
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu từ điểm vào Value.Patch và so sánh hai ví dụ patch để theo dõi cách các chú thích được xử lý xung quanh một giá trị được chèn. Xác định xem các chú thích bên ngoài đối tượng được patch có thể được giữ lại hay không, đồng thời xác minh rằng policy kết quả vẫn giữ lại chú thích dễ đọc đối với con người được yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey all- we're updating our tailnet config to have a posture/ grant per production device on our network, since we have a load of devices, and we don't want to manage this by hand, and because we want to use time-based/ device-based access.
It's working very nicely (loving the Value.Patch() function).
Is there anyway of patching in comments, too, outside of the patched in object? We still want people to be able to hand read/ review the policy, and being able to add comments would help that a lot.
If I set my patch like:
err = v.Patch([]byte(`[
{"op": "add", "path": "/grants/0", "value":{
"src": ["autogroup:member"],
// My super duper device
"dst": ["ipset:super_duper_device"],
"srcPosture": ["posture:super_duper_device_TemporaryFullAccess"]}}
]`))
if err != nil {
panic(err)
}
Then sure enough, I see:
"grants": [
{
"src": ["autogroup:member"],
// My super duper device
"dst": ["ipset:super_duper_device"],
"srcPosture": ["posture:super_duper_device_TemporaryFullAccess"],
},
But if I move the comment outside of the block as per:
err = v.Patch([]byte(`[
{"op": "add", "path": "/grants/0", "value":
// My super duper device
{
"src": ["autogroup:member"],
"dst": ["ipset:super_duper_device"],
"srcPosture": ["posture:super_duper_device_TemporaryFullAccess"]}}
]`))
if err != nil {
panic(err)
}
Then the comment isn't persisted:
"grants": [
{
"src": ["autogroup:member"],
"dst": ["ipset:super_duper_device"],
"srcPosture": ["posture:super_duper_device_TemporaryFullAccess"],
},
- Ngôn ngữ chính
- Go
- Star
- 892
- Fork
- 40
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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
- Đọ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 tailscale/hujson
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Standardize modifies its input slice; the doc comment does not say soCó thể đã có người làm @jihtsan đã nhận 29 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Value.Patch: "add" with an out-of-range array index appends instead of failingCó thể đã có người làm @SashaMIT đã nhận 32 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Value.Patch: "test" operation always fails for a null valueCó thể đã có người làm @RaphaelFakhri đã nhận 34 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Tất cả issue của tailscale/hujson
Issue tương tự
-
area: interop area: sip-core v3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fonoster/routr#705 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deadfin-org/deadfin#35 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
enhancement priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
labmonkeys-space/nl6#1037 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Setup Guide Go tab: say it needs Go 1.26 (the unversioned go get pulls OpenTelemetry Go v1.47.0)Đang mởenhancement follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày