From f337ce90a07284634ab1db67cf823fcbc8f25799 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Fri, 11 Apr 2025 14:51:39 +0100 Subject: [PATCH] Explain job log resolution reason Signed-off-by: Babak K. Shandiz --- pkg/cmd/run/view/view.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/run/view/view.go b/pkg/cmd/run/view/view.go index b769028bc..55be7f5f4 100644 --- a/pkg/cmd/run/view/view.go +++ b/pkg/cmd/run/view/view.go @@ -668,9 +668,10 @@ func truncateAsUTF16(str string, max int) string { // where the ID can apparently be negative. func attachRunLog(rlz *zip.Reader, jobs []shared.Job) { for i, job := range jobs { - // the normal job run log file is preferred over the legacy one. So, we - // try to find the normal log file, and if we couldn't find it then we - // look for the legacy one, if any. + // As a highest priority, we try to use the step logs first. We have seen zips that surprisingly contain + // step logs, normal job logs and legacy job logs. In this case, both job logs would be ignored. We have + // never seen a zip containing both job logs and no step logs, however, it may be possible. In that case + // let's prioritise the normal log over the legacy one. jobLog := matchFileInZIPArchive(rlz, jobLogFilenameRegexp(job)) if jobLog == nil { jobLog = matchFileInZIPArchive(rlz, legacyJobLogFilenameRegexp(job))