Skip to content

Commit

Permalink
Cherry pick PR #2013: Accept Git trailer Build-Id (#2020)
Browse files Browse the repository at this point in the history
Refer to the original PR: #2013

… in place of Piper tag BUILD_NUMBER, to avoid corrupting Git trailers.

b/296119824

Co-authored-by: Dana Dahlstrom <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and dahlstrom-g authored Dec 1, 2023
1 parent 33234a3 commit b02c49d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cobalt/build/build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
FILE_DIR = os.path.dirname(__file__)
COMMIT_COUNT_BUILD_ID_OFFSET = 1000000

_BUILD_ID_PATTERN = '^BUILD_NUMBER=([1-9][0-9]{6,})$'
_BUILD_ID_PATTERN = '^(Build-Id: |BUILD_NUMBER=)([1-9][0-9]{6,})$'
_GIT_REV_PATTERN = '^GitOrigin-RevId: ([0-9a-f]{40})$'
_COBALT_VERSION_PATTERN = '^#define COBALT_VERSION "(.*)"$'

Expand All @@ -40,7 +40,7 @@ def get_build_id_and_git_rev_from_commits(cwd):
match_build_id = compiled_build_id_pattern.search(output)
if not match_build_id:
return None, None
build_id = match_build_id.group(1)
build_id = match_build_id.group(2)

# Gets git rev.
compiled_git_rev_pattern = re.compile(_GIT_REV_PATTERN, flags=re.MULTILINE)
Expand Down

0 comments on commit b02c49d

Please sign in to comment.