Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce puppet verifier (derived from #1909) #1926

Merged
merged 11 commits into from
Nov 7, 2018

Conversation

masatake
Copy link
Member

@ahakanbaba, could you look ar copyright header of misc/verifiers/verifier-puppet.
Is this o.k.?

I keep puppet-append.d/input.pp as is.
The reasons are:

  - valid in puppet4,
  - testing KNOWN-INVALIDATION special verifier, and
  - testing '#' comment in a verifier file.

@coveralls
Copy link

coveralls commented Oct 24, 2018

Coverage Status

Coverage remained the same at 84.893% when pulling 5377328 on masatake:verify-input-pr into 0f27679 on universal-ctags:master.

@ahakanbaba
Copy link
Contributor

The code changes look good to me. It should be absolutely fine to keep the code with +=. As you mention, it is supported in puppet4.

Did you check which puppet version the tests are using ? I think in fedora by default dnf installs puppet4.

[root@43f127be89b1 /]# /usr/bin/puppet -h | tail -n 2
See 'puppet help <subcommand>' for help on a specific subcommand.
Puppet v4.10.10

If you look at the test the output prints this

puppet-simpleselector.d/input.pp with puppet                     valid
Error: Could not write report for e22e2d5d26ca.ec2.internal at /var/lib/puppet/reports/e22e2d5d26ca.ec2.internal/201810241144.yaml: undefined method `split' for :ensure:Symbol
Error: Could not send report: undefined method `split' for :ensure:Symbol
puppet-singleary.d/input.pp with puppet                          valid

I have found this issue about it
https://tickets.puppetlabs.com/browse/PUP-8892

It looks like a fedora puppet4 ruby2.5 combination
From this comment

i tried puppet 5.5.1 and now do not see below Error, so you were right about puppet 4 and ruby 2.5:-

It looks like it does not affect the exit code of the puppet apply. But the make check output is filled with error prompts that are not really failing the build. Could be confusing to developers.

@ahakanbaba
Copy link
Contributor

ahakanbaba commented Oct 25, 2018

If you want to avoid those confusing error messages you could try to install puppet-agent5.X to the fedora container. I have managed to do it with yum here

$ docker run -it docker.io/fedora:latest bash
[root@71c9239d743b /]#  rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-fedora-26.noarch.rpm
Retrieving https://yum.puppet.com/puppet5/puppet5-release-fedora-26.noarch.rpm
warning: /var/tmp/rpm-tmp.b9CXyw: Header V4 RSA/SHA256 Signature, key ID ef8d349f: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:puppet5-release-5.0.0-4.fc26     ################################# [100%]
[root@71c9239d743b /]# yum  install  --enablerepo=puppet5 puppet-agent-5.5.7 -v --allowerasing
DNF version: 2.7.5
cachedir: /var/cache/dnf
error: Downloading successful, but checksum doesn't match. Calculated: 6c388328c77874271ba5e27f24db62461cdfd0e892cd9f564aab57b007324ead77629867f6d2c06fdc8a43f7a9bb0321a38b8ecca924fa2baf61f649a0710d42(sha512) 6c388328c77874271ba5e27f24db62461cdfd0e892cd9f564aab57b007324ead77629867f6d2c06fdc8a43f7a9bb0321a38b8ecca924fa2baf61f649a0710d42(sha512)  Expected: 3b8fe2510403bcc5540e3a40a86ade48a599588f069692aa118559f72c4554ca191bb95f5189c8a57b176173ef66079b2e3309359ebae1b5f36fa2863554a0ba(sha512) 3795905f05b898c5a6f515f662b1f7871b2991551bce9a7e91fdf234ca539255f6da01122057be0c5714266ffb692fe33ee5662d41793d0c24eb541ce0566955(sha512)  (http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/repomd.xml).
error: Status code: 404 for http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/ea8fceb08858f0cd026cf6f797839163bfa12c7571ed5769432704e70d697129-primary.xml.gz (http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/ea8fceb08858f0cd026cf6f797839163bfa12c7571ed5769432704e70d697129-primary.xml.gz).
error: Status code: 404 for http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/bef3f8b90895086ab157fe3c0c9405eac0780ea473b4499eda38f1b6898d21f7-filelists.xml.gz (http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/bef3f8b90895086ab157fe3c0c9405eac0780ea473b4499eda38f1b6898d21f7-filelists.xml.gz).
error: Status code: 404 for http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/5ca6bd7f4a9e8b0bc75e6c9f3d239549cfb627f34a5aa5d949c99fedf1a39ab7-comps-Everything.x86_64.xml.gz (http://mirror.stavlor.net/pub/fedora/linux/updates/28/Everything/x86_64/repodata/5ca6bd7f4a9e8b0bc75e6c9f3d239549cfb627f34a5aa5d949c99fedf1a39ab7-comps-Everything.x86_64.xml.gz).
Fedora 28 - x86_64 - Updates                                                                                                                                                                                  2.2 MB/s |  26 MB     00:11
updates: using metadata from Tue Oct 23 20:55:29 2018.
Fedora 28 - x86_64                                                                                                                                                                                            6.6 MB/s |  60 MB     00:09
not found deltainfo for: Fedora 28 - x86_64
not found updateinfo for: Fedora 28 - x86_64
fedora: using metadata from Wed Apr 25 04:27:32 2018.
Puppet 5 Repository fedora 26 - x86_64                                                                                                                                                                        840 kB/s | 2.7 MB     00:03
not found deltainfo for: Puppet 5 Repository fedora 26 - x86_64
not found updateinfo for: Puppet 5 Repository fedora 26 - x86_64
puppet5: using metadata from Tue Oct 23 23:06:40 2018.
Last metadata expiration check: 0:00:04 ago on Thu Oct 25 22:26:47 2018.
Missing file *modules.yaml in metadata cache dir: /var/cache/dnf/updates-8bd9ef368505a5fd
Missing file *modules.yaml in metadata cache dir: /var/cache/dnf/fedora-f21308f6293b3270
Missing file *modules.yaml in metadata cache dir: /var/cache/dnf/puppet5-8b05b100fcb453c0
--> Starting dependency resolution
---> Package puppet-agent.x86_64 5.5.7-1.fedora26 will be installed
---> Package coreutils.x86_64 8.29-7.fc28 will be installed
---> Package coreutils-common.x86_64 8.29-7.fc28 will be installed
---> Package ncurses.x86_64 6.1-5.20180224.fc28 will be installed
---> Package coreutils-single.x86_64 8.29-7.fc28 will be erased
--> Finished dependency resolution
Dependencies resolved.
==============================================================================================================================================================================================================================================
 Package                                                    Arch                                             Version                                                         Repository                                                  Size
==============================================================================================================================================================================================================================================
Installing:
 puppet-agent                                               x86_64                                           5.5.7-1.fedora26                                                puppet5                                                     20 M
Installing dependencies:
 coreutils                                                  x86_64                                           8.29-7.fc28                                                     updates                                                    1.2 M
 coreutils-common                                           x86_64                                           8.29-7.fc28                                                     updates                                                    2.0 M
 ncurses                                                    x86_64                                           6.1-5.20180224.fc28                                             updates                                                    377 k
Removing dependent packages:
 coreutils-single                                           x86_64                                           8.29-7.fc28                                                     @koji-override-0                                           1.4 M

Transaction Summary
==============================================================================================================================================================================================================================================
Install  4 Packages
Remove   1 Package

Total download size: 24 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): coreutils-8.29-7.fc28.x86_64.rpm                                                                                                                                                                       1.3 MB/s | 1.2 MB     00:00
(2/4): coreutils-common-8.29-7.fc28.x86_64.rpm                                                                                                                                                                1.8 MB/s | 2.0 MB     00:01
(3/4): ncurses-6.1-5.20180224.fc28.x86_64.rpm                                                                                                                                                                 3.4 MB/s | 377 kB     00:00
(4/4): puppet-agent-5.5.7-1.fedora26.x86_64.rpm                                                                                                                                                                11 MB/s |  20 MB     00:01
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                          10 MB/s |  24 MB     00:02
warning: /var/cache/dnf/puppet5-8b05b100fcb453c0/packages/puppet-agent-5.5.7-1.fedora26.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID ef8d349f: NOKEY
Importing GPG key 0xEF8D349F:
 Userid     : "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>"
 Fingerprint: 6F6B 1550 9CF8 E59E 6E46 9F32 7F43 8280 EF8D 349F
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppet5-release
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
RPMDB altered outside of DNF.
  Preparing        :                                                                                                                                                                                                                      1/1
  Installing       : ncurses-6.1-5.20180224.fc28.x86_64                                                                                                                                                                                   1/5
  Installing       : coreutils-common-8.29-7.fc28.x86_64                                                                                                                                                                                  2/5
  Running scriptlet: coreutils-common-8.29-7.fc28.x86_64                                                                                                                                                                                  2/5
  Installing       : coreutils-8.29-7.fc28.x86_64                                                                                                                                                                                         3/5
  Running scriptlet: puppet-agent-5.5.7-1.fedora26.x86_64                                                                                                                                                                                 4/5
  Installing       : puppet-agent-5.5.7-1.fedora26.x86_64                                                                                                                                                                                 4/5
  Running scriptlet: puppet-agent-5.5.7-1.fedora26.x86_64                                                                                                                                                                                 4/5
  Erasing          : coreutils-single-8.29-7.fc28.x86_64                                                                                                                                                                                  5/5
  Running scriptlet: puppet-agent-5.5.7-1.fedora26.x86_64                                                                                                                                                                                 5/5
  Running scriptlet: coreutils-single-8.29-7.fc28.x86_64                                                                                                                                                                                  5/5
  Verifying        : puppet-agent-5.5.7-1.fedora26.x86_64                                                                                                                                                                                 1/5
  Verifying        : coreutils-8.29-7.fc28.x86_64                                                                                                                                                                                         2/5
  Verifying        : coreutils-common-8.29-7.fc28.x86_64                                                                                                                                                                                  3/5
  Verifying        : ncurses-6.1-5.20180224.fc28.x86_64                                                                                                                                                                                   4/5
  Verifying        : coreutils-single-8.29-7.fc28.x86_64                                                                                                                                                                                  5/5

Removed:
  coreutils-single.x86_64 8.29-7.fc28

Installed:
  puppet-agent.x86_64 5.5.7-1.fedora26                          coreutils.x86_64 8.29-7.fc28                          coreutils-common.x86_64 8.29-7.fc28                          ncurses.x86_64 6.1-5.20180224.fc28

Complete!
[root@71c9239d743b /]# /opt/puppetlabs/bin/puppet  -h | tail -n 2
See 'puppet help <subcommand>' for help on a specific subcommand.
Puppet v5.5.7
[root@71c9239d743b /]#

@@ -14,7 +14,7 @@ jobs:
name: Install build tools
command: |
dnf -y install gcc automake autoconf pkgconfig bmake aspell-devel aspell-en libxml2-devel jansson-devel libyaml-devel findutils || :
dnf -y install jq
dnf -y install jq puppet || :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly recommend to tie to a minor version of puppet here, rather than getting the latest. Because the latest in fedora 28 repo may change without giving any notice and your tests may fail without any code change in the ctags repo.

If a developer wants to start supporting a future puppet6 release, she will have to do a code-change in circleci file and also fix all the newly appearing puppet verification errors. Your tests would not use puppet6 before that even though it has been released upstream already.

For example the code should be

jq puppet-4.10.10-1  || : 

See it in action here:

[root@b252d974d2ad /]# yum --showduplicates list puppet
Last metadata expiration check: 0:01:08 ago on Thu Oct 25 22:31:52 2018.
Available Packages
puppet.noarch                                                                                                      4.10.10-1.fc28                                                                                                       fedora
[root@b252d974d2ad /]# yum install puppet-4.10.10-1
Last metadata expiration check: 0:01:18 ago on Thu Oct 25 22:31:52 2018.
No match for argument: puppet-4.10.10-1
Error: Unable to find a match
[root@b252d974d2ad /]# yum install puppet-4.10.10
Last metadata expiration check: 0:01:47 ago on Thu Oct 25 22:31:52 2018.
Dependencies resolved.
==============================================================================================================================================================================================================================================
 Package                                                           Arch                                               Version                                                       Repository                                           Size
==============================================================================================================================================================================================================================================
Installing:
 puppet                                                            noarch                                             4.10.10-1.fc28                                                fedora                                              1.4 M
Installing dependencies:
 augeas-libs                                                       x86_64                                             1.10.1-2.fc28                                                 fedora                                              389 k
 boost-atomic                                                      x86_64                                             1.66.0-8.fc28                                                 updates                                              53 k
 boost-chrono                                                      x86_64                                             1.66.0-8.fc28                                                 updates                                              62 k
 boost-date-time                                                   x86_64                                             1.66.0-8.fc28                                                 updates                                              68 k
 boost-filesystem                                                  x86_64                                             1.66.0-8.fc28                                                 updates                                              88 k
 boost-locale                                                      x86_64                                             1.66.0-8.fc28                                                 updates                                             304 k
 boost-log                                                         x86_64                                             1.66.0-8.fc28                                                 updates                                             486 k
 boost-program-options                                             x86_64                                             1.66.0-8.fc28                                                 updates                                             179 k
 boost-regex                                                       x86_64                                             1.66.0-8.fc28                                                 updates                                             320 k
 boost-system                                                      x86_64                                             1.66.0-8.fc28                                                 updates                                              57 k
 boost-thread                                                      x86_64                                             1.66.0-8.fc28                                                 updates                                              97 k
 cpp-hocon                                                         x86_64                                             0.1.6-7.fc28                                                  fedora                                              419 k
 facter                                                            x86_64                                             3.9.3-4.fc28                                                  fedora                                              623 k
 hiera                                                             noarch                                             3.3.1-3.fc28                                                  fedora                                               34 k
 leatherman                                                        x86_64                                             1.3.0-6.fc28                                                  fedora                                              386 k
 libicu                                                            x86_64                                             60.2-2.fc28                                                   fedora                                              8.8 M
 libselinux-ruby                                                   x86_64                                             2.8-1.fc28                                                    updates                                             135 k
 libselinux-utils                                                  x86_64                                             2.8-1.fc28                                                    updates                                             165 k
 libstdc++                                                         x86_64                                             8.2.1-4.fc28                                                  updates                                             468 k
 ruby                                                              x86_64                                             2.5.1-93.fc28                                                 updates                                              81 k
 ruby-augeas                                                       x86_64                                             0.5.0-16.fc28                                                 fedora                                               30 k
 ruby-facter                                                       x86_64                                             3.9.3-4.fc28                                                  fedora                                               16 k
 ruby-irb                                                          noarch                                             2.5.1-93.fc28                                                 updates                                              98 k
 ruby-libs                                                         x86_64                                             2.5.1-93.fc28                                                 updates                                             2.8 M
 rubygem-json                                                      x86_64                                             2.1.0-105.fc28                                                fedora                                               59 k
 rubygem-openssl                                                   x86_64                                             2.1.0-93.fc28                                                 updates                                             177 k
 rubygem-pathspec                                                  noarch                                             0.2.1-2.fc28                                                  fedora                                               20 k
 rubygem-psych                                                     x86_64                                             3.0.2-93.fc28                                                 updates                                              90 k
 rubygem-rgen                                                      noarch                                             0.7.0-2.fc24                                                  fedora                                               88 k
 rubygem-ruby-shadow                                               x86_64                                             2.5.0-5.fc28                                                  fedora                                               16 k
 rubygems                                                          noarch                                             2.7.6-93.fc28                                                 updates                                             304 k
 rubypick                                                          noarch                                             1.1.1-8.fc28                                                  fedora                                               11 k
 yaml-cpp                                                          x86_64                                             0.6.1-4.fc28                                                  updates                                             169 k
Installing weak dependencies:
 rubygem-bigdecimal                                                x86_64                                             1.3.4-93.fc28                                                 updates                                              91 k
 rubygem-did_you_mean                                              noarch                                             1.2.0-93.fc28                                                 updates                                              86 k
 rubygem-io-console                                                x86_64                                             0.4.6-93.fc28                                                 updates                                              61 k
 rubygem-rdoc                                                      noarch                                             6.0.3-2.fc28                                                  fedora                                              443 k

Transaction Summary
==============================================================================================================================================================================================================================================
Install  38 Packages

Total download size: 19 M
Installed size: 64 M
Is this ok [y/N]: y
Downloading Packages:
(1/38): ruby-augeas-0.5.0-16.fc28.x86_64.rpm                                                                                                                                                                   72 kB/s |  30 kB     00:00
(2/38): hiera-3.3.1-3.fc28.noarch.rpm                                                                                                                                                                          83 kB/s |  34 kB     00:00
(3/38): ruby-facter-3.9.3-4.fc28.x86_64.rpm                                                                                                                                                                   196 kB/s |  16 kB     00:00
(4/38): rubygem-pathspec-0.2.1-2.fc28.noarch.rpm                                                                                                                                                              248 kB/s |  20 kB     00:00
(5/38): rubygem-ruby-shadow-2.5.0-5.fc28.x86_64.rpm                                                                                                                                                           113 kB/s |  16 kB     00:00
(6/38): rubygem-rgen-0.7.0-2.fc24.noarch.rpm                                                                                                                                                                  419 kB/s |  88 kB     00:00
(7/38): rubypick-1.1.1-8.fc28.noarch.rpm                                                                                                                                                                      129 kB/s |  11 kB     00:00
(8/38): augeas-libs-1.10.1-2.fc28.x86_64.rpm                                                                                                                                                                  1.6 MB/s | 389 kB     00:00
(9/38): puppet-4.10.10-1.fc28.noarch.rpm                                                                                                                                                                      1.5 MB/s | 1.4 MB     00:00
(10/38): leatherman-1.3.0-6.fc28.x86_64.rpm                                                                                                                                                                   2.6 MB/s | 386 kB     00:00
(11/38): cpp-hocon-0.1.6-7.fc28.x86_64.rpm                                                                                                                                                                    2.4 MB/s | 419 kB     00:00
(12/38): facter-3.9.3-4.fc28.x86_64.rpm                                                                                                                                                                       1.4 MB/s | 623 kB     00:00
(13/38): libselinux-utils-2.8-1.fc28.x86_64.rpm                                                                                                                                                               360 kB/s | 165 kB     00:00
(14/38): libselinux-ruby-2.8-1.fc28.x86_64.rpm                                                                                                                                                                275 kB/s | 135 kB     00:00
(15/38): ruby-2.5.1-93.fc28.x86_64.rpm                                                                                                                                                                        663 kB/s |  81 kB     00:00
(16/38): rubygem-json-2.1.0-105.fc28.x86_64.rpm                                                                                                                                                               661 kB/s |  59 kB     00:00
(17/38): rubygems-2.7.6-93.fc28.noarch.rpm                                                                                                                                                                    1.4 MB/s | 304 kB     00:00
(18/38): boost-atomic-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                528 kB/s |  53 kB     00:00
(19/38): boost-chrono-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                825 kB/s |  62 kB     00:00
(20/38): boost-system-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                780 kB/s |  57 kB     00:00
(21/38): boost-locale-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                2.3 MB/s | 304 kB     00:00
(22/38): boost-thread-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                1.0 MB/s |  97 kB     00:00
(23/38): boost-filesystem-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                            804 kB/s |  88 kB     00:00
(24/38): boost-date-time-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                             858 kB/s |  68 kB     00:00
(25/38): ruby-libs-2.5.1-93.fc28.x86_64.rpm                                                                                                                                                                   2.2 MB/s | 2.8 MB     00:01
(26/38): boost-log-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                   2.4 MB/s | 486 kB     00:00
(27/38): libstdc++-8.2.1-4.fc28.x86_64.rpm                                                                                                                                                                    3.6 MB/s | 468 kB     00:00
(28/38): boost-regex-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                                 2.2 MB/s | 320 kB     00:00
(29/38): boost-program-options-1.66.0-8.fc28.x86_64.rpm                                                                                                                                                       2.2 MB/s | 179 kB     00:00
(30/38): yaml-cpp-0.6.1-4.fc28.x86_64.rpm                                                                                                                                                                     1.9 MB/s | 169 kB     00:00
(31/38): rubygem-openssl-2.1.0-93.fc28.x86_64.rpm                                                                                                                                                             2.1 MB/s | 177 kB     00:00
(32/38): rubygem-psych-3.0.2-93.fc28.x86_64.rpm                                                                                                                                                               1.2 MB/s |  90 kB     00:00
(33/38): rubygem-bigdecimal-1.3.4-93.fc28.x86_64.rpm                                                                                                                                                          1.2 MB/s |  91 kB     00:00
(34/38): rubygem-did_you_mean-1.2.0-93.fc28.noarch.rpm                                                                                                                                                        1.1 MB/s |  86 kB     00:00
(35/38): rubygem-io-console-0.4.6-93.fc28.x86_64.rpm                                                                                                                                                          828 kB/s |  61 kB     00:00
(36/38): ruby-irb-2.5.1-93.fc28.noarch.rpm                                                                                                                                                                    1.2 MB/s |  98 kB     00:00
(37/38): libicu-60.2-2.fc28.x86_64.rpm                                                                                                                                                                        8.5 MB/s | 8.8 MB     00:01
(38/38): rubygem-rdoc-6.0.3-2.fc28.noarch.rpm                                                                                                                                                                 968 kB/s | 443 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                         4.5 MB/s |  19 MB     00:04
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                      1/1
  Installing       : libstdc++-8.2.1-4.fc28.x86_64                                                                                                                                                                                       1/38
  Running scriptlet: libstdc++-8.2.1-4.fc28.x86_64                                                                                                                                                                                       1/38
  Installing       : ruby-libs-2.5.1-93.fc28.x86_64                                                                                                                                                                                      2/38
  Installing       : boost-system-1.66.0-8.fc28.x86_64                                                                                                                                                                                   3/38
  Installing       : boost-chrono-1.66.0-8.fc28.x86_64                                                                                                                                                                                   4/38
  Installing       : boost-thread-1.66.0-8.fc28.x86_64                                                                                                                                                                                   5/38
  Installing       : boost-atomic-1.66.0-8.fc28.x86_64                                                                                                                                                                                   6/38
  Installing       : boost-date-time-1.66.0-8.fc28.x86_64                                                                                                                                                                                7/38
  Installing       : boost-filesystem-1.66.0-8.fc28.x86_64                                                                                                                                                                               8/38
  Installing       : ruby-2.5.1-93.fc28.x86_64                                                                                                                                                                                           9/38
  Installing       : rubypick-1.1.1-8.fc28.noarch                                                                                                                                                                                       10/38
  Installing       : rubygem-openssl-2.1.0-93.fc28.x86_64                                                                                                                                                                               11/38
  Installing       : rubygem-psych-3.0.2-93.fc28.x86_64                                                                                                                                                                                 12/38
  Installing       : rubygems-2.7.6-93.fc28.noarch                                                                                                                                                                                      13/38
  Installing       : libicu-60.2-2.fc28.x86_64                                                                                                                                                                                          14/38
  Running scriptlet: libicu-60.2-2.fc28.x86_64                                                                                                                                                                                          14/38
  Installing       : boost-locale-1.66.0-8.fc28.x86_64                                                                                                                                                                                  15/38
  Installing       : boost-regex-1.66.0-8.fc28.x86_64                                                                                                                                                                                   16/38
  Installing       : rubygem-json-2.1.0-105.fc28.x86_64                                                                                                                                                                                 17/38
  Installing       : boost-program-options-1.66.0-8.fc28.x86_64                                                                                                                                                                         18/38
  Installing       : cpp-hocon-0.1.6-7.fc28.x86_64                                                                                                                                                                                      19/38
  Installing       : boost-log-1.66.0-8.fc28.x86_64                                                                                                                                                                                     20/38
  Installing       : leatherman-1.3.0-6.fc28.x86_64                                                                                                                                                                                     21/38
  Running scriptlet: leatherman-1.3.0-6.fc28.x86_64                                                                                                                                                                                     21/38
  Installing       : rubygem-pathspec-0.2.1-2.fc28.noarch                                                                                                                                                                               22/38
  Installing       : rubygem-rgen-0.7.0-2.fc24.noarch                                                                                                                                                                                   23/38
  Installing       : rubygem-ruby-shadow-2.5.0-5.fc28.x86_64                                                                                                                                                                            24/38
  Installing       : rubygem-io-console-0.4.6-93.fc28.x86_64                                                                                                                                                                            25/38
  Installing       : hiera-3.3.1-3.fc28.noarch                                                                                                                                                                                          26/38
  Installing       : ruby-irb-2.5.1-93.fc28.noarch                                                                                                                                                                                      27/38
  Installing       : libselinux-ruby-2.8-1.fc28.x86_64                                                                                                                                                                                  28/38
  Installing       : yaml-cpp-0.6.1-4.fc28.x86_64                                                                                                                                                                                       29/38
  Running scriptlet: yaml-cpp-0.6.1-4.fc28.x86_64                                                                                                                                                                                       29/38
  Installing       : facter-3.9.3-4.fc28.x86_64                                                                                                                                                                                         30/38
  Running scriptlet: facter-3.9.3-4.fc28.x86_64                                                                                                                                                                                         30/38
  Installing       : ruby-facter-3.9.3-4.fc28.x86_64                                                                                                                                                                                    31/38
  Installing       : libselinux-utils-2.8-1.fc28.x86_64                                                                                                                                                                                 32/38
  Installing       : augeas-libs-1.10.1-2.fc28.x86_64                                                                                                                                                                                   33/38
  Running scriptlet: augeas-libs-1.10.1-2.fc28.x86_64                                                                                                                                                                                   33/38
  Installing       : ruby-augeas-0.5.0-16.fc28.x86_64                                                                                                                                                                                   34/38
  Running scriptlet: puppet-4.10.10-1.fc28.noarch                                                                                                                                                                                       35/38
  Installing       : puppet-4.10.10-1.fc28.noarch                                                                                                                                                                                       35/38
  Running scriptlet: puppet-4.10.10-1.fc28.noarch                                                                                                                                                                                       35/38
  Installing       : rubygem-rdoc-6.0.3-2.fc28.noarch                                                                                                                                                                                   36/38
  Installing       : rubygem-bigdecimal-1.3.4-93.fc28.x86_64                                                                                                                                                                            37/38
  Installing       : rubygem-did_you_mean-1.2.0-93.fc28.noarch                                                                                                                                                                          38/38
  Running scriptlet: rubygem-did_you_mean-1.2.0-93.fc28.noarch                                                                                                                                                                          38/38
  Verifying        : puppet-4.10.10-1.fc28.noarch                                                                                                                                                                                        1/38
  Verifying        : hiera-3.3.1-3.fc28.noarch                                                                                                                                                                                           2/38
  Verifying        : ruby-augeas-0.5.0-16.fc28.x86_64                                                                                                                                                                                    3/38
  Verifying        : ruby-facter-3.9.3-4.fc28.x86_64                                                                                                                                                                                     4/38
  Verifying        : rubygem-pathspec-0.2.1-2.fc28.noarch                                                                                                                                                                                5/38
  Verifying        : rubygem-rgen-0.7.0-2.fc24.noarch                                                                                                                                                                                    6/38
  Verifying        : rubygem-ruby-shadow-2.5.0-5.fc28.x86_64                                                                                                                                                                             7/38
  Verifying        : rubypick-1.1.1-8.fc28.noarch                                                                                                                                                                                        8/38
  Verifying        : augeas-libs-1.10.1-2.fc28.x86_64                                                                                                                                                                                    9/38
  Verifying        : facter-3.9.3-4.fc28.x86_64                                                                                                                                                                                         10/38
  Verifying        : cpp-hocon-0.1.6-7.fc28.x86_64                                                                                                                                                                                      11/38
  Verifying        : leatherman-1.3.0-6.fc28.x86_64                                                                                                                                                                                     12/38
  Verifying        : libselinux-utils-2.8-1.fc28.x86_64                                                                                                                                                                                 13/38
  Verifying        : libselinux-ruby-2.8-1.fc28.x86_64                                                                                                                                                                                  14/38
  Verifying        : ruby-libs-2.5.1-93.fc28.x86_64                                                                                                                                                                                     15/38
  Verifying        : ruby-2.5.1-93.fc28.x86_64                                                                                                                                                                                          16/38
  Verifying        : rubygems-2.7.6-93.fc28.noarch                                                                                                                                                                                      17/38
  Verifying        : rubygem-json-2.1.0-105.fc28.x86_64                                                                                                                                                                                 18/38
  Verifying        : boost-atomic-1.66.0-8.fc28.x86_64                                                                                                                                                                                  19/38
  Verifying        : boost-chrono-1.66.0-8.fc28.x86_64                                                                                                                                                                                  20/38
  Verifying        : boost-system-1.66.0-8.fc28.x86_64                                                                                                                                                                                  21/38
  Verifying        : boost-locale-1.66.0-8.fc28.x86_64                                                                                                                                                                                  22/38
  Verifying        : boost-thread-1.66.0-8.fc28.x86_64                                                                                                                                                                                  23/38
  Verifying        : libicu-60.2-2.fc28.x86_64                                                                                                                                                                                          24/38
  Verifying        : boost-filesystem-1.66.0-8.fc28.x86_64                                                                                                                                                                              25/38
  Verifying        : boost-date-time-1.66.0-8.fc28.x86_64                                                                                                                                                                               26/38
  Verifying        : boost-log-1.66.0-8.fc28.x86_64                                                                                                                                                                                     27/38
  Verifying        : boost-regex-1.66.0-8.fc28.x86_64                                                                                                                                                                                   28/38
  Verifying        : libstdc++-8.2.1-4.fc28.x86_64                                                                                                                                                                                      29/38
  Verifying        : boost-program-options-1.66.0-8.fc28.x86_64                                                                                                                                                                         30/38
  Verifying        : yaml-cpp-0.6.1-4.fc28.x86_64                                                                                                                                                                                       31/38
  Verifying        : rubygem-openssl-2.1.0-93.fc28.x86_64                                                                                                                                                                               32/38
  Verifying        : rubygem-psych-3.0.2-93.fc28.x86_64                                                                                                                                                                                 33/38
  Verifying        : rubygem-bigdecimal-1.3.4-93.fc28.x86_64                                                                                                                                                                            34/38
  Verifying        : rubygem-did_you_mean-1.2.0-93.fc28.noarch                                                                                                                                                                          35/38
  Verifying        : rubygem-io-console-0.4.6-93.fc28.x86_64                                                                                                                                                                            36/38
  Verifying        : rubygem-rdoc-6.0.3-2.fc28.noarch                                                                                                                                                                                   37/38
  Verifying        : ruby-irb-2.5.1-93.fc28.noarch                                                                                                                                                                                      38/38

Installed:
  puppet.noarch 4.10.10-1.fc28                rubygem-bigdecimal.x86_64 1.3.4-93.fc28        rubygem-did_you_mean.noarch 1.2.0-93.fc28         rubygem-io-console.x86_64 0.4.6-93.fc28        rubygem-rdoc.noarch 6.0.3-2.fc28
  augeas-libs.x86_64 1.10.1-2.fc28            boost-atomic.x86_64 1.66.0-8.fc28              boost-chrono.x86_64 1.66.0-8.fc28                 boost-date-time.x86_64 1.66.0-8.fc28           boost-filesystem.x86_64 1.66.0-8.fc28
  boost-locale.x86_64 1.66.0-8.fc28           boost-log.x86_64 1.66.0-8.fc28                 boost-program-options.x86_64 1.66.0-8.fc28        boost-regex.x86_64 1.66.0-8.fc28               boost-system.x86_64 1.66.0-8.fc28
  boost-thread.x86_64 1.66.0-8.fc28           cpp-hocon.x86_64 0.1.6-7.fc28                  facter.x86_64 3.9.3-4.fc28                        hiera.noarch 3.3.1-3.fc28                      leatherman.x86_64 1.3.0-6.fc28
  libicu.x86_64 60.2-2.fc28                   libselinux-ruby.x86_64 2.8-1.fc28              libselinux-utils.x86_64 2.8-1.fc28                libstdc++.x86_64 8.2.1-4.fc28                  ruby.x86_64 2.5.1-93.fc28
  ruby-augeas.x86_64 0.5.0-16.fc28            ruby-facter.x86_64 3.9.3-4.fc28                ruby-irb.noarch 2.5.1-93.fc28                     ruby-libs.x86_64 2.5.1-93.fc28                 rubygem-json.x86_64 2.1.0-105.fc28
  rubygem-openssl.x86_64 2.1.0-93.fc28        rubygem-pathspec.noarch 0.2.1-2.fc28           rubygem-psych.x86_64 3.0.2-93.fc28                rubygem-rgen.noarch 0.7.0-2.fc24               rubygem-ruby-shadow.x86_64 2.5.0-5.fc28
  rubygems.noarch 2.7.6-93.fc28               rubypick.noarch 1.1.1-8.fc28                   yaml-cpp.x86_64 0.6.1-4.fc28

Complete!
[root@b252d974d2ad /]#

@masatake
Copy link
Member Author

@ahakanbaba, thank you very much. As usual, things are much complicated than I assumed.

I wonder what I should do.

I would like to merge this PR first because ... this is not a project developing versions neutral puppet verifier. Instead, I would like to add what you wrote here as comments in misc/verifier/verifier-puppet.

@ahakanbaba
Copy link
Contributor

Sounds good to me @masatake . I think the PR can be merged with how it looks.

@ahakanbaba
Copy link
Contributor

I wanted to make sure @masatake do you want anything from me before merging this PR ?

@masatake
Copy link
Member Author

Sorry to be late. I would like to add descriptions about how to use and write a verifier in docs/testing.rst.
I would like you to review it when I write it. However, I have no time now.

@masatake
Copy link
Member Author

masatake commented Nov 2, 2018

BTW, we call the scripts and the targets of Makefile "verifier". On the other hand, we call the result of verifier "valid" or "invalid". So I wonder we should call the scripts and the targets "validator". How do you think ?

@ahakanbaba
Copy link
Contributor

Validator sounds good to me.

@masatake
Copy link
Member Author

masatake commented Nov 2, 2018

@ahakanbaba, thank you.

ahakanbaba and others added 9 commits November 4, 2018 22:09
…ment)

Avoid the error reported from puppet validator:
	"Error: Could not find node statement with name 'default' or ..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
Avoid the error reported from puppet validator:
	"Error: Could not parse for environment production:
	 The parameter $name redefines a built in parameter..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
…mode)

Avoid the error reported from puppet validator:
	"The file mode specification must be a string, not 'Integer'..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
Avoid the error reported from puppet validator:
	"Error: Evaluation Error: Resource type not found: Yayness..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
…ment)

Avoid the error reported from puppet validator:
	"Error: Could not parse for environment production:
	 This 'if' statement has no effect. ..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
Avoid the error reported from puppet validator:
	"Error: Evaluation Error: Operator '[]' is not applicable
	 to an Undef Value."

(@masatake splits the original commits into smaller pieces and modifies the log.)
(@masatake splits the original commits into smaller pieces and modifies the log.)
Avoid the error reported from puppet validator:
	"Warning: Class 'one' is already defined at..."

(@masatake splits the original commits into smaller pieces and modifies the log.)
Units/parser-puppetManifest.r/puppet-append.d/validator is very special.

About puppet-append.d/validator, the puppet validator reports this input as
"invalid" because `+=' operator is obsoleted in puppet5.
@ahakanbaba in universal-ctags#1909 reported and proposed a fix for this already.
However, @masatake kept this as is for following reasons:

  - valid in puppet4,
  - testing KNOWN-INVALIDATION special validator, and
  - testing '#' comment in a validator file.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake
Copy link
Member Author

masatake commented Nov 6, 2018

@ahakanbaba, could you look at the last commit in this PR (docs(web): write about validate-input target) ?
Could you give me comments especially about my broken English ?

# This driver script doesn't take care the version of puppet.
# As the result, you may get much warnings on some platform
# though the results of validations are "valid".
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This driver script does not specify the used puppet version. Instead, puppet version will depend on the platform runtime. As a result, you may see some warnings on some platforms even tough the validation has passed.

# is available from official Fedora28 repository.
# With using puppet4 as puppet, this validator reports
# much warnings like:
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of writing this comment, puppet5 is becoming popular. In #1909, @ahakanbaba has fixed much of test cases to be valid puppet5 files. Even tough that PR exists, we are still sticking with puppet4 in our automated tests. One of our test platforms is Fedora28 and its distribution has puppet4 at this time. As the note about warnings above mentions, in validation runs using puppet4 you may see the following Errors prompts that do not fail the validation.

# in this script. @ahakanbaba shows the way to do so in #1926.
# However, because I (@masatake) don't want to take much time to write
# portable puppet validator, I keep this script as is.
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Copy link
Contributor

@ahakanbaba ahakanbaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masatake I have reviewed the texts you added. They look pretty good actually I only made minor comments.
Needless to say, I am not a technical writer. There may be still room for improvement but I gave suggestions where ever I could.


This example shows validating *simple-json.d/input.json* as an input
file with *jq* validator. With VALIDATORS variable passed via
command-line, You can specify validators to run. Multiple validators
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command-line, you can (changed Y to y)


#skipped (validator unavailable)

a backend command for a validator command is not available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by a "backend command"
I think you can drop backend and just say.
A command for a validator is not available

*misc/validators/validator-jq* is the command for "jq".

The command file must be an executable. *validate-input* make target
run the command in two ways.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runs the command


*validate* method

The make targets runs the command with "validate* and an input
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The make target runs the command
or
The make targets run the command

The make targets runs the command with "validate* and an input
file name for validating the input file. The command exits
non-zero if the input file is written invalid syntax. It exits
non-zero for invalid input. This method will never run if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of :

    non-zero if the input file is written invalid syntax. It exits
    non-zero for invalid input.

The command exits non-zero if the input file contains invalid syntax.

I do not think you need to repeat yourself.

@ahakanbaba
Copy link
Contributor

Very excited for this improvement. Thank you very much @masatake

@ahakanbaba helps me much to improve the comments.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@ahakanbaba helps me to write better English.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake
Copy link
Member Author

masatake commented Nov 7, 2018

@ahakanbaba, thank you very much.
I update the changes.
I will merge this in soon.

So the next one I should work on is #1916, isn't it?

@masatake masatake merged commit befcb88 into universal-ctags:master Nov 7, 2018
@ahakanbaba
Copy link
Contributor

Hi @masatake if we could address #1916, it would be amazing.
It looks like a nuanced issue and one PR may not fix everything. As far as I understand, first ctags needs to support puppet scoping with :: delimiter ( with --extras=+q). Then we need to make sure the top namespace with empty string name is at the bottom of the scope stack. (I hope this makes sense, I am be very wrong here too)
I work on a very large puppet code base, there may be new issues coming out regarding scoping fixes. It would be great to expect couple of iterations to get everything smoothly working. Needless to say, I am more than willing to help in any possible way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants