Skip to content

Commit

Permalink
Merge pull request #17158 from Homebrew/revert_test_bot_analytics_change
Browse files Browse the repository at this point in the history
utils/analytics: revert a test-bot analytics change.
  • Loading branch information
MikeMcQuaid committed Apr 26, 2024
2 parents af0f115 + ecd96a2 commit caff135
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 caff135

Please sign in to comment.