@@ -80,7 +80,17 @@ parse_build_scan_row() {
80
80
while IFS=, read -r run_num field_1 field_2 field_3 field_4 field_5 field_6 field_7 field_8 field_9 field_10 field_11 field_12 field_13 field_14 field_15 field_16 field_17 field_18 field_19 field_20 field_21; do
81
81
debug " Build Scan $field_4 is for build $run_num "
82
82
83
- project_names[run_num]=" ${field_1} "
83
+ # The project_name should be overridden by Build Scan data if it is
84
+ # available. This is so that the project names displayed in the summary are
85
+ # consistent with what is shown in the Build Scan.
86
+
87
+ if [ -n " ${field_1} " ]; then
88
+ project_names[run_num]=" ${field_1} "
89
+ fi
90
+
91
+ # If the following fields are already valued, then they should not be
92
+ # overridden by Build Scan data. For locally executed builds, this data is
93
+ # determined by the scripts as a result of execution.
84
94
85
95
if [ -z " ${base_urls[run_num]} " ]; then
86
96
base_urls[run_num]=" ${field_2} "
@@ -90,8 +100,6 @@ parse_build_scan_row() {
90
100
build_scan_urls[run_num]=" ${field_3} "
91
101
fi
92
102
93
- build_scan_ids[run_num]=" ${field_4} "
94
-
95
103
if [ -z " ${git_repos[run_num]} " ]; then
96
104
git_repos[run_num]=" ${field_5} "
97
105
fi
@@ -112,6 +120,11 @@ parse_build_scan_row() {
112
120
build_outcomes[run_num]=" ${field_9} "
113
121
fi
114
122
123
+ # The below fields are always set by Build Scan data regardless of their
124
+ # previous value and are always safe to override.
125
+
126
+ build_scan_ids[run_num]=" ${field_4} "
127
+
115
128
remote_build_cache_urls[run_num]=" ${field_10} "
116
129
remote_build_cache_shards[run_num]=" ${field_11} "
117
130
0 commit comments