Jira (PDOC-262) Puppet Strings output of Puppet types is inconsistent with puppet doc

2 views
Skip to first unread message

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:36:04 PM8/6/18
to puppe...@googlegroups.com
Garrett Guillotte created an issue
 
Puppet Strings / Bug PDOC-262
Puppet Strings output of Puppet types is inconsistent with puppet doc
Issue Type: Bug Bug
Assignee: Unassigned
Components: DOCS
Created: 2018/08/06 11:35 AM
Priority: Normal Normal
Reporter: Garrett Guillotte

Puppet Version: 5.5.3
Puppet Server Version: N/A
OS Name/Version: N/A

When generating resource type docs content from Puppet codewith Puppet Strings, there are several formatting issues, some unique to certain types and others consistent across all types. These might not be relevant in Platform 6 when many of these types are moved to modules, but they currently require manual reconciliation when compiling reference docs for Platform 5.

All Strings output in types

  • The puppet doc output lists providers, but the Strings docs do not. For example, this is included in the doc output for the zfs type, but omitted from the Strings output:

code
<h4 id="zfs-attribute-provider">provider</h4>

The specific backend to use for this `zfs`
resource. You will seldom need to specify this — Puppet will usually
discover the appropriate provider for your platform.

Available providers are:

  • [`zfs`](#zfs-provider-zfs)
    code
  • The puppet doc output lists supported or required features, but the Strings output does not. For example, this appears in the puppet doc output for the service type's enable attribute, but not in the Strings output:

code
Requires features enableable.
code

This occurs despite the required feature being listed in the type:

code
newproperty(:enable, :required_features => :enableable) do
code

and features have their own description strings, which aren't output:

code
feature :enableable, "The provider can enable and disable the service",
code

  • Defaults in the Strings output are formatted intuitively, as:

code

  • Default for: `["osfamily", "solaris"] == `
    code
  • The puppet doc output instead generates:

code

  • Default for `osfamily` == `solaris`.
    code
  • Neither the doc nor Strings output recognizes when multiple allowed values function identically and should ideally be listed together, such as true and yes or false and no in types using Puppet::Parameter::Boolean.
  • The provider support table generated at the end of several types is inconsistent between the puppet doc and Strings output. Specifically, the number of rows per column is inconsistent, and some providers are listed as supported or unsupported differently in each. One especially notable discrepancy is in the mcx type, where the only listed provider (mcxcontent) is listed as supported in the puppet doc output and as unsupported in the Strings output.

Issues with specific types:

file

Symptom: Many attributes are missing.

Apparent cause: Strings does not include attributes defined externally of the main type file. In other words, only the attributes defined in lib/puppet/type/file.rb are output by Strings, and Strings outputs none of the attributes defined in lib/puppet/type/file/*.

filebucket

Symptom: The port attribute has no description in the Puppet Strings output, despite having a description in the type:

code
newparam(:port) do
desc "The port on which the remote server is listening. Defaults to the
value of the `masterport` setting, which is usually %s." % Puppet[:masterport]

defaultto

{ Puppet[:masterport] }

code

Apparent cause: None, but this might be a unique description that attempts to pass a string value (Puppet[:masterport]) back into the description.

yumrepo

Symptom: The ABSENT_DOC and YUM_BOOLEAN strings are not rendered, so "Set this to `absent` to remove it from the file completely." appears in the puppet doc output but not in the Strings output, while the regex representing that Boolean expression instead appears in the Strings output as the word "YUM_BOOLEAN".

Apparent cause: Puppet Strings does not parse these variables, resulting in missing or incorrect output.

zone

Symptom: The sysidcfg attribute description's output includes the {{%

{ ... }%}} brackets in the code.

Apparent cause: desc strings in types are inconsistently wrapped in double quotes, single quotes, heredoc (<<-EOT ... EOT) and different types of brackets (such as {{%q{ ... }

}}. zone is the only type using {{%

{ ... }

%}} brackets.

zpool

Symptom: Quote-escaping backslashes are visible in the Strings output, but not the puppet doc output. For example, the raidz attribute in puppet doc output includes the example:

code
raidz => ["disk1 disk2", "disk3 disk4"],
code

The same example rendered by Puppet Strings is:

code
raidz => [\"disk1 disk2\", \"disk3 disk4\"],
code

Apparent cause: Puppet Strings doesn't require quotes to be escaped with backslashes.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:38:02 PM8/6/18
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
Change By: Garrett Guillotte
*Puppet Version:* 5.5.3
*Puppet Server Version:* N/A
*OS Name/Version:* N/A


When generating resource type docs content from Puppet codewith Puppet Strings, there are several formatting issues, some unique to certain types and others consistent across all types. These might not be relevant in Platform 6 when many of these types are moved to modules, but they currently require manual reconciliation when compiling reference docs for Platform 5.

*All Strings output in types*

* The {{puppet doc}} output lists providers, but the Strings docs do not. For example, this is included in the doc output for the zfs type, but omitted from the Strings output:

{
{ code} }
<h4 id="zfs-attribute-provider">provider</h4>

The specific backend to use for this `zfs`
resource. You will seldom need to specify this --- Puppet will usually

discover the appropriate provider for your platform.

Available providers are:

* [`zfs`](#zfs-provider-zfs)
{
{ code} }

* The {{puppet doc}} output lists supported or required features, but the Strings output does not. For example, this appears in the {{puppet doc}} output for the service type's enable attribute, but not in the Strings output:

{
{ code} }
Requires features enableable.
{
{ code} }

This occurs despite the required feature being listed in the type:

{ { code} }
    newproperty(:enable, :required_features => :enableable) do
{
{ code} }

and features have their own description strings, which aren't output:

{ { code} }
    feature :enableable, "The provider can enable and disable the service",
{
{ code} }

* Defaults in the Strings output are formatted intuitively, as:

{
{ code} }
* Default for: `["osfamily", "solaris"] == `
{
{ code} }

* The {{puppet doc}} output instead generates:

{
{ code} }
* Default for `osfamily` == `solaris`.
{
{ code} }

* Neither the doc nor Strings output recognizes when multiple allowed values function identically and should ideally be listed together, such as {{true}} and {{yes}} or {{false}} and {{no}} in types using {{Puppet::Parameter::Boolean}}.

* The provider support table generated at the end of several types is inconsistent between the {{puppet doc}} and Strings output. Specifically, the number of rows per column is inconsistent, and some providers are listed as supported or unsupported differently in each. One especially notable discrepancy is in the mcx type, where the only listed provider (mcxcontent) is listed as supported in the {{puppet doc}} output and as unsupported in the Strings output.

*Issues with specific types:*

*file*


Symptom: Many attributes are missing.

Apparent cause: Strings does not include attributes defined externally of the main type file. In other words, only the attributes defined in {{lib/puppet/type/file.rb}} are output by Strings, and Strings outputs none of the attributes defined in {{lib/puppet/type/file/*}}.

*filebucket*


Symptom: The port attribute has no description in the Puppet Strings output, despite having a description in the type:

{ { code} }
    newparam(:port) do
      desc "The port on which the remote server is listening. Defaults to the
        value of the `masterport` setting, which is usually %s." % Puppet[:masterport]

      defaultto { Puppet[:masterport] }
{
{ code} }

Apparent cause: None Unknown , but this might be a unique description that attempts to pass a string value ({{Puppet[:masterport]}}) back into the description.

*yumrepo*


Symptom: The {{ABSENT_DOC}} and {{YUM_BOOLEAN}} strings are not rendered, so "Set this to `absent` to remove it from the file completely." appears in the puppet doc output but not in the Strings output, while the regex representing that Boolean expression instead appears in the Strings output as the word "YUM_BOOLEAN".

Apparent cause: Puppet Strings does not parse these variables, resulting in missing or incorrect output.

*zone*


Symptom: The {{sysidcfg}} attribute description's output includes the {{%
{ ... }%}} brackets in the code.


Apparent cause: {{desc}} strings in types are inconsistently wrapped in double quotes, single quotes, heredoc ({{<<-EOT ... EOT}}) and different types of brackets (such as \ {{%q{ ... }

}}. {{zone}} is the only type using {{%

{ ... }

%}} brackets.

*zpool*


Symptom: Quote-escaping backslashes are visible in the Strings output, but not the {{puppet doc}} output. For example, the raidz attribute in {{puppet doc}} output includes the example:

{ { code} }
raidz => ["disk1 disk2", "disk3 disk4"],
{
{ code} }

The same example rendered by Puppet Strings is:

{ { code} }
raidz => [\"disk1 disk2\", \"disk3 disk4\"],
{
{ code} }

Apparent cause: Puppet Strings doesn't necessarily require quotes to be escaped with backslashes.

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:38:03 PM8/6/18
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
*Puppet Version:* 5.5.3
*Puppet Server Version:* N/A
*OS Name/Version:* N/A

When generating resource type docs content from Puppet codewith code with Puppet Strings, there are several formatting issues, some unique to certain types and others consistent across all types. These might not be relevant in Platform 6 when many of these types are moved to modules, but they currently require manual reconciliation when compiling reference docs for Platform 5.
Apparent cause: Unknown, but this might be a unique description that attempts to pass a string value ({{Puppet[:masterport]}}) back into the description.


*yumrepo*

Symptom: The {{ABSENT_DOC}} and {{YUM_BOOLEAN}} strings are not rendered, so "Set this to `absent` to remove it from the file completely." appears in the puppet doc output but not in the Strings output, while the regex representing that Boolean expression instead appears in the Strings output as the word "YUM_BOOLEAN".

Apparent cause: Puppet Strings does not parse these variables, resulting in missing or incorrect output.

*zone*

Symptom: The {{sysidcfg}} attribute description's output includes the
{{ %

\ { ... }% }} brackets in the code.

Apparent cause: {{desc}} strings in types are inconsistently wrapped in double quotes, single quotes, heredoc ({{<<-EOT ... EOT}}) and different types of brackets (such as
\{{ %q \ { ... }


}}
) . {{zone}} is the only type using {{ %

\ { ... }

% }} brackets.

*zpool*

Symptom: Quote-escaping backslashes are visible in the Strings output, but not the {{puppet doc}} output. For example, the raidz attribute in {{puppet doc}} output includes the example:
{code}raidz => ["disk1 disk2", "disk3 disk4"],
{code}
The same example rendered by Puppet Strings is:
{code}raidz => [\"disk1 disk2\", \"disk3 disk4\"],
{code}
Apparent cause: Puppet Strings doesn't necessarily require quotes to be escaped with backslashes.

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:42:03 PM8/6/18
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
*Puppet Version:* 5.5.3
*Puppet Server Version:* N/A
*OS Name/Version:* N/A

When generating resource type docs content from Puppet code with Puppet Strings, there are several formatting issues, some unique to certain types and others consistent across all types. These might not be relevant in Platform 6 when many of these types are moved to modules, but they currently require manual reconciliation when compiling reference docs for Platform 5.
Apparent cause: {{desc}} strings in types are inconsistently wrapped in double quotes, single quotes, heredoc ({{<<-EOT ... EOT}}) and different types of brackets (such as %q\{ ... }). {{zone}} is the only type using %\{ ... }% brackets.


*zpool*

Symptom: Quote-escaping backslashes are visible in the Strings output, but not the {{puppet doc}} output. For example, the raidz attribute in {{puppet doc}} output includes the example:
{code}raidz => ["disk1 disk2", "disk3 disk4"],
{code}
The same example rendered by Puppet Strings is:
{code}raidz => [\"disk1 disk2\", \"disk3 disk4\"],
{code}
Apparent cause: Puppet Strings doesn't necessarily require quotes to be escaped with backslashes.


*Steps to reproduce*
# Clone the puppetlabs/puppet-docs repository.
# Generate references from the top level of the repository by running
{noformat}
bundle exec rake references:puppet VERSION=5.5.3{noformat}
# Compare the resulting type and type_strings output.

Details and prerequisites for generating reference output is in [Confluence|https://confluence.puppetlabs.com/display/DOCS/Generating+References] or in the puppet-docs repository.

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:43:02 PM8/6/18
to puppe...@googlegroups.com

Garrett Guillotte (JIRA)

unread,
Aug 6, 2018, 2:47:04 PM8/6/18
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
Change By: Garrett Guillotte
*Puppet Version:* 5.5.3
*Puppet Server Version:* N/A
*OS Name/Version:* N/A

When generating resource type docs content from Puppet code with Puppet Strings, there are several formatting issues, some unique to certain types and others consistent across all types. These might not be relevant in Platform 6 when many of these types are moved to modules, but they currently require manual reconciliation when compiling reference docs for Platform 5.

*All Strings output in types*
* The {{puppet doc}} output lists providers, but the Strings docs do not. For example, this is included in the doc output for the zfs type, but omitted from the Strings output:

{code}<h4 id="zfs-attribute-provider">provider</h4>

The specific backend to use for this `zfs`
resource. You will seldom need to specify this --- Puppet will usually
discover the appropriate provider for your platform.

Available providers are:

* [`zfs`](#zfs-provider-zfs)
{code} * The {{puppet doc}} output lists supported or required features, but the Strings output does not. For example, this appears in the {{puppet doc}} output for the service type's enable attribute, but not in the Strings output:

{code}Requires features enableable.
{code}
This occurs despite the required feature being listed in the type:
{code}    newproperty(:enable, :required_features => :enableable) do
{code}
and features have their own description strings, which aren't output:
{code}    feature :enableable, "The provider can enable and disable the service",
{code}

* Defaults in the Strings output are formatted intuitively unintuitively , as:

{code}* Default for: `["osfamily", "solaris"] == `
{code}
* The {{puppet doc}} output instead generates:
{code}* Default for `osfamily` == `solaris`.
{code}

* Neither the doc nor Strings output recognizes when multiple allowed values function identically and should ideally be listed together, such as {{true}} and {{yes}} or {{false}} and {{no}} in types using {{Puppet::Parameter::Boolean}}.

* The provider support table generated at the end of several types is inconsistent between the {{puppet doc}} and Strings output. Specifically, the number of rows per column is inconsistent, and some providers are listed as supported or unsupported differently in each. One especially notable discrepancy is in the mcx type, where the only listed provider (mcxcontent) is listed as supported in the {{puppet doc}} output and as unsupported in the Strings output.

*Issues with specific types:*

* exec, file*

Garrett Guillotte (JIRA)

unread,
Aug 7, 2018, 8:20:02 PM8/7/18
to puppe...@googlegroups.com

Jesse Scott (JIRA)

unread,
May 28, 2019, 6:21:04 PM5/28/19
to puppe...@googlegroups.com
Jesse Scott updated an issue
 
Puppet Strings / Story PDOC-262

Going to create an epic and break this down into smaller individual tickets

Change By: Jesse Scott
Issue Type: Bug Story

Jean Bond (JIRA)

unread,
Jun 5, 2019, 4:38:03 PM6/5/19
to puppe...@googlegroups.com
Jean Bond commented on Story PDOC-262
 
Re: Puppet Strings output of Puppet types is inconsistent with puppet doc

Adding another issue here so that it's not lost before this ticket gets broken down:

Slack discussion: https://puppetcommunity.slack.com/archives/C0W298S9G/p1559694938039700

 

file resource parameters listed at the top of the file.md page:

file { 'resource title':
  path                    => # (namevar) The path to the file to manage.  Must be fully...
  ensure                  => # Whether the file should exist, and if so what...
  backup                  => # Whether (and how) file content should be backed...
  checksum                => # The checksum type to use when determining...
  checksum_value          => # The checksum of the source contents. Only md5...
  content                 => # The desired contents of a file, as a string...
  ctime                   => # A read-only state to check the file ctime. On...
  force                   => # Perform the file operation even if it will...
  group                   => # Which group should own the file.  Argument can...
  ignore                  => # A parameter which omits action on files matching 
  links                   => # How to handle links during file actions.  During 
  mode                    => # The desired permissions mode for the file, in...
  mtime                   => # A read-only state to check the file mtime. On...
  owner                   => # The user to whom the file should belong....
  provider                => # The specific backend to use for this `file...
  purge                   => # Whether unmanaged files should be purged. This...
  recurse                 => # Whether to recursively manage the _contents_ of...
  recurselimit            => # How far Puppet should descend into...
  replace                 => # Whether to replace a file or symlink that...
  selinux_ignore_defaults => # If this is set then Puppet will not ask SELinux...
  selrange                => # What the SELinux range component of the context...
  selrole                 => # What the SELinux role component of the context...
  seltype                 => # What the SELinux type component of the context...
  seluser                 => # What the SELinux user component of the context...
  show_diff               => # Whether to display differences when the file...
  source                  => # A source file, which will be copied into place...
  source_permissions      => # Whether (and how) Puppet should copy owner...
  sourceselect            => # Whether to copy all valid sources, or just the...
  target                  => # The target for creating a link.  Currently...
  type                    => # A read-only state to check the file...
  validate_cmd            => # A command for validating the file's syntax...
  validate_replacement    => # The replacement string in a `validate_cmd` that...
  # ...plus any applicable metaparameters

file resource parameters listed at the top of the file.md page based on Strings output:

file { 'resource title':
  path                 => # (namevar) The path to the file to manage.  Must be fully...
  backup               => # Whether (and how) file content should be backed...
  force                => # Perform the file operation even if it will...
  ignore               => # A parameter which omits action on files matching 
  links                => # How to handle links during file actions.  During 
  purge                => # Whether unmanaged files should be purged. This...
  recurse              => # Whether to recursively manage the _contents_ of...
  recurselimit         => # How far Puppet should descend into...
  replace              => # Whether to replace a file or symlink that...
  show_diff            => # Whether to display differences when the file...
  sourceselect         => # Whether to copy all valid sources, or just the...
  validate_cmd         => # A command for validating the file's syntax...
  validate_replacement => # The replacement string in a `validate_cmd` that...
  # ...plus any applicable metaparameters.

The missing parameters are missing from both the code block and the listings/descriptions below the code block.

Garrett Guillotte (JIRA)

unread,
Jun 5, 2019, 7:42:03 PM6/5/19
to puppe...@googlegroups.com

Thanks Jean Bond, this is noted in the ticket description (and also affects exec):

Apparent cause: Strings does not include attributes defined externally of the main type file. In other words, only the attributes defined in lib/puppet/type/file.rb are output by Strings, and Strings outputs none of the attributes defined in lib/puppet/type/file/*.

The missing file attributes are also detailed in DOC-3545, and the missing exec attributes are detailed in DOCUMENT-847.

Jesse Scott (JIRA)

unread,
Jun 12, 2019, 8:24:03 PM6/12/19
to puppe...@googlegroups.com
Jesse Scott updated an issue
Change By: Jesse Scott
Epic Status: In Progress
Epic Name: puppet strings vs. docs
Status: Accepted Defining
Workflow: Scrum Team Engineering Epic Workflow
Issue Type: Story Epic

Jesse Scott (JIRA)

unread,
Jun 12, 2019, 8:25:02 PM6/12/19
to puppe...@googlegroups.com
Jesse Scott commented on Epic PDOC-262
 
Re: Puppet Strings output of Puppet types is inconsistent with puppet doc

I converted this to an Epic, next I'm going to start going through and extracting the various bits into their own tickets.

Reply all
Reply to author
Forward
0 new messages