Jira (PUP-10723) Shadow fact / plan variable collisions in PAL catalog compiler

0 views
Skip to first unread message

Tom Beech (Jira)

unread,
Oct 21, 2020, 6:22:03 PM10/21/20
to puppe...@googlegroups.com
Tom Beech created an issue
 
Puppet / Improvement PUP-10723
Shadow fact / plan variable collisions in PAL catalog compiler
Issue Type: Improvement Improvement
Assignee: Tom Beech
Created: 2020/10/21 3:21 PM
Priority: Normal Normal
Reporter: Tom Beech

Current Behavior

**When Bolt runs an apply block in a plan, it uses PAL to compile a catalog. Before calling PAL.with_catalog_compiler, Bolt detects any collisions between facts, target vars, and plan vars, and shadows them as needed (see https://github.com/puppetlabs/bolt/blob/main/lib/bolt/catalog.rb#L71-L88) . However, this can cause a potential problem when plan variables are using local references. If plan variable $bar has a reference to plan variable $foo, and the target has a fact foo, Bolt will shadow the plan variable $foo. When the variables are passed on to the catalog compiler, PAL will be unable to deserialize the plan variables as the local reference for $bar is no longer valid (see https://github.com/puppetlabs/bolt/issues/2111). 

 

Desired Behavior

Shadowing variables that collide with facts of the same name should not result in PAL being unable to deserialize plan variables due to a missing local reference. Because FromDataConverter assumes that the data it receives comes directly from ToDataConverter, the serialized plan variables should be passed as-is to the catalog compiler where they can be deserialized. After the plan variables are deserialized, PAL should then shadow any variables that collide with facts of the same name (and warn when this happens).

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Jan 13, 2021, 9:09:04 AM1/13/21
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Jan 13, 2021, 9:18:03 AM1/13/21
to puppe...@googlegroups.com
Gheorghe Popescu commented on Improvement PUP-10723
 
Re: Shadow fact / plan variable collisions in PAL catalog compiler

Tom Beech is the work here done? Can you please add release notes and close the ticket if so?

Josh Cooper (Jira)

unread,
Jan 13, 2021, 12:21:03 PM1/13/21
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10723

Looks like was merged to master in https://github.com/puppetlabs/puppet/commit/faed64577d7c39b384cb8330f117d30e988af4c7 and was first released in 7.0, and is now being released in 6.20.

Josh Cooper (Jira)

unread,
Jan 13, 2021, 12:21:03 PM1/13/21
to puppe...@googlegroups.com

Tom Beech (Jira)

unread,
Jan 15, 2021, 6:14:04 PM1/15/21
to puppe...@googlegroups.com
Tom Beech updated an issue

Shadow fact/variable collisions in PAL catalog compiler.

Change By: Tom Beech
Release Notes: Bug Fix
Release Notes Summary: Shadow fact/variable collisions in PAL catalog compiler.
Reply all
Reply to author
Forward
0 new messages