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

Support `brew pull --bottle` for taps in organizations other than Homebrew #3279

Merged
merged 5 commits into from Oct 18, 2017

Conversation

Projects
None yet
2 participants
@sjackman
Contributor

sjackman commented Oct 7, 2017

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

Infer the name of the Bintray organization and test-bot GitHub user if either is not provided.
If the GitHub organization is Homebrew, infer that the Bintray organization is homebrew, and the GitHub test-bot user is BrewTestBot.
Otherwise, if the GitHub organization is Foo, infer that the Bintray organization is foo, and the GitHub test-bot user is FooTestBot.
Add options --bintray-org and --test-bot-user to override these inferences.

Show outdated Hide outdated Library/Homebrew/dev-cmd/pull.rb Outdated
test_bot = ARGV.value "test-bot-user"
return test_bot if test_bot
return "BrewTestBot" if user.casecmp("homebrew").zero?
"#{user.capitalize}TestBot"

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Oct 8, 2017

Member

I wonder if this is a bit magic and we should just require this argument to get passed. Thoughts?

@MikeMcQuaid

MikeMcQuaid Oct 8, 2017

Member

I wonder if this is a bit magic and we should just require this argument to get passed. Thoughts?

This comment has been minimized.

@sjackman

sjackman Oct 8, 2017

Contributor

For a command run primarily by CI, I'd agree. Since brew pull --bottle is run interactively primarily, a reasonable default value is particularly helpful. How to name this test-bot user is arbitrary and may as well be consistent across taps. An alternative would be to store this value in the .gitconfig of each tap, or possibly in a dot file that's committed to the tap.

@sjackman

sjackman Oct 8, 2017

Contributor

For a command run primarily by CI, I'd agree. Since brew pull --bottle is run interactively primarily, a reasonable default value is particularly helpful. How to name this test-bot user is arbitrary and may as well be consistent across taps. An alternative would be to store this value in the .gitconfig of each tap, or possibly in a dot file that's committed to the tap.

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Oct 8, 2017

Member

I think that might an argument for accepting environment variables for some of these options instead but I'm fine as-is, too.

@MikeMcQuaid

MikeMcQuaid Oct 8, 2017

Member

I think that might an argument for accepting environment variables for some of these options instead but I'm fine as-is, too.

This comment has been minimized.

@sjackman

sjackman Oct 9, 2017

Contributor

They'd need to set/unset/change this environment variable depending on which tap organization they're currently working on, if they contribute to more than one tap organization. My preference is as-is.

@sjackman

sjackman Oct 9, 2017

Contributor

They'd need to set/unset/change this environment variable depending on which tap organization they're currently working on, if they contribute to more than one tap organization. My preference is as-is.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 9, 2017

Member

@sjackman Still 🔴

Member

MikeMcQuaid commented Oct 9, 2017

@sjackman Still 🔴

@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Oct 10, 2017

Contributor

Ran brew man

Contributor

sjackman commented Oct 10, 2017

Ran brew man

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 10, 2017

Member

Still 🔴 (new Rubocop rules)

Member

MikeMcQuaid commented Oct 10, 2017

Still 🔴 (new Rubocop rules)

@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Oct 10, 2017

Contributor
Library/Homebrew/dev-cmd/pull.rb:61:1: C: Module has too many lines. [364/360]
module Homebrew ...

https://travis-ci.org/Homebrew/brew/jobs/285897358#L843

Contributor

sjackman commented Oct 10, 2017

Library/Homebrew/dev-cmd/pull.rb:61:1: C: Module has too many lines. [364/360]
module Homebrew ...

https://travis-ci.org/Homebrew/brew/jobs/285897358#L843

@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Oct 10, 2017

Contributor

What's the recommended way of dealing with Module has too many lines? I could move the test_bot_user utility function that I created out of the module.

Contributor

sjackman commented Oct 10, 2017

What's the recommended way of dealing with Module has too many lines? I could move the test_bot_user utility function that I created out of the module.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 17, 2017

Member

What's the recommended way of dealing with Module has too many lines? I could move the test_bot_user utility function that I created out of the module.

Yeh, consider splitting some logic into another module in the same file.

Member

MikeMcQuaid commented Oct 17, 2017

What's the recommended way of dealing with Module has too many lines? I could move the test_bot_user utility function that I created out of the module.

Yeh, consider splitting some logic into another module in the same file.

sjackman added some commits Oct 6, 2017

pull: Add --bintray-org
Infer the name of the Bintray organization if it's not provided.
pull: Add --test-bot-user
Infer the name of the test-bot GitHub user if it is not provided.
pull: Move test_bot_user to a new module GitHub
Address the style issue:
C: Module has too many lines. [364/360]
@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Oct 18, 2017

Contributor

Done.

Contributor

sjackman commented Oct 18, 2017

Done.

@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Oct 18, 2017

Contributor

Good to go? Or shall I write a test to address the failed codecov/patch coverage failure?

Contributor

sjackman commented Oct 18, 2017

Good to go? Or shall I write a test to address the failed codecov/patch coverage failure?

@MikeMcQuaid MikeMcQuaid merged commit 15096e7 into Homebrew:master Oct 18, 2017

1 of 3 checks passed

codecov/patch 41.66% of diff hit (target 68.11%)
Details
codecov/project 67.82% (-0.3%) compared to cf34901
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 18, 2017

Member

Thanks again @sjackman!

Member

MikeMcQuaid commented Oct 18, 2017

Thanks again @sjackman!

@sjackman sjackman deleted the sjackman:pull branch Oct 18, 2017

@sjackman sjackman referenced this pull request Oct 19, 2017

Merged

pull: Fix pull --bottle 1234 #3337

4 of 5 tasks complete

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.