Jira (FACT-3004) Do not auto promote dotted facts to structured

0 views
Skip to first unread message

Gheorghe Popescu (Jira)

unread,
Apr 2, 2021, 6:31:04 AM4/2/21
to puppe...@googlegroups.com
Gheorghe Popescu created an issue
 
Facter / Bug FACT-3004
Do not auto promote dotted facts to structured
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/04/02 3:30 AM
Priority: Normal Normal
Reporter: Gheorghe Popescu

Dotted facts should not be automatically promoted to structured facts.
This functionality can be enabled trough a global facter setting which by default is set to false.

Eg:

default behavior

Facter.add('a.b.c') do
  setcode { "d" }
end
 
is represented as { "a.b.c": "d" }

setting true

Facter.add('a.b.c') do
  setcode { "d" }
end
 
is represented as 
{
  "a": {
    "b": {
      "c": "d"
    }
  }

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Apr 2, 2021, 6:32:04 AM4/2/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Dotted facts should not be automatically promoted to structured facts.
This functionality can be enabled trough a global facter setting which by default is set to false.

Eg:

default behavior
{code:ruby}
# custom fact
Facter.add('a.b.c') do
  setcode { "d" }
end

# external fact
a.b.c=d

is represented as { "a.b.c": "d" }
{code}

setting true
{code:ruby}
# custom fact
Facter.add('a.b.c') do
  setcode { "d" }
end

# external fact
a.b.c=d

is represented as
{
  "a": {
    "b": {
      "c": "d"
    }
  }
{code}

Josh Cooper (Jira)

unread,
Apr 2, 2021, 12:38:04 PM4/2/21
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Gheorghe Popescu
Change By: Josh Cooper
Assignee: Gheorghe Popescu

Josh Cooper (Jira)

unread,
Apr 2, 2021, 12:38:04 PM4/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: FACT 4.0.53

Gheorghe Popescu (Jira)

unread,
Apr 5, 2021, 6:40:03 AM4/5/21
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Apr 5, 2021, 6:40:03 AM4/5/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 5, 2021, 3:47:04 PM4/5/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3004
 
Re: Do not auto promote dotted facts to structured

This passed puppet-agent#main CI, but puppet-agent#6.x is still pinned to facter 4.0.50, which will be handled in PA-3693.

Gheorghe Popescu (Jira)

unread,
Apr 6, 2021, 7:55:03 AM4/6/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Dotted Facter 4 (up to 4.0.52) provides a way to create structured facts from multiple fact definitions. However, the feature is not compatible with other parts of the Puppet ecosystem and can cause facts to be named differently in Facter 4 than in Facter 2/3.

In order to avoid changing Puppet manifests, hiera lookups, PE classification rules, dotted facts
should not be automatically promoted to structured facts.
This functionality can
Treating those facts as structured will still
be enabled trough possible by  usging a global facter setting which by default is set to false.


Eg:

default behavior
{code:ruby}
# custom fact
Facter.add('a.b.c') do
  setcode { "d" }
end

# external fact
a.b.c=d

is represented as { "a.b.c": "d" }
{code}

setting true
{code:ruby}
# custom fact
Facter.add('a.b.c') do
  setcode { "d" }
end

# external fact
a.b.c=d

is represented as
{
  "a": {
    "b": {
      "c": "d"
    }
  }
{code}

Gheorghe Popescu (Jira)

unread,
Apr 6, 2021, 7:55:04 AM4/6/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Facter 4 (up to 4.0.52) provides a way to create structured facts from multiple fact definitions. However, the feature is not compatible with other parts of the Puppet ecosystem and can cause facts to be named differently in Facter 4 than in Facter 2/3.

In order to avoid changing Puppet manifests, hiera lookups, PE classification rules, dotted custom and external facts should not be automatically promoted to structured facts.

Treating those facts as structured will still be possible by  usging a global facter setting which by default is set to false.

Gheorghe Popescu (Jira)

unread,
Apr 6, 2021, 7:58:02 AM4/6/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Release Notes Summary: Changes the way Facter 4 treats dots in fact names, reverting to the same behaviour as Facter 3. This means that by default, any dot in custom or external fact names will be considered as part of the fact name and not a delimiter for structured facts.

This also adds a global setting `autopromote-dotted-facts` which can be set to enable the conversion of dotted facts to structured.

Gheorghe Popescu (Jira)

unread,
Apr 6, 2021, 7:58:04 AM4/6/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 6, 2021, 1:20:03 PM4/6/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3004
 
Re: Do not auto promote dotted facts to structured

Holding off on resolving this as there is some discussion around the name of the facter setting

Josh Cooper (Jira)

unread,
Apr 6, 2021, 1:49:04 PM4/6/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Flagged: Impediment

Claire Cadman (Jira)

unread,
Apr 13, 2021, 9:19:05 AM4/13/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc_reviewed

Gheorghe Popescu (Jira)

unread,
Apr 15, 2021, 2:24:01 AM4/15/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Release Notes Summary:
Changes the way Facter 4 treats dots in fact names, reverting to the same behaviour as Facter 3. This means that by default, any dot in custom or external fact names will be considered as part of the fact name and not a delimiter for structured facts.

This also adds a global setting ` autopromote force - dotted dot - facts resolution ` which can be set to enable the conversion of dotted facts to structured.
Reply all
Reply to author
Forward
0 new messages