aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZettat123 <zettat123@gmail.com>2023-05-29 16:18:36 +0800
committerGitHub <noreply@github.com>2023-05-29 08:18:36 +0000
commit28077e66c0a5593f001e89ef1ff02627dbe029a1 (patch)
tree6c200ccc8b36ef6d27a64fb6e66b5a755bc49fb7
parent355a07819265be32db70108728bec5ad0eec98dd (diff)
downloadgitea-28077e66c0a5593f001e89ef1ff02627dbe029a1.tar.gz
gitea-28077e66c0a5593f001e89ef1ff02627dbe029a1.zip
Add step start time to `ViewStepLog` (#24980)
Part of #24876 According to https://github.com/go-gitea/gitea/pull/24876#discussion_r1205565622 , we need the start time of the step to get the log time offset.
-rw-r--r--routers/web/repo/actions/view.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go
index 2114338612..7c2e9d63d6 100644
--- a/routers/web/repo/actions/view.go
+++ b/routers/web/repo/actions/view.go
@@ -106,9 +106,10 @@ type ViewJobStep struct {
}
type ViewStepLog struct {
- Step int `json:"step"`
- Cursor int64 `json:"cursor"`
- Lines []*ViewStepLogLine `json:"lines"`
+ Step int `json:"step"`
+ Cursor int64 `json:"cursor"`
+ Lines []*ViewStepLogLine `json:"lines"`
+ Started int64 `json:"started"`
}
type ViewStepLogLine struct {
@@ -241,9 +242,10 @@ func ViewPost(ctx *context_module.Context) {
}
resp.Logs.StepsLog = append(resp.Logs.StepsLog, &ViewStepLog{
- Step: cursor.Step,
- Cursor: cursor.Cursor + int64(len(logLines)),
- Lines: logLines,
+ Step: cursor.Step,
+ Cursor: cursor.Cursor + int64(len(logLines)),
+ Lines: logLines,
+ Started: int64(step.Started),
})
}
}