Skip to content

Commit

Permalink
Accept Git trailer Build-Id
Browse files Browse the repository at this point in the history
… in place of Piper tag BUILD_NUMBER, to avoid corrupting Git trailers.

b/296119824
  • Loading branch information
dahlstrom-g committed Nov 28, 2023
1 parent c5a4b3c commit 0fcd321
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 0fcd321

Please sign in to comment.