You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defrevision_pattern_from_build_bucket_path(bucket_path):
"""Get the revision pattern from a build bucket path."""return'.*?'+os.path.basename(bucket_path)
revision_pattern_from_build_bucket_path will return .*?([0-9]+).*.zip
for a path like gs://builds.fuzz-nprd-53709/123_01bced44.zip, the revision will be 53709 instead of 123.
Some code that shows this:
importreimportosRELEASE_BUILD_BUCKET_PATH="gs://builds.fuzz-nprd-53709/([0-9]+).*.zip"defrevision_pattern_from_build_bucket_path(bucket_path):
"""Get the revision pattern from a build bucket path."""return'.*?'+os.path.basename(bucket_path)
build_url='gs://builds.fuzz-nprd-53709/123_01bced44.zip'revision_pattern=revision_pattern_from_build_bucket_path(RELEASE_BUILD_BUCKET_PATH)
print(f"{revision_pattern}")
match=re.match(revision_pattern, build_url)
revision=match.group(1)
print(f"{revision}")