Skip to content

Commit f536507

Browse files
committed
Use --experiment-run-id instead of --query argument
1 parent fcb4e20 commit f536507

10 files changed

+23
-29
lines changed

components/scripts/gradle/01-validate-incremental-building.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ print_gradle_command() {
140140
}
141141

142142
process_build_scan_data() {
143-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_run_id)"
143+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID"
144144
}
145145

146146
# Overrides summary.sh#print_performance_characteristics

components/scripts/gradle/02-validate-local-build-caching-same-location.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ print_gradle_command() {
145145
}
146146

147147
process_build_scan_data() {
148-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_run_id)"
148+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID"
149149
}
150150

151151
print_introduction() {

components/scripts/gradle/03-validate-local-build-caching-different-locations.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ print_gradle_command() {
150150
}
151151

152152
process_build_scan_data() {
153-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_run_id)"
153+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID"
154154
}
155155

156156
print_introduction() {

components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ validate_required_args() {
117117
}
118118

119119
process_build_scan_data() {
120-
process_build_scan_data_online "$LOGGING_VERBOSE" "$(query_none)"
120+
process_build_scan_data_online "$LOGGING_VERBOSE" "$RUN_ID_NONE"
121121
}
122122

123123
# Overrides summary.sh#print_experiment_specific_summary_info

components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ execute_build() {
225225
}
226226

227227
process_build_scan_data() {
228-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_none)"
228+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID_NONE"
229229
}
230230

231231
# Overrides summary.sh#print_experiment_specific_summary_info

components/scripts/lib/build-scan-online.sh

+14-20
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,32 @@
22

33
readonly LOGGING_BRIEF='brief_logging'
44
readonly LOGGING_VERBOSE='verbose_logging'
5+
readonly RUN_ID_NONE=''
56

67
# Main entrypoint for processing data online using the Build Scan summary tool.
78
# All scripts should call this function to fetch Build Scan data used in the
89
# experiment summary.
910
#
10-
# USAGE: fetch_build_scans_and_build_time_metrics <logging_level> <query>
11+
# USAGE: fetch_build_scans_and_build_time_metrics <logging_level> <run_id>
12+
# EXAMPLE: fetch_build_scans_and_build_time_metrics "$LOGGING_BRIEF" "$RUN_ID"
1113
#
12-
# <logging_level> should be set using either LOGGING_BRIEF or LOGGING_VERBOSE
13-
# constant, e.g., "$LOGGING_BRIEF"
14-
# <query> should be set using either query_none or query_run_id
15-
# function, e.g., "$(query_none)"
14+
# <logging_level> should be set to the constant LOGGING_BRIEF or LOGGING_VERBOSE
15+
# <run_id> should be set to the constant RUN_ID or RUN_ID_NONE depending
16+
# on whether the builds being queried for have a common run id,
17+
# which will only be the case when both builds were produced
18+
# during script execution
1619
process_build_scan_data_online() {
1720
local logging_level="$1"
18-
local query="$2"
21+
local run_id="$2"
1922

2023
# Always call since it will only read if the metadata file exists
2124
read_build_scan_metadata
2225

2326
local build_scan_data
24-
build_scan_data="$(fetch_build_scan_data "${@}")"
27+
build_scan_data="$(fetch_build_scan_data "$logging_level" "$run_id")"
2528
parse_build_scans_and_build_time_metrics "${build_scan_data}"
2629
}
2730

28-
query_none() {
29-
# Intentionally no-op so query definitions can appear consistent
30-
true
31-
}
32-
33-
query_run_id() {
34-
echo "value:\"Experiment run id=$RUN_ID\""
35-
}
36-
3731
read_build_scan_metadata() {
3832
# This isn't the most robust way to read a CSV,
3933
# but we control the CSV so we don't have to worry about various CSV edge cases
@@ -77,7 +71,7 @@ fetch_single_build_scan() {
7771
local build_scan_url="$1"
7872

7973
local build_scan_data
80-
build_scan_data="$(fetch_build_scan_data "$LOGGING_VERBOSE" "$(query_none)")"
74+
build_scan_data="$(fetch_build_scan_data "$LOGGING_VERBOSE" "$RUN_ID_NONE")"
8175

8276
parse_single_build_scan "${build_scan_data}"
8377
}
@@ -90,7 +84,7 @@ fetch_single_build_scan() {
9084
# be done inside this function.
9185
fetch_build_scan_data() {
9286
local logging_level="$1"
93-
local query="$2"
87+
local run_id="$2"
9488

9589
if [[ "${debug_mode}" == "on" ]]; then
9690
args+=("--debug")
@@ -112,8 +106,8 @@ fetch_build_scan_data() {
112106
args+=("--build-scan-availability-wait-timeout" "60")
113107
fi
114108

115-
if [[ -n "${query}" ]]; then
116-
args+=("--query" "$query")
109+
if [[ -n "${run_id}" ]]; then
110+
args+=("--experiment-run-id" "$run_id")
117111
fi
118112

119113
for run_num in "${!build_scan_urls[@]}"; do

components/scripts/maven/01-validate-local-build-caching-same-location.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ print_maven_command() {
150150
}
151151

152152
process_build_scan_data() {
153-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_run_id)"
153+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID"
154154
}
155155

156156
print_introduction() {

components/scripts/maven/02-validate-local-build-caching-different-locations.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ print_maven_command() {
154154
}
155155

156156
process_build_scan_data() {
157-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_run_id)"
157+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID"
158158
}
159159

160160
print_introduction() {

components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ validate_required_args() {
115115
}
116116

117117
process_build_scan_data() {
118-
process_build_scan_data_online "$LOGGING_VERBOSE" "$(query_none)"
118+
process_build_scan_data_online "$LOGGING_VERBOSE" "$RUN_ID_NONE"
119119
}
120120

121121
# Overrides summary.sh#print_experiment_specific_summary_info

components/scripts/maven/04-validate-remote-build-caching-ci-local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ execute_build() {
220220
}
221221

222222
process_build_scan_data() {
223-
process_build_scan_data_online "$LOGGING_BRIEF" "$(query_none)"
223+
process_build_scan_data_online "$LOGGING_BRIEF" "$RUN_ID_NONE"
224224
}
225225

226226
# Overrides summary.sh#print_experiment_specific_summary_info

0 commit comments

Comments
 (0)