-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
make our type camptocamp/archive compatible #176
Conversation
(this parameter is for camptocamp/archive compatibility).' | ||
newvalues(/\b[0-9a-f]{5,128}\b/) | ||
munge do |val| | ||
resource[:checksum] = val |
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 munge needs to be handled differently
So what's the purpose of achieving compatibility? I thought the idea was to merge the modules? |
currently, it's impossible to drop-in-replace either of the modules with the other |
i've now spec tested the first module against my branch… diff --git a/.fixtures.yml b/.fixtures.yml
index ad31c79..b32fd48 100644
--- a/.fixtures.yml
+++ b/.fixtures.yml
@@ -1,7 +1,9 @@
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
- archive: "https://github.com/camptocamp/puppet-archive.git"
+ archive:
+ repo: "https://github.com/igalic/puppet-archive-1.git"
+ branch: "camptocamp-compat"
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
symlinks:
'kibana4': "#{source_dir}" works out perfectly fine… because it has no tests for archive |
I've recently deprecated installing kibana4 from the tar.gz archive, since elastic.co is now maintaining packages. |
well that's one problem solved… 1209012390439034 others to go ;) |
this commit now adds n.b.: i didn't copy camptocamp's |
I've been wondering whether we really want to clutter this module with compatibility types and parameters. If we get the missing features implemented, might it be better to then start creating PRs against popular modules that use camptocamp/archive? It's even possible to make a module work with both camptocamp/archive and puppet/archive by using stdlib's |
from Joe Duffy's blog about Midori (a research operating system)
@alexjfisher what you're suggesting is "worse is better". i disagree. |
I agree with @igalic. We want to fix the module, not the things that use it. Take the Linux stance: 'userspace is never the problem.' I'm for adding compatibility types. We can remove them in a major release later. |
Fair enough. Thought it was worth asking anyway. It might still be interesting to know how many modules are using camptocamp/archive. I wonder if I can use the forge API to tell me... |
... turns out, I can ;)
|
nice! thank you for the stats! |
okay, so, in my i'm also contemplating to copy camptocamp's spec tests to see how compatible we are — but not sure how that'll actually work, since they are written for a defined type, and ours is a type/provider |
our type now accepts the same parameters as camptocamp/archive and processes them correctly.
since camptocamp/archive is apache-2.0 licensed, we can simply copy it! the body is filled with a call archive.
someone tried using this patchset as replacement for camptocamp/archive and reported the following error:
|
tests green except for that blacksmith/rest-client issue, for which we have a pr lined up here voxpupuli/puppet-blacksmith#35 |
that default should be false — for maximum compatibility with both modules
newparam(:cookie) do | ||
desc 'archive file download cookie.' | ||
end | ||
|
||
newparam(:checksum) do | ||
desc 'archive file checksum (match checksum_type).' | ||
newvalues(%r{\b[0-9a-f]{5,128}\b}, :true, :false, :undef, nil, '') |
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 is awful
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.
but it works with the latest _release_ or rtyler/jenkins
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.
(a.k.a.: we're running it in prod now ;)
@@ -0,0 +1,64 @@ | |||
# == Definition: archive::download |
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.
@igalic Maybe document this type as for compatibility with camptocamp? You would otherwise always use the native archive
type directly?
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.
it wasn't documented in camptocamp/archive either _
i don't want to document it, because it's just a shim. private api that moves as camptocamp/archive moves.
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.
sorry, I wasn't clear (story of my life!) I don't mean document all the parameters etc. I mean just add a line to say that it is a shim/private etc. Something to discourage new users from thinking this is the way they should be using the module.
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.
similar to how the new parameters in the type are marked (this parameter is for camptocamp/archive compatibility)
Other than a updating the README and comments in archive::download LGTM. 👍 |
make our type camptocamp/archive compatible
our type now accepts the same parameters as camptocamp/archive and processes them correctly.