Patching with comments
評価
調査の方向性
Value.Patch エントリーポイントから開始し、2 つの patch の例を比較して、挿入された値の周囲のコメントがどのように処理されるかを追跡します。patch 対象のオブジェクトの外側にあるコメントを保持できるかどうかを判断し、その結果得られるポリシーが要求された人間が読みやすいコメントを保持することを検証します。
索引モデルが issue の本文から書いたものです。
説明
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"],
},
- 主要言語
- Go
- スター
- 892
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tailscale/hujson のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Standardize modifies its input slice; the doc comment does not say so対応中かも @jihtsan が 29 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Value.Patch: "add" with an out-of-range array index appends instead of failing対応中かも @SashaMIT が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Value.Patch: "test" operation always fails for a null value対応中かも @RaphaelFakhri が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
tailscale/hujson の issue をすべて見る
似ている issue
-
area: interop area: sip-core v3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
fonoster/routr#705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deadfin-org/deadfin#35 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
enhancement priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
labmonkeys-space/nl6#1037 ·
メンテナーはふだん 1 日以内に返信
-
Setup Guide Go tab: say it needs Go 1.26 (the unversioned go get pulls OpenTelemetry Go v1.47.0)オープンenhancement follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信