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

Disable default source when using user-supplied gem source #265

Merged
merged 2 commits into from Aug 8, 2017

Conversation

Projects
None yet
4 participants
@adamleff
Collaborator

adamleff commented Aug 8, 2017

The clear_sources property does not remove the default gem source when the RubyGems package provider does its work. We need to also set the include_default_source property to false to ensure users' requesting gem source is the only gem source used (instead of rubygems.org, for example).

Disable default source when using user-supplied gem source
The `clear_sources` property does not remove the default gem source when the
RubyGems package provider does its work. We need to also set the
`include_default_source` property to false to ensure users' requesting gem
source is the only gem source used (instead of rubygems.org, for example).

Signed-off-by: Adam Leff <adam@leff.co>

@adamleff adamleff added the in progress label Aug 8, 2017

@alexpop

alexpop approved these changes Aug 8, 2017

👍

@jeremymv2

This comment has been minimized.

Contributor

jeremymv2 commented Aug 8, 2017

🤔 the include_default_source is only a recent addition to chef-client:
chef/chef@28be4df

Likely would have to be handled differently to continue backwards client compatibility.

@adamleff

This comment has been minimized.

Collaborator

adamleff commented Aug 8, 2017

@jeremymv2 true, so this would be a question for @chris-rock how far back our backward-compat policy is for the audit cookbook and Chef version.

I'll add some guards around it in the meantime.

@adamleff

This comment has been minimized.

Collaborator

adamleff commented Aug 8, 2017

For posterity, this property has been in Chef stable since 13.0

@jeremymv2

This comment has been minimized.

Contributor

jeremymv2 commented Aug 8, 2017

In the past we've decided on minimum version 12.5.1

https://github.com/chef-cookbooks/audit/blob/master/metadata.rb#L13

I think the guards are the way to go.

Only call `include_default_source` if it's a supported property
This will protect against backward compat issues, allowing the old
`clear_sources` behavior dating back to Chef 12.x to continue to work.

Signed-off-by: Adam Leff <adam@leff.co>
@adamleff

This comment has been minimized.

Collaborator

adamleff commented Aug 8, 2017

And it is now appropriate guarded, @jeremymv2 :)

@arlimus

arlimus approved these changes Aug 8, 2017

Looks great thank you Adam!

@adamleff

This comment has been minimized.

Collaborator

adamleff commented Aug 8, 2017

The Travis tests are due to a breakage between berkshelf/solve and molinillo which cases cookbooks in the dependency chain to go missing. I've tested everything locally using an older ChefDK and it tests well, so I'm going to merge this.

@adamleff adamleff merged commit 3b2c340 into master Aug 8, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
DCO This commit has a DCO Signed-off-by
Details

@adamleff adamleff deleted the adamleff/gem-source-fix branch Aug 8, 2017

@adamleff adamleff removed the in progress label Aug 8, 2017

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