Skip to content

Add a function to update / regenerate deprecated shims #1349

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

Merged
merged 1 commit into from
May 30, 2023

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented May 4, 2023

In order to move existing unamespaced functions to the stdlib namespace
(#1346) without breaking backwards compatibility, we need some
compatibility shims. They will all look-like the same, so add a rake
task to regenerate them if we need to update them.

This will help with #1346.

@smortex smortex requested review from a team, alexjfisher, b4ldr, bastelfreak and ekohl as code owners May 4, 2023 18:49
@puppet-community-rangefinder
Copy link

has_interface_with is a function

Breaking changes to this file MAY impact these 8 modules (near match):

This module is declared in 318 of 580 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@smortex smortex force-pushed the manage-unnamespaced-shims branch 2 times, most recently from 2f4fd92 to c1089c1 Compare May 4, 2023 18:57
@smortex smortex force-pushed the manage-unnamespaced-shims branch from c1089c1 to d4048fb Compare May 16, 2023 19:14
Rakefile Outdated
repeated_param 'Any', :args
end
def deprecation_gen(*args)
call_function('deprecation', '#{function_name}', 'This method is deprecated, please use stdlib::#{function_name} instead.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Entirely my bad as I tend to use method and function interchangeably. In puppet land though, functions are only ever really referred to as functions.

Suggested change
call_function('deprecation', '#{function_name}', 'This method is deprecated, please use stdlib::#{function_name} instead.')
call_function('deprecation', '#{function_name}', 'This function is deprecated, please use stdlib::#{function_name} instead.')

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Fixed!

@smortex smortex force-pushed the manage-unnamespaced-shims branch from d4048fb to 7c1dbc0 Compare May 24, 2023 18:09
In order to move existing unamespaced functions to the stdlib namespace
(puppetlabs#1346) without breaking backwards compatibility, we need some
compatibility shims.  They will all look-like the same, so add a rake
task to regenerate them if we need to update them.
@smortex smortex force-pushed the manage-unnamespaced-shims branch from 7c1dbc0 to 14b4150 Compare May 24, 2023 18:57
@LukasAud
Copy link
Contributor

Looks like this PR has been implemented into #1356. Can you close this one, @smortex?

@smortex
Copy link
Collaborator Author

smortex commented May 29, 2023

Looks like this PR has been implemented into #1356. Can you close this one, @smortex?

It's the same commit: GitHub will automatically mark this PR as merged when the other one is merged.

@LukasAud LukasAud merged commit 14b4150 into puppetlabs:main May 30, 2023
@smortex smortex deleted the manage-unnamespaced-shims branch May 30, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants