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

correct filters for MacPorts package provider #2721

Merged
merged 3 commits into from Jan 10, 2015
Merged

Conversation

patcox
Copy link
Contributor

@patcox patcox commented Jan 7, 2015

macports needs to provide macports_package to darwin, not mac_os_x. mac_os_x is the platform, darwin is the OS.
This resolves #2691.
@jaymzh will do the merge so it's under his CCLA.

macports needs to provide macports_package to `darwin`, not `mac_os_x`.
`mac_os_x` is the platform, `darwin` is the OS.
@jaymzh
Copy link
Collaborator

jaymzh commented Jan 7, 2015

@patcox you need to sort out your failed tests.
@opscode/client-core as Pat said, I'll do the merge since I'm the FB person with CCLA, but I want someone with OSX specific knowledge to look at this, #2722, #2723, and #2724 - probably @jtimberman ?

@@ -3,7 +3,7 @@ class Provider
class Package
class Macports < Chef::Provider::Package

provides :macports_package, os: "mac_os_x"
provides :macports_package, os: "darwin"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should probably have no filters... if someone actually specified macports_package, then they are overriding the normal logic. That seems to be how the other OS-specific providers with their own resource work... (like homebrew_package)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but does it make any sense on linux/solaris/freebsd/etc? Ultimately, it'd be nice to unload these classes that didn't apply to the o/s to reduce memory pressure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could see arguments either way.
For consistency's sake maybe it would be best to remove the filters. (see homebrew @ https://github.com/opscode/chef/blob/master/lib/chef/provider/package/homebrew.rb#L29)
And then if we want to unload the classes later we could do that in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I sort of feel like we should be more narrow and then expand later if there's a reason, rather than try to do it the other direction since its avoids a possible major revision blocker to the later change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My thought is more like this... I can make apt work on Redhat, and I can make yum work on Debian, etc. if someone goes out of their way to specifically say "I want to use macports_package", we shouldn't stand in their way. We should just never use macports for standard package resource on a host we don't expect it to work on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmmm.... okay, I seem to have not restricted yum_package, apt_package, etc, so I guess I agreed with you back when I merged in the provider resolver stuff (although I coulda sworn I decided to do the other thing).

@patcox
Copy link
Contributor Author

patcox commented Jan 7, 2015

Added a new commit removing the filter altogether, as discussed in code review.
I'm not sure why those tests were failing...if they fail again, I could use some help figuring out how to fix them.

@jaymzh
Copy link
Collaborator

jaymzh commented Jan 8, 2015

Well, the test that's failing is "1) Chef::ProviderResolver resolving static providers on Ubuntu 14.04 when the resource is a macports_package should fall back into the old provider mapper code and hooks", except that test is now invalid... it's unclear what @lamont-granquist would like ot happen to this test.

@lamont-granquist
Copy link
Contributor

It should get removed from that one because it not longer falls through to the old provider mapper code, and now it uses the provider resolver correctly, so i think there's another list it gets added to.

:execute, :file, :gem_package, :git, :homebrew_package, :http_request, :link,
:log, :macports_package, :pacman_package, :paludis_package, :perl, :python,
:remote_directory, :route, :rpm_package, :ruby, :ruby_block, :script, :subversion,
:template, :timestamped_deploy, :whyrun_safe_ruby_block, :yum_package,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved :homebrew_package and :macports_package to their correct alphabetical order and made the lines roughly the same length.

@patcox
Copy link
Contributor Author

patcox commented Jan 8, 2015

Tests are green now. :)
lmk if there's anything else to fix.

@lamont-granquist
Copy link
Contributor

👍

@jaymzh
Copy link
Collaborator

jaymzh commented Jan 8, 2015

👍

Sweet. Lets get a 3rd +1 and I'll merge.

@lamont-granquist
Copy link
Contributor

@opscode/client-core @opscode/client-engineers paging code review

@jaymzh jaymzh added this to the 12.0.4 milestone Jan 8, 2015
@jtimberman
Copy link
Contributor

👍 🍰

@jaymzh
Copy link
Collaborator

jaymzh commented Jan 10, 2015

WFM.

jaymzh added a commit that referenced this pull request Jan 10, 2015
correct filters for MacPorts package provider
@jaymzh jaymzh merged commit 9b2ba0d into chef:master Jan 10, 2015
@lamont-granquist lamont-granquist modified the milestones: 12.1.0, 12.0.4 Jan 23, 2015
@chef-supermarket
Copy link

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.

GitHub Users Who Are Not Authorized To Contribute

The following GitHub users do not appear to have signed a CLA:

Please sign the CLA here.

@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

macports provider has incorrect filters
5 participants