Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/analytics: cleanup test-bot analytics. #17154

Merged
merged 1 commit into from Apr 26, 2024

Conversation

MikeMcQuaid
Copy link
Member

Sort options to ensure consistent ordering and improve readability.

Library/Homebrew/utils/analytics.rb Outdated Show resolved Hide resolved
step_command_short.split
.map { |arg| arg.sub(/=.*/, "=") }
.partition { |arg| !arg.start_with?("-") }
command = (command_and_package + options.sort).join(" ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to do options.sort then we may also want to deal with --option foo flags (since we only currently handle --option=foo flags by stripping the foo).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlocab handled in 414e221. not the most elegant but: it works and should be reliable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlocab If this is overkill: we could probably pull it all out. We don't use any long flags in brew test-bot like this now, even moreso after the filtering in Homebrew/homebrew-test-bot#1043

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems overkill TBH. Better to pull it out, especially since I think the earlier call to partition also means that the foo in --flag foo gets put in command_and_package, so not sure it really does what's needed

Sort options to ensure consistent ordering and improve readability.

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge after #17154 (comment)

@MikeMcQuaid MikeMcQuaid merged commit af0f115 into master Apr 26, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the cleanup_test_bot_analytics branch April 26, 2024 14:16
@MikeMcQuaid
Copy link
Member Author

@carlocab Whoops, auto-merge, follow-up incoming.

MikeMcQuaid added a commit that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants