utils/analytics: cleanup test-bot analytics.
Sort options to ensure consistent ordering and improve readability. Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
This commit is contained in:
parent
f5cde8ad0d
commit
414e221990
@ -144,10 +144,23 @@ module Utils
|
|||||||
os: HOMEBREW_SYSTEM,
|
os: HOMEBREW_SYSTEM,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
command_and_package, options =
|
||||||
|
step_command_short.split
|
||||||
|
.partition { |arg| !arg.start_with?("-") }
|
||||||
|
|
||||||
# Strip out any flag values to reduce cardinality and preserve privacy.
|
# Strip out any flag values to reduce cardinality and preserve privacy.
|
||||||
command = step_command_short.split
|
# Sort options to ensure consistent ordering and improve readability.
|
||||||
.map { |arg| arg.sub(/=.*/, "=") }
|
options = options.join(" ")
|
||||||
|
.split
|
||||||
.join(" ")
|
.join(" ")
|
||||||
|
.split(/(-+)/)
|
||||||
|
.map { |a| a.sub(/[ =].+/, " ") }
|
||||||
|
.join(" ")
|
||||||
|
.strip
|
||||||
|
.split
|
||||||
|
.sort
|
||||||
|
|
||||||
|
command = (command_and_package + options).join(" ")
|
||||||
|
|
||||||
# Fields can have high cardinality.
|
# Fields can have high cardinality.
|
||||||
fields = { command: }
|
fields = { command: }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user