From fb24a204c36962cfe3752d6d264316fdc094266b Mon Sep 17 00:00:00 2001 From: cobalt-github-releaser-bot <95661244+cobalt-github-releaser-bot@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:00:00 -0800 Subject: [PATCH] Accept Git trailer Build-Id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … in place of Piper tag BUILD_NUMBER, to avoid corrupting Git trailers. (cherry picked from commit 0e24f1d5c0d71c523c22541dd5192c8e762d21d7) Issue: 296119824 Reviewed-on: https://github.com/youtube/cobalt/pull/2013 Reviewed-on: https://github.com/youtube/cobalt/pull/2018 --- cobalt/build/gyp_cobalt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobalt/build/gyp_cobalt b/cobalt/build/gyp_cobalt index 4ca69c367c28..a2347dc3fa2d 100755 --- a/cobalt/build/gyp_cobalt +++ b/cobalt/build/gyp_cobalt @@ -47,7 +47,7 @@ COMMIT_COUNT_BUILD_NUMBER_OFFSET = 1000000 # Matches numbers > 1000000. The pattern is basic so git log --grep is able to # interpret it. GIT_BUILD_NUMBER_PATTERN = r'[1-9]' + r'[0-9]' * 6 + r'[0-9]*' -BUILD_NUMBER_TAG_PATTERN = r'^BUILD_NUMBER={}$' +BUILD_NUMBER_TAG_PATTERN = r'^(Build-Id: |BUILD_NUMBER=){}$' # git log --grep can't handle capture groups. BUILD_NUBER_PATTERN_WITH_CAPTURE = '({})'.format(GIT_BUILD_NUMBER_PATTERN) @@ -160,7 +160,7 @@ def GetBuildNumberFromCommits(): BUILD_NUMBER_TAG_PATTERN.format(BUILD_NUBER_PATTERN_WITH_CAPTURE), flags=re.MULTILINE) match = full_pattern_with_capture.search(output) - return match.group(1) if match else None + return match.group(2) if match else None def GetBuildNumberFromServer():