Merge pull request #17158 from Homebrew/revert_test_bot_analytics_change

utils/analytics: revert a test-bot analytics change.
This commit is contained in:
Mike McQuaid 2024-04-26 15:38:46 +01:00 committed by GitHub
commit caff1359de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,23 +144,13 @@ 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.
# Sort options to ensure consistent ordering and improve readability. # Sort options to ensure consistent ordering and improve readability.
options = options.join(" ") command_and_package, options =
.split step_command_short.split
.join(" ") .map { |arg| arg.sub(/=.*/, "=") }
.split(/(-+)/) .partition { |arg| !arg.start_with?("-") }
.map { |a| a.sub(/[ =].+/, " ") } command = (command_and_package + options.sort).join(" ")
.join(" ")
.strip
.split
.sort
command = (command_and_package + options).join(" ")
# Fields can have high cardinality. # Fields can have high cardinality.
fields = { command: } fields = { command: }