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

Use puppet4 functions-api #1044

Merged
merged 3 commits into from
May 24, 2018
Merged

Conversation

juliantodt
Copy link

The legacy puppet3 functions-api should be avoided.
This migrates the existing functions to the new api and uses it in the module. It also adds the tests for the new functions based on those for the olds when they existed.
We should keep the legacy functions for now to allow compatibility for those using the functions outside out this module.

@juliantodt
Copy link
Author

Fixed the rubocop issues that occurred, but didn't know how to replace the subject.execute calls in the tests with them still working. Please let me know if you have a solution for this.

@david22swan
Copy link
Member

david22swan commented Mar 7, 2018

@juliantodt Are you still active on this pr?
In regards to the rubocop issue at this point I feel that you should disable the rule for now, an example on how to do so is shown below:

Disable Commands:
Disable rubocop over a block off code
# rubocop:disable Lint/UselessAssignment
{Code Block}
# rubocop:enable Lint/UselessAssignment

Disable rubocop for a single line:
{Code Line} # rubocop:disable RSpec/InstanceVariable

@juliantodt
Copy link
Author

Fixed the rubocop issues like @david22swan suggested and rebased the pr.

@hunner
Copy link
Contributor

hunner commented Mar 29, 2018

@juliantodt Thanks! Should we also print deprecation warnings in the puppet3 functions so we can remove them at the next major bump?

@juliantodt
Copy link
Author

@hunner Added the deprecation warnings. Couldn't use stdlib's deprecation function because we allow old enough versions of it together with the mysql-module though.

@eputnam
Copy link
Contributor

eputnam commented May 24, 2018

@juliantodt went ahead and added strings docs to have them in there. It's a new pseudo-requirement so I didn't think you needed to be responsible for it.

@eputnam eputnam merged commit b8e3772 into puppetlabs:master May 24, 2018
tobias-urdin added a commit to tobias-urdin/puppet-mariadb that referenced this pull request Oct 30, 2018
In minor release Puppet 5.5.7 they introduced a
change [1] that caused all Puppet 3 function to
pretty much stop working properly.

This causes issues like [2] for Puppet >= 5.5.7

The puppetlabs-mysql module has support for the
puppet 4+ compatible functions since it's 6.0.0
release, bug was tracked in [3].

The fix in the module is here [4].

[1] https://tickets.puppetlabs.com/browse/PUP-9137
[2] https://gist.github.com/tobias-urdin/491e97da6585def720fc4f830e212f30
[3] https://tickets.puppetlabs.com/browse/PUP-9270
[4] puppetlabs/puppetlabs-mysql#1044
openstack-gerrit pushed a commit to openstack/puppet-openstack-integration that referenced this pull request Oct 30, 2018
The fix that fixes the functions api to the
puppet 4 syntax is released in 6.0.0 which
causes the undefined issue [1] [2].

On this line [3] in the latest 5.x release
it should be for example mysql::deepmerge.

The Puppet change that caused this [3] and
the puppetlabs-mysql that fixes it [4]

[1] http://logs.openstack.org/46/613446/2/check/puppet-openstack-unit-5.5-centos-7/f7f3999/job-output.txt.gz#_2018-10-30_00_19_35_920695
[2] https://tickets.puppetlabs.com/browse/PUP-9270
[3] https://tickets.puppetlabs.com/browse/PUP-9137
[4] puppetlabs/puppetlabs-mysql#1044

Change-Id: Ib5ff4bd7119b8dfee91c884007c617dfaa591840
alexjfisher added a commit to alexjfisher/puppetlabs-mysql that referenced this pull request Apr 28, 2020
There's been a properly namespaced modern `mysql::password` function for
some time.  See puppetlabs#1044

When the modern API non-namespaced shim was removed in a68004c
the `puppet/parser/functions` version still existed so users who hadn't
migrated to `mysql::password` would have reverted to this legacy API version.

This commit finally removes the legacy version, but puts back the shim
for now (to not create a breaking change just yet).

Both namespaced and non-namespaced shim are tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants