-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Rewrite artifactory_sha1 function with puppet v4 api #323
Rewrite artifactory_sha1 function with puppet v4 api #323
Conversation
|
@eputnam puppet-strings doesn't seem very happy with me. |
|
@alexjfisher should the docs be above the function instead of inside it perhaps? Now it looks like it's documenting the dispatch. |
|
having them above the dispatch is correct. i'm going to take a closer look. |
|
I think it's the |
|
looks like this is another bug. if |
| dispatch :artifactory_checksum do | ||
| param 'Stdlib::HTTPUrl', :url | ||
| optional_param "Enum['sha1','sha256','md5']", :checksum_type | ||
| return_type 'String' |
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 I remove this line, the docs generate.
Equally, I can also add a # @return [String] The checksum above.
I don't think this should be required though as it doesn't add much if I'm already doing the return_type validation thing.
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.
Old v3 API function is removed, and new `archive::artifactory_checksum` function added. Puppet 4 API functions should not have issues with environment isolation. This is a breaking change. The function is renamed and has been upgraded. It can now return md5 or sha256 checksums as well as sha1. The function now expects the artifact URL and will convert to the API url internally. (This was previously done in the calling puppet code.)
fc97bf7
to
e872b14
Compare
| end | ||
| # Mock Puppet V4 API ruby function with a puppet language function equivalent | ||
| let(:pre_condition) do | ||
| 'function archive::artifactory_checksum($url,$type) { return \'0d4f4b4b039c10917cfc49f6f6be71e4\' }' |
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.
Many thanks to @TraGicCode on slack for suggesting this method of mocking puppet v4 API ruby functions with puppet language functions.
Old v3 API function is removed, and new
archive::artifactory_checksumfunction added. Puppet 4 API functions should not have issues with
environment isolation.
This is a breaking change. The function is renamed and has been
upgraded. It can now return md5 or sha256 checksums as well as sha1.
The function now expects the artifact URL and will convert to the API
url internally. (This was previously done in the calling puppet code.)