Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion api/submitqueue/gateway/proto/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,18 @@ message GetRequestHistoryByIDRequest {
message HistoryEvent {
// Time the request-log entry was created, in Unix milliseconds.
int64 timestamp_ms = 1;
// Customer-friendly request status recorded by the event.
// Customer-friendly request status recorded by the event. Set only when type is "status".
string status = 2;
// Error message associated with the event. Empty when absent.
string last_error = 3;
// Display and debugging metadata associated with this event. Each lifecycle event carries its own values.
map<string, string> metadata = 4;
// What this entry records: "status" when the request reached a position in the pipeline,
// "event" when something happened while it sat at one. Exactly one of status and event is set.
string type = 5;
// Occurrence recorded by the entry, e.g. a build starting or finishing. Set only when type is "event".
// A request records many of these — one per build — and they never change its current status.
string event = 6;
}

// GetRequestHistoryByIDResponse contains all retained events for one request.
Expand Down
30 changes: 26 additions & 4 deletions api/submitqueue/gateway/protopb/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 67 additions & 66 deletions api/submitqueue/gateway/protopb/gateway.pb.yarpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ func ProtoToGetRequestHistoryByChangeURIRequest(req *pb.GetRequestHistoryByChang
}

// HistoryEventsToProto maps retained request-log events to wire history events.
//
// Status and Event are mutually exclusive, mirroring the entry itself: a client
// reading the timeline can render a position and an occurrence differently
// without having to know which values belong to which vocabulary.
func HistoryEventsToProto(logs []entity.RequestLog) []*pb.HistoryEvent {
events := make([]*pb.HistoryEvent, len(logs))
for i, log := range logs {
events[i] = &pb.HistoryEvent{
TimestampMs: log.TimestampMs,
Type: string(log.Type),
Status: string(log.Status),
Event: string(log.Event),
LastError: log.LastError,
Metadata: cloneStringMap(log.Metadata),
}
Expand Down
Loading
Loading