14
14
Service ,
15
15
get_configmap ,
16
16
get_context_list_from_args ,
17
+ get_logs_explorer_url ,
17
18
get_namespace_list_from_args ,
18
19
parse_config_from_yaml ,
19
20
print_colored ,
23
24
24
25
25
26
# TODO(guy.f): Remove this once we have metrics we use to decide based on.
26
- def get_logs_explorer_url (
27
+ def get_logs_explorer_url_for_proposal (
27
28
namespace : str ,
28
29
validator_id : str ,
29
30
min_block_number : int ,
@@ -38,17 +39,7 @@ def get_logs_explorer_url(
38
39
f'textPayload =~ "DECISION_REACHED:.*proposer 0x0*{ validator_id } "\n '
39
40
f'CAST(REGEXP_EXTRACT(textPayload, "height: (\\ \\ d+)"), "INT64") > { min_block_number } '
40
41
)
41
- # We need to double escape '(' and ')', so first we replace only them with their escaped versions.
42
- query = query .replace ("(" , urllib .parse .quote ("(" )).replace (")" , urllib .parse .quote (")" ))
43
-
44
- # Now "normal" escape everything else
45
- query = urllib .parse .quote (query )
46
-
47
- escaped_project_name = urllib .parse .quote (project_name )
48
- return (
49
- f"https://console.cloud.google.com/logs/query;query={ query } "
50
- f"?project={ escaped_project_name } "
51
- )
42
+ return get_logs_explorer_url (query , project_name )
52
43
53
44
54
45
class RestartStrategy (Enum ):
@@ -186,7 +177,7 @@ def main():
186
177
post_restart_instructions = []
187
178
if args .restart_strategy == RestartStrategy .ONE_BY_ONE :
188
179
for namespace , context in zip (namespace_list , context_list or [None ] * len (namespace_list )):
189
- url = get_logs_explorer_url (
180
+ url = get_logs_explorer_url_for_proposal (
190
181
namespace ,
191
182
get_validator_id (namespace , context ),
192
183
# Feeder could be behind by up to 10 blocks, so we add 10 to the current block number.
0 commit comments