Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support PostgreSQL #8
2 times, most recently
Oct 10, 2015
The current state is that it all works (yay integration tests), but it could use a good review. In particular the dependencies need attention. I'm also considering changing the mysql config to something nested, but currently I'm staying compatible with the released version.
@domcleal mind reviewing?
I wouldn't pin pg, because on systems (e.g. FreeBSD or the upcoming Ubuntu LTS) that bring a newer pg packaged, it won't work because of this, despite 0.18.3 would be perfectly compatible.
Rather I'd use
I would suggest moving out validation of parameters out of constructors so it could be executed during plugin initialization: smart proxy will have a chance to disable the provider and dns plugin and log the issues in this case. For an example see puppet_proxy (https://github.com/theforeman/smart-proxy/blob/develop/modules/puppet_proxy/puppet_plugin.rb#L18 and https://github.com/theforeman/smart-proxy/blob/develop/modules/puppet_proxy/ssl_configuration_validator.rb).
Now that support for dependency injection is in smart-proxy, this provider can benefit from it. puppet_proxy is using dependency injection to "wire" itself during initialization to support puppet setup it interfaces with. Some of the points of interest there:
I'm using the same approach for configuring of providers in DHCP module (although it's a PR atm).
I'd need to introduce a few changes to the DNS module for it to be able to rely on dependency injection for provider resolution, but they wiould be quite minor and could be done quickly. Let me know if you you have questions or would like a walk through dependency injection usage in puppet and dhcp modules.
@ekohl: Failure at https://github.com/ekohl/smart_proxy_dns_powerdns/blob/b4e1f577272f6c5601db1ade4f212a21620a20e9/test/unit/dns_powerdns_configuration_validator_test.rb#L26 could be due to setting
referenced this pull request
Oct 27, 2015
I finally made time to rewrite the PR to dependency injection.
Will need to look at unit test failures on 1.9.3. If a more experienced ruby developer can help me, I'd greatly appreciate it.
I'm also wondering why I needed to modify the integration tests. This could be a regression in the API or just some error on my side.
Not sure I understand what you mean by this.
Cool. There are integration tests (which I only manually ran, still have to fix a travis build for it) which I used to verify functionality. Once the tests pass, I'll merge this and work to a 0.2.0 release in time for my talk at cfgmgmtcamp.
Apologies for not being clear - plugin settings class is derived from ruby's Openstruct. In earlier versions of ruby, '' method isn't defined for Openstruct, to access individual keys one has to use key name as the method name to access it's value:
As you are not relying on plugin initializer to load provider's dependencies, you could put pg and mysql gems into separate groups and then use