Jira (PUP-11751) Unexpected behavior after setting strict to :error

29 views
Skip to first unread message

Aria Li (Jira)

unread,
Feb 2, 2023, 8:18:01 PM2/2/23
to puppe...@googlegroups.com
Aria Li updated an issue
 
Puppet / Task PUP-11751
Unexpected behavior after setting strict to :error
Change By: Aria Li
Summary: Unable Unexpected behavior after setting strict to apply catalog from environment with pcore object types :error
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Aria Li (Jira)

unread,
Feb 2, 2023, 8:27:02 PM2/2/23
to puppe...@googlegroups.com
Aria Li updated an issue
This ticket is a placeholder for all the unexpected behavior I found while working on PUP-11725 after setting strict to default to {{:error}} instead of {{:warning}}
#
When rich_data is enabled, users should be able to create and use their own rich data type derived from `Object`.


However, [this test|https://github.com/puppetlabs/puppet/blob/f4fbaaac5b21731929e76a7218b3f735ef41cd15/spec/integration/application/apply_spec.rb#L205] that checks Puppet can apply a catalog from an environment with Pcore object types began failing after enabling strict mode. It seems like there was a warning (when strict was set to warning) before that got swallowed and was never noticed. 

I'll mark the test as pending for now. I also wrote another test that checks that a catalog can be applied without warnings/errors.


2. The [lookup function|https://www.puppet.com/docs/puppet/6/function.html#lookup] can take in a {{default_values_hash}} as a parameter and should use that hash to check for the requested key. However, in this [lookup test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2414], it fails and does not use the passed in {{default_values_hash }}unless another {{lookup}} is used like [this test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2410] does.

Aria Li (Jira)

unread,
Feb 2, 2023, 8:27:03 PM2/2/23
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Feb 7, 2023, 2:23:02 PM2/7/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Epic Link: PA-4664

Aria Li (Jira)

unread,
Feb 7, 2023, 2:59:04 PM2/7/23
to puppe...@googlegroups.com
Aria Li updated an issue
This ticket is a placeholder for all the unexpected behavior I found while working on PUP-11725 after setting strict to default to {{:error}} instead of {{:warning}}
# When rich_data is enabled, users should be able to create and use their own rich data type derived from `Object`.

However, [this test|https://github.com/puppetlabs/puppet/blob/f4fbaaac5b21731929e76a7218b3f735ef41cd15/spec/integration/application/apply_spec.rb#L205] that checks Puppet can apply a catalog from an environment with Pcore object types began failing after enabling strict mode. It seems like there was a warning (when strict was set to warning) before that got swallowed and was never noticed. 

I'll mark the test as pending for now. I also wrote another test that checks that a catalog can be applied without warnings/errors.

2. The [lookup function|https://www.puppet.com/docs/puppet/6/function.html#lookup] can take in a {{default_values_hash}} as a parameter and should use that hash to check for the requested key. However, in this [lookup test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2414], it fails and does not use the passed in {{default_values_hash}} unless another {{lookup}} is used like [this test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2410] does.


3. Dig more into this loaders_spec.rb [test|https://github.com/puppetlabs/puppet/blob/fa0250e7338fe156831599d2280339003b46ccc8/spec/unit/pops/loaders/loaders_spec.rb#L248-L251] that checks that a loader can load a function twice when loading from module.

Aria Li (Jira)

unread,
Feb 7, 2023, 2:59:04 PM2/7/23
to puppe...@googlegroups.com
3. Dig more into this loaders_spec.rb [test|https://github.com/puppetlabs/puppet/blob/fa0250e7338fe156831599d2280339003b46ccc8/spec/unit/pops/loaders/loaders_spec.rb#L248-L251] that checks that a loader can load a function twice when loading from module. For now, I'll mark that test as pending.

Aria Li (Jira)

unread,
Feb 8, 2023, 2:08:01 PM2/8/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes Summary: Previously, the strict_variables setting defaulted to false. For Puppet 8, strict mode will be on by default which means strict_variables will be on & default to true and strict will default to error. With strict_variables on, an evaluation error will be raised when referencing unknown variables but not when referencing variables that are explicitly set to undef. This change could potentially be a breaking change.

Josh Cooper (Jira)

unread,
Feb 9, 2023, 1:47:01 PM2/9/23
to puppe...@googlegroups.com

Tony Vu (Jira)

unread,
Feb 14, 2023, 3:24:03 PM2/14/23
to puppe...@googlegroups.com
Tony Vu updated an issue
Change By: Tony Vu
This ticket is a placeholder for all the unexpected behavior I found while working on PUP-11725 after setting strict to default to {{:error}} instead of {{:warning}}
# When rich_data is enabled, users should be able to create and use their own rich data type derived from `Object`.

However, [this test|https://github.com/puppetlabs/puppet/blob/f4fbaaac5b21731929e76a7218b3f735ef41cd15/spec/integration/application/apply_spec.rb#L205] that checks Puppet can apply a catalog from an environment with Pcore object types began failing after enabling strict mode. It seems like there was a warning (when strict was set to warning) before that got swallowed and was never noticed. 

I'll mark the test as pending for now. I also wrote another test that checks that a catalog can be applied without warnings/errors.

2. The [lookup function|https://www.puppet.com/docs/puppet/6/function.html#lookup] can take in a {{default_values_hash}} as a parameter and should use that hash to check for the requested key. However, in this [lookup test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2414], it fails and does not use the passed in {{default_values_hash}} unless another {{lookup}} is used like [this test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2410] does.

3. Dig more into this loaders_spec.rb [test|https://github.com/puppetlabs/puppet/blob/fa0250e7338fe156831599d2280339003b46ccc8/spec/unit/pops/loaders/loaders_spec.rb#L248-L251] that checks that a loader can load a function twice when loading from module. For now, I'll mark that test as pending.


4. This [acceptance test|https://github.com/puppetlabs/puppet/blob/25a86b1/acceptance/tests/lookup/config5_interpolation.rb] was also failing in a strange way; `strict` errors caused the test to error out, but without it, the test completes correctly, indicating that `::roles` ends up not actually being undefined. 

Josh Cooper (Jira)

unread,
Feb 15, 2023, 12:09:01 PM2/15/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2023-03-01

Tony Vu (Jira)

unread,
Feb 15, 2023, 7:16:03 PM2/15/23
to puppe...@googlegroups.com
Tony Vu assigned an issue to Tony Vu
Change By: Tony Vu
Assignee: Tony Vu

Michael Hashizume (Jira)

unread,
Mar 1, 2023, 1:10:03 PM3/1/23
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Sprint: Phoenix 2023-03-01 , Language Triage 2

Aria Li (Jira)

unread,
Mar 8, 2023, 4:54:04 PM3/8/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
This ticket is a placeholder for all the unexpected behavior I found while working on PUP-11725 after setting strict to default to {{:error}} instead of {{:warning}}
# When rich_data is enabled, users should be able to create and use their own rich data type derived from `Object`.

However, [this test|https://github.com/puppetlabs/puppet/blob/f4fbaaac5b21731929e76a7218b3f735ef41cd15/spec/integration/application/apply_spec.rb#L205] that checks Puppet can apply a catalog from an environment with Pcore object types began failing after enabling strict mode. It seems like there was a warning (when strict was set to warning) before that got swallowed and was never noticed. 

I'll mark the test as pending for now. I also wrote another test that checks that a catalog can be applied without warnings/errors.

2. The [lookup function|https://www.puppet.com/docs/puppet/6/function.html#lookup] can take in a {{default_values_hash}} as a parameter and should use that hash to check for the requested key. However, in this [lookup test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2414], it fails and does not use the passed in {{default_values_hash}} unless another {{lookup}} is used like [this test|https://github.com/puppetlabs/puppet/blob/980a51e3b2e60132c1c00a417b7fc89d353c86f9/spec/unit/functions/lookup_spec.rb#L2410] does.

3.
Dig more into this loaders_spec.rb [test|https://github.com/puppetlabs/puppet/blob/fa0250e7338fe156831599d2280339003b46ccc8/spec/unit/pops/loaders/loaders_spec.rb#L248-L251] that checks that a loader can load a function twice when loading from module. For now, I'll mark that test as pending.

4.
This [acceptance test|https://github.com/puppetlabs/puppet/blob/25a86b1/acceptance/tests/lookup/config5_interpolation.rb] was also failing in a strange way; `strict` errors caused the test to error out, but without it, the test completes correctly, indicating that `::roles` ends up not actually being undefined. 

Josh Cooper (Jira)

unread,
Mar 15, 2023, 4:19:03 PM3/15/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2023-03-01, Phoenix 2023-03-15 , Phoenix 2023-03-29

Aria Li (Jira)

unread,
Apr 18, 2023, 6:29:01 PM4/18/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes Summary: Previously, the strict_variables setting defaulted to false. For Puppet 8, strict mode will be on by default which means strict_variables will be on & default to true and strict will default to error. With strict_variables on, an evaluation error will be raised when referencing unknown variables but not when referencing variables that are explicitly set to undef. This change could potentially be a breaking change.

Aria Li (Jira)

unread,
Apr 18, 2023, 6:29:02 PM4/18/23
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes: Not Needed
Reply all
Reply to author
Forward
0 new messages