Merge pull request #17154 from Homebrew/cleanup_test_bot_analytics
utils/analytics: cleanup test-bot analytics.
This commit is contained in:
commit
af0f115a23
@ -144,10 +144,23 @@ module Utils
|
||||
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.
|
||||
command = step_command_short.split
|
||||
.map { |arg| arg.sub(/=.*/, "=") }
|
||||
.join(" ")
|
||||
# Sort options to ensure consistent ordering and improve readability.
|
||||
options = options.join(" ")
|
||||
.split
|
||||
.join(" ")
|
||||
.split(/(-+)/)
|
||||
.map { |a| a.sub(/[ =].+/, " ") }
|
||||
.join(" ")
|
||||
.strip
|
||||
.split
|
||||
.sort
|
||||
|
||||
command = (command_and_package + options).join(" ")
|
||||
|
||||
# Fields can have high cardinality.
|
||||
fields = { command: }
|
||||
|
Loading…
x
Reference in New Issue
Block a user