Explain job log resolution reason

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-04-11 14:51:39 +01:00
parent b65286125b
commit f337ce90a0
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -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))