Skip to content

Commit

Permalink
utils/analytics: revert a test-bot analytics change.
Browse files Browse the repository at this point in the history
#17154 (comment) was
ignored by auto-merge, whoops.
  • Loading branch information
MikeMcQuaid committed Apr 26, 2024
1 parent af0f115 commit ecd96a2
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Library/Homebrew/utils/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,13 @@ def report_test_bot_test(step_command_short, passed)
os: HOMEBREW_SYSTEM,
}

# Strip out any flag values to reduce cardinality and preserve privacy.
# Sort options to ensure consistent ordering and improve readability.
command_and_package, options =
step_command_short.split
.map { |arg| arg.sub(/=.*/, "=") }
.partition { |arg| !arg.start_with?("-") }

# Strip out any flag values to reduce cardinality and preserve privacy.
# 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(" ")
command = (command_and_package + options.sort).join(" ")

# Fields can have high cardinality.
fields = { command: }
Expand Down

0 comments on commit ecd96a2

Please sign in to comment.