From 44b39e828b1a96edc7991b8bc069be725ae32c57 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Tue, 14 Jul 2026 17:54:27 +0100 Subject: [PATCH] fix: strip stray leading blank line from extracted conda lock file extractCondaLockFile() took the substring right after the >> CONDA_LOCK_START marker but before that BuildKit log line's own trailing newline. Every later line's "#N T.T " prefix gets stripped by the existing regex, but that first newline was never part of a prefix, so it survived as a leading blank line in every extracted conda lock file. Two existing tests had the leading blank line baked into their expected output rather than catching it; updated both. --- .../service/logs/BuildLogServiceImpl.groovy | 1 + .../service/logs/BuildLogsServiceTest.groovy | 22 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy index d6e748e517..d806a105b3 100644 --- a/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy @@ -194,6 +194,7 @@ class BuildLogServiceImpl implements BuildLogService { } return logs.substring(start + CONDA_LOCK_START.length(), end) .replaceAll(/#\d+ \d+\.\d+\s*/, '') + .stripLeading() } String fetchValidCondaLock(String buildId) { diff --git a/src/test/groovy/io/seqera/wave/service/logs/BuildLogsServiceTest.groovy b/src/test/groovy/io/seqera/wave/service/logs/BuildLogsServiceTest.groovy index a4a9abafd0..595ca6bd21 100644 --- a/src/test/groovy/io/seqera/wave/service/logs/BuildLogsServiceTest.groovy +++ b/src/test/groovy/io/seqera/wave/service/logs/BuildLogsServiceTest.groovy @@ -108,12 +108,11 @@ class BuildLogsServiceTest extends Specification implements AwsS3TestContainer { def result = service.extractCondaLockFile(logs) then: - result == """ - # This file may be used to create an environment using: - # \$ conda create --name --file - # platform: linux-aarch64 - @EXPLICIT - """.stripIndent() + result == """# This file may be used to create an environment using: +# \$ conda create --name --file +# platform: linux-aarch64 +@EXPLICIT +""" } def 'should extract conda lockfile from s3' (){ @@ -155,12 +154,11 @@ class BuildLogsServiceTest extends Specification implements AwsS3TestContainer { service.storeCondaLock(buildID, logs) then: - service.fetchCondaLockString(buildID) == """ - # This file may be used to create an environment using: - # \$ conda create --name --file - # platform: linux-aarch64 - @EXPLICIT - """.stripIndent() + service.fetchCondaLockString(buildID) == """# This file may be used to create an environment using: +# \$ conda create --name --file +# platform: linux-aarch64 +@EXPLICIT +""" } def 'should throw no exception when there is no conda lockfile in logs' (){