Skip to content

Commit 28077e6

Browse files
authored
Add step start time to ViewStepLog (#24980)
Part of #24876 According to #24876 (comment) , we need the start time of the step to get the log time offset.
1 parent 355a078 commit 28077e6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

routers/web/repo/actions/view.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ type ViewJobStep struct {
106106
}
107107

108108
type ViewStepLog struct {
109-
Step int `json:"step"`
110-
Cursor int64 `json:"cursor"`
111-
Lines []*ViewStepLogLine `json:"lines"`
109+
Step int `json:"step"`
110+
Cursor int64 `json:"cursor"`
111+
Lines []*ViewStepLogLine `json:"lines"`
112+
Started int64 `json:"started"`
112113
}
113114

114115
type ViewStepLogLine struct {
@@ -241,9 +242,10 @@ func ViewPost(ctx *context_module.Context) {
241242
}
242243

243244
resp.Logs.StepsLog = append(resp.Logs.StepsLog, &ViewStepLog{
244-
Step: cursor.Step,
245-
Cursor: cursor.Cursor + int64(len(logLines)),
246-
Lines: logLines,
245+
Step: cursor.Step,
246+
Cursor: cursor.Cursor + int64(len(logLines)),
247+
Lines: logLines,
248+
Started: int64(step.Started),
247249
})
248250
}
249251
}

0 commit comments

Comments
 (0)