Skip to content

Build details: use first command to infer build length #644

@humitos

Description

@humitos

We have this code

this.length.subscribe((length) => {
let duration;
if (length) {
duration = dayjs.duration(length, "seconds");
} else {
// Infer length from build start time
const dateNow = dayjs();
const dateStart = dayjs(this.date());
duration = dayjs.duration(dateNow.diff(dateStart));
}
let formatParts = ["s[s]"];
if (duration.minutes()) {
formatParts.unshift("m[m]");
}
if (duration.hours()) {
formatParts.unshift("H[h]");
}
this.length_display(duration.format(formatParts.join(" ")));
});

that infers the build duration based on Build.date. However, that date may not be accurate if the build was not immediate executed, or if it was retried a few times.

To make this infer more accurate, we should use the BuildCommand.start_date from the first build command (usually, git clone). That will give use a more realistic value here.

Metadata

Metadata

Labels

ImprovementMinor improvement to code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions