Use an Optional type for Event and Attempt fields that log store reads may skip

オープン
#1,189 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
api, backend

調査の方向性

Read the definitions of models.Event and models.Attempt and trace how their fields are marshalled through publish, delivery, MQ messages, filters, destination providers, and the API. Check the existing tests and benchmarks for JSON compatibility and delivery allocations. Done means the optional fields preserve the current wire format, distinguish unread from stored empty values, and meet the stated hot path constraint.

索引モデルが issue の本文から書いたものです。

説明

Log store reads now take an Include option (#1187): ListAttempt reads Event.Data, Event.Metadata and Attempt.ResponseData only when the caller asks for them. So these fields on models.Event and models.Attempt can be absent, and are left nil.

The current types (json.RawMessage, maps) can already be nil, so this works. Nothing in the model says it can happen, though, and nil can't tell "not read" from "stored empty". A generic Optional[T] (Value T, Valid bool) on these three fields would make that visible while writing code: whoever reads the field handles the absent case on purpose. A caller that forgets Include today gets an empty value with no error; for example, a retry would deliver the event with no data. For now, #1187 adds a doc comment on each field.

Things to keep
  • Same wire format: models.Event and models.Attempt go through publish, delivery, MQ messages, filters (ParsedData), every destination provider and the API. Optional[T] must marshal as the inner value (or null) and unmarshal without changing the JSON.
  • Hot path: delivery reads Event.Data on every attempt. Marshalling must not add allocations or reflection.
主要言語
Go
スター
1.1k
フォーク
70
平均マージ
3日 9時間
マージ済み PR(30日)
34

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hookdeck/outpost のほかの issue

hookdeck/outpost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。