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

Add proxy settings for r10k #473

Closed
wants to merge 6 commits into from

Conversation

Rudikza
Copy link
Contributor

@Rudikza Rudikza commented Dec 5, 2018

Pull Request (PR) description

This PR adds in the needed code to be able to manage the proxy setting in the r10k.yaml file.

This Pull Request (PR) fixes the following issues

Fixes #468

@@ -9,6 +9,7 @@
$install_options = []
$sources = undef
$puppet_master = true
$proxy = ''

Choose a reason for hiding this comment

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

I think undef would be a better default.

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 see that both undef and an empty param e.g [] or '' are used throughout the code base, I like setting an empty string because it indicates what type of value is expected and when writing tests we can specifically check for an empty string instead of an undef value. I'm easy either way though. . .. .

Choose a reason for hiding this comment

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

Empty hashes and arrays make more sense but I'd say not for strings.

Copy link
Member

Choose a reason for hiding this comment

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

to quote our review docs:

Are there new params with datatype Hash or Array? If possible, they should default to empty Hash/Array instead of undef. You can also enforce the datastructure like Array[String]

For simple datatypes like String, please default to undef.

@@ -22,6 +22,7 @@
Hash $deploy_settings = $r10k::params::deploy_settings,
$root_user = $r10k::params::root_user,
$root_group = $r10k::params::root_group,
$proxy = $r10k::params::proxy,

Choose a reason for hiding this comment

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

New parameters should have data types.

@@ -62,6 +65,7 @@
$root_user = $r10k::params::root_user,
$root_group = $r10k::params::root_group,
Stdlib::Absolutepath $puppetconf_path = $r10k::params::puppetconf_path,
String $proxy = $r10k::params::proxy,
Copy link
Member

@bastelfreak bastelfreak Dec 25, 2018

Choose a reason for hiding this comment

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

Please also enforce the minimal length:

Suggested change
String $proxy = $r10k::params::proxy,
Optional[String[1]] $proxy = $r10k::params::proxy,

@@ -33,3 +33,6 @@
<% if !@forge_settings.empty? -%>
<%= settings_to_yaml('forge', @forge_settings) %>
<% end -%>
<% if @proxy and @proxy != '' -%>
Copy link
Member

@bastelfreak bastelfreak Dec 25, 2018

Choose a reason for hiding this comment

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

this can now be simplyfied:

Suggested change
<% if @proxy and @proxy != '' -%>
<% if @proxy -%>

@bastelfreak
Copy link
Member

Hey @Rudikza, thanks for the PR. Can you please take a look at the used email address in the commit? It isn't associated with your github account.

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.

support the "proxy" general setting
3 participants