[PUP-9509] Puppet 3 API functions should be loaded from the pluginsync location as part of the cache system loader Created: 2019/02/22  Updated: 2019/11/18  Resolved: 2019/10/29

Status: Resolved
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 6.11.0

Type: Bug Priority: Normal
Reporter: Glenn Sarti Assignee: Glenn Sarti
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Windows 10 - 1803
Ruby 2.5.1
Puppet from github at 293b87447ff955bb4c866b5b0eda3a23e5901ff2

Issue Links:
relates to PUP-6964 Puppet 4.x functions should be availa... Closed
relates to PUP-9035 Puppet should load files from plugins... Closed
Template: PUP Bug Template
Acceptance Criteria:
  • Puppet 3 API functions should be loaded from the pluginsync location
Sub-team: Language
Team: Coremunity
Sprint: Platform Core KANBAN
Method Found: Needs Assessment
Release Notes: Bug Fix
Release Notes Summary: Legacy Ruby Functions, also known as Version 3 Functions, will now be available from the cached lib directory. Previously only Version functions were available. Note that functions that exist in both Version 3 and Version 4, will still use the Version 4 implementation.
QA Risk Assessment: Needs Assessment


Puppet Version: 6.3.0
Puppet Server Version: N/A
OS Name/Version: Windows 10 - 1803 Ruby 2.5

Describe your issue in as much detail as possible...
Describe steps to reproduce...

Desired Behavior:
Puppet 3 API functions that are plugin sync'd should be loaded from the cache libdir

Actual Behavior:
Puppet 3 API functions are missing

Previously in PUP-6964 (https://github.com/puppetlabs/puppet/pull/7019) the system loader was modified to to be able to load Puppet 3 API functions;

of note - https://github.com/puppetlabs/puppet/pull/7019/files#diff-83a8daf215ff39828e0e3758c2e5a866R34

See how the system loader has loadables of [:func_4x, :func_3x, :datatype]

However when the system cache loader was introduced in PUP-9035 (https://github.com/puppetlabs/puppet/commit/7404ee14745c78bd4a3173c79cac198809faea74 ) the loadables specified did not include the Puppet 3 API functions.

of note - https://github.com/puppetlabs/puppet/pull/6963/files#diff-83a8daf215ff39828e0e3758c2e5a866R30

See how the cache loader has loadables of [:func_4x, :datatype]

The comment at https://github.com/puppetlabs/puppet/pull/6963/files#diff-83a8daf215ff39828e0e3758c2e5a866R22 says they should be the same but is clear they are not.

Also note that the acceptance tests do not test for this;

That is just a Puppet 4 API location

Comment by Henrik Lindberg [ 2019/05/09 ]

Earlier it was questionable if 3.x functions should be loaded at all as there are many 3.x functions that has unsafe implementations (adding methods to Scope, or every Object). As we now have safety checks when loading 3.x functions this is less of a concern.

Adding 3.x loading as Glenn Sarti shows should be easy and then "just work".

Comment by Josh Cooper [ 2019/10/29 ]

Merged to master in 49926022c9 and 8dd3bbe88e.

Passed CI in a0e7c84236

Comment by Josh Cooper [ 2019/10/29 ]

Glenn Sarti Can you add release notes?

Comment by Glenn Sarti [ 2019/10/29 ]

Josh Cooper Added.

Generated at Tue Aug 11 00:32:23 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.