Skip to content

Commit affec7f

Browse files
shiv-tyagipeterbarker
authored andcommitted
fix regex causing incorrect reporting of build completion percentage
1 parent f1ecd13 commit affec7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ def get_build_progress(build_id, build_status):
360360
log_file_path = os.path.join(outdir_parent,build_id,'build.log')
361361
app.logger.info('Opening ' + log_file_path)
362362
build_log = open(log_file_path, encoding='utf-8').read()
363-
compiled_regex = re.compile(r'(\[(\d+\/\d+)\])')
363+
compiled_regex = re.compile(r'(\[\D*(\d+)\D*\/\D*(\d+)\D*\])')
364364
all_matches = compiled_regex.findall(build_log)
365365

366366
if (len(all_matches) < 1):
367367
return 0
368368

369-
completed_steps, total_steps = all_matches[-1][1].split('/', 1)
369+
completed_steps, total_steps = all_matches[-1][1:]
370370
if (int(total_steps) < 20):
371371
# these steps are just little compilation and linking that happen at initialisation
372372
# these do not contribute significant percentage to overall build progress

0 commit comments

Comments
 (0)