-
Notifications
You must be signed in to change notification settings - Fork 794
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
(MODULES-6923) remove staging module #1115
Conversation
b29bad9
to
dac8e2d
Compare
manifests/server/mysqltuner.pp
Outdated
@@ -17,6 +17,7 @@ | |||
$environment = undef, # environment for staging::file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter is now unused
@@ -1,17 +1,12 @@ | |||
require 'spec_helper' | |||
|
|||
describe 'mysql::server::mysqltuner' do | |||
on_supported_os.each do |os, facts| | |||
on_supported_os.each do |os, _facts| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no fact are set, does it actually matter to test it on every OS? You're effectively testing the same thing multiple times.
dac8e2d
to
28c6e39
Compare
Many thanks @ekohl , changes incoming |
manifests/server/mysqltuner.pp
Outdated
) { | ||
|
||
$tuner_location = '/usr/local/bin/mysqltuner' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to prefer something like this as a class parameter. This gives some more flexibility to users
manifests/server/mysqltuner.pp
Outdated
) { | ||
|
||
$tuner_location = '/usr/local/bin/mysqltuner' | ||
if $source { | ||
$_version = $source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable appears to be unused now and can be removed.
) { | ||
|
||
$tuner_location = '/usr/local/bin/mysqltuner' | ||
if $source { | ||
$_version = $source | ||
$_source = $source | ||
} else { | ||
$_version = $version | ||
$_source = "https://github.com/major/MySQLTuner-perl/raw/${version}/mysqltuner.pl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but GH also has a raw.github.com that's more efficient for them. Might be worth looking into but doesn't have to be part of this PR.
manifests/server/mysqltuner.pp
Outdated
if $source { | ||
$_version = $source | ||
$_source = $source | ||
} else { | ||
$_version = $version | ||
$_source = "https://github.com/major/MySQLTuner-perl/raw/${version}/mysqltuner.pl" | ||
} | ||
|
||
if $ensure == 'present' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the archive now also has an ensure
, does it make sense to drop the if and simply have 2 resources which accept $ensure
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An even crazier idea: puppet itself can also download HTTP files so wouldn't this work as well?
file { $tuner_location:
ensure => $ensure,
mode => '0550',
source => $_source,
}
@ekohl lovely idea, testing it now. |
28c6e39
to
899d1e5
Compare
manifests/server/mysqltuner.pp
Outdated
) { | ||
|
||
if $source { | ||
$_version = $source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$_version
is still unused.
899d1e5
to
1e03238
Compare
@ekohl hopefully closer ? |
Looks good! Bonus points for data types on parameters but yay for the big simplification already :) |
{ | ||
"name": "puppetlabs/stdlib", | ||
"version_requirement": ">= 3.2.0 < 5.0.0" | ||
}, | ||
{ | ||
"name": "puppet/staging", | ||
"version_requirement": ">= 1.0.1 < 4.0.0" | ||
"name": "puppetlabs/translate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the diff would be a tiny bit cleaner if this would still be on top of stdlib, but it doesn't really matter.
file { $tuner_location: | ||
ensure => $ensure, | ||
mode => '0550', | ||
source => $_source, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I expected a really complicated rewrite by replacing staging with archive, but I also forgot that the file resource can now take https links <3. Since which puppet version is this supported? Does the support puppet version range within this module needs to be adjusted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked this before merging, but http support for file source was in 4.7 which is the lower boundary of the module: https://puppet.com/docs/puppet/4.7/type.html#file-attribute-source , so we should be good without bumping the puppet version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit/PR title needs updating since 'archive' isn't actually used in the end.
It'd be nice if this could get merged. |
1e03238
to
c9ed370
Compare
Hi @ekohl and @alexjfisher i changed the commit and pr message. This will get merged once we have got the puppet 6 release for this module done. It will be a major version bump ie X.y.z because of it being backwards incompatible. |
No description provided.