Merge "UI: add gzip compression to files and fix symbolize-ui-crash" into main
diff --git a/tools/symbolize-ui-crash b/tools/symbolize-ui-crash
index 8da6bf3..b6747b4 100755
--- a/tools/symbolize-ui-crash
+++ b/tools/symbolize-ui-crash
@@ -71,14 +71,23 @@
 
   # Look for the GIT commitish appended in crash reports. This is not required
   # for resolving the sourcemaps but helps generating better links.
-  matches = re.findall(r'([a-f0-9]{40})\sUA', txt)
-  git_rev = matches[0] if matches else 'HEAD'
+  matches = re.findall(r'https://ui.perfetto.dev/(.*-)([a-f0-9]{6,})\n', txt)
+  if not matches:
+    logging.fatal('Could not determine the version.'
+                  'The crash report should have a line like: '
+                  '"UI: https://ui.perfetto.dev/v12.3-abcdef"')
+    return 1
 
-  matches = re.findall(r'((\bhttp.+?\.js):(\d+):(\d+))', txt)
+  dir_name = matches[0][0] + matches[0][1]
+  git_rev = matches[0][1]
+  base_url = 'https://commondatastorage.googleapis.com/ui.perfetto.dev/' + dir_name + '/'
+  matches = re.findall(r'(\((.+[.]js):(\d+):(\d+)\))', txt)
   maps_by_url = {}
   sym_lines = ''
   for entry in matches:
     whole_token, script_url, line, col = entry
+    if '/' not in script_url:
+      script_url = base_url + script_url
     map_url = script_url + '.map'
     if map_url in maps_by_url:
       srcmap = maps_by_url[map_url]
diff --git a/ui/release/build_all_channels.py b/ui/release/build_all_channels.py
index 4a61e5e..9aa9c33 100755
--- a/ui/release/build_all_channels.py
+++ b/ui/release/build_all_channels.py
@@ -128,8 +128,8 @@
   print('Uploading to gs://%s' % BUCKET_NAME)
   print('===================================================================')
   cp_cmd = [
-      'gsutil', '-m', '-h', 'Cache-Control:public, max-age=3600', 'cp', '-j',
-      'html,js,css,wasm'
+      'gsutil', '-m', '-h', 'Cache-Control:public, max-age=3600', 'cp', '-z',
+      'html,js,css,wasm,map'
   ]
   for name in os.listdir(merged_dist_dir):
     path = pjoin(merged_dist_dir, name)