Hello community,

here is the log from the commit of package rubygem-puppet-syntax for 
openSUSE:Factory checked in at 2015-05-16 07:14:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-puppet-syntax (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-puppet-syntax.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-puppet-syntax"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-puppet-syntax/rubygem-puppet-syntax.changes  
    2015-02-13 08:35:11.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-puppet-syntax.new/rubygem-puppet-syntax.changes
 2015-05-16 07:14:45.000000000 +0200
@@ -1,0 +2,9 @@
+Tue May 12 11:55:44 UTC 2015 - [email protected]
+
+- Version bump 2.0.0
+  * Removed support for Puppet version 2.7.x
+  * New option, fail_on_deprecation_notices, which defaults to true (compatible
+    with previous behaviour); thanks @pcfens
+  * PuppetSyntax::Manifests#check now has two return arguments
+
+-------------------------------------------------------------------

Old:
----
  puppet-syntax-1.4.1.gem

New:
----
  puppet-syntax-2.0.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-puppet-syntax.spec ++++++
--- /var/tmp/diff_new_pack.r2X85x/_old  2015-05-16 07:14:46.000000000 +0200
+++ /var/tmp/diff_new_pack.r2X85x/_new  2015-05-16 07:14:46.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-puppet-syntax
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
 #
 
 Name:           rubygem-puppet-syntax
-Version:        1.4.1
+Version:        2.0.0
 Release:        0
 %define mod_name puppet-syntax
 %define mod_full_name %{mod_name}-%{version}

++++++ puppet-syntax-1.4.1.gem -> puppet-syntax-2.0.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml     1970-01-01 01:00:00.000000000 +0100
+++ new/.travis.yml     1970-01-01 01:00:00.000000000 +0100
@@ -2,10 +2,8 @@
 language: ruby
 script: bundle exec rake
 rvm:
-  - 1.8.7
   - 1.9.3
 env:
-  - PUPPET_VERSION="~> 2.7.0"
   - PUPPET_VERSION="~> 3.0.0"
   - PUPPET_VERSION="~> 3.1.0"
   - PUPPET_VERSION="~> 3.2.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG new/CHANGELOG
--- old/CHANGELOG       1970-01-01 01:00:00.000000000 +0100
+++ new/CHANGELOG       1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +1,9 @@
+2015-02-25 Release 2.0.0
+- Removed support for Puppet version 2.7.x
+- New option, fail_on_deprecation_notices, which defaults to true (compatible
+with previous behaviour); thanks @pcfens
+- PuppetSyntax::Manifests#check now has two return arguments
+
 2015-01-08 Release 1.4.1
 - Support appending to config arrays, thanks @domcleal
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/puppet-syntax/manifests.rb 
new/lib/puppet-syntax/manifests.rb
--- old/lib/puppet-syntax/manifests.rb  1970-01-01 01:00:00.000000000 +0100
+++ new/lib/puppet-syntax/manifests.rb  1970-01-01 01:00:00.000000000 +0100
@@ -5,7 +5,7 @@
       require 'puppet'
       require 'puppet/face'
 
-      errors = []
+      output = []
 
       # FIXME: We shouldn't need to do this. puppet/face should. See:
       # - http://projects.puppetlabs.com/issues/15529
@@ -15,7 +15,7 @@
       end
 
       # Catch syntax warnings.
-      Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(errors))
+      Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(output))
       Puppet::Util::Log.level = :warning
 
       filelist.each do |puppet_file|
@@ -24,19 +24,26 @@
         rescue SystemExit
           # Disregard exit(1) from face.
         rescue => error
-          errors << error
+          output << error
         end
       end
 
       Puppet::Util::Log.close_all
-      errors.map! { |e| e.to_s }
+      output.map! { |e| e.to_s }
 
       # Exported resources will raise warnings when outside a puppetmaster.
-      errors.reject! { |e|
+      output.reject! { |e|
         e =~ /^You cannot collect( exported resources)? without storeconfigs 
being set/
       }
 
-      errors
+      deprecations = output.select { |e|
+        e =~ /^Deprecation notice:|is deprecated/
+      }
+
+      # Errors exist if there is any output that isn't a deprecation notice.
+      has_errors = (output != deprecations)
+
+      return output, has_errors
     end
 
     private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/puppet-syntax/tasks/puppet-syntax.rb 
new/lib/puppet-syntax/tasks/puppet-syntax.rb
--- old/lib/puppet-syntax/tasks/puppet-syntax.rb        1970-01-01 
01:00:00.000000000 +0100
+++ new/lib/puppet-syntax/tasks/puppet-syntax.rb        1970-01-01 
01:00:00.000000000 +0100
@@ -36,8 +36,9 @@
           files = files.exclude(*PuppetSyntax.exclude_paths)
 
           c = PuppetSyntax::Manifests.new
-          errors = c.check(files)
-          fail errors.join("\n") unless errors.empty?
+          output, has_errors = c.check(files)
+          print "#{output.join("\n")}\n" unless output.empty?
+          fail if has_errors || ( output.any? && 
PuppetSyntax.fail_on_deprecation_notices )
         end
 
         desc 'Syntax check Puppet templates'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/puppet-syntax/version.rb 
new/lib/puppet-syntax/version.rb
--- old/lib/puppet-syntax/version.rb    1970-01-01 01:00:00.000000000 +0100
+++ new/lib/puppet-syntax/version.rb    1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
 module PuppetSyntax
-  VERSION = "1.4.1"
+  VERSION = "2.0.0"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/puppet-syntax.rb new/lib/puppet-syntax.rb
--- old/lib/puppet-syntax.rb    1970-01-01 01:00:00.000000000 +0100
+++ new/lib/puppet-syntax.rb    1970-01-01 01:00:00.000000000 +0100
@@ -7,8 +7,9 @@
   @exclude_paths = []
   @future_parser = false
   @hieradata_paths = ["**/data/**/*.yaml", "hieradata/**/*.yaml", 
"hiera*.yaml"]
+  @fail_on_deprecation_notices = true
 
   class << self
-    attr_accessor :exclude_paths, :future_parser, :hieradata_paths
+    attr_accessor :exclude_paths, :future_parser, :hieradata_paths, 
:fail_on_deprecation_notices
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        1970-01-01 01:00:00.000000000 +0100
+++ new/metadata        1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: puppet-syntax
 version: !ruby/object:Gem::Version
-  version: 1.4.1
+  version: 2.0.0
   prerelease: 
 platform: ruby
 authors:
@@ -9,7 +9,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-01-08 00:00:00.000000000 Z
+date: 2015-02-26 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
@@ -84,6 +84,7 @@
 - spec/fixtures/hiera/hiera_bad.yaml
 - spec/fixtures/hiera/hiera_bad_18.yaml
 - spec/fixtures/hiera/hiera_good.yaml
+- spec/fixtures/test_module/manifests/deprecation_notice.pp
 - spec/fixtures/test_module/manifests/fail_error.pp
 - spec/fixtures/test_module/manifests/fail_warning.pp
 - spec/fixtures/test_module/manifests/future_syntax.pp
@@ -115,7 +116,7 @@
       version: '0'
       segments:
       - 0
-      hash: -3142815382772503907
+      hash: 2080509366784508245
 required_rubygems_version: !ruby/object:Gem::Requirement
   none: false
   requirements:
@@ -124,7 +125,7 @@
       version: '0'
       segments:
       - 0
-      hash: -3142815382772503907
+      hash: 2080509366784508245
 requirements: []
 rubyforge_project: 
 rubygems_version: 1.8.23.2
@@ -135,6 +136,7 @@
 - spec/fixtures/hiera/hiera_bad.yaml
 - spec/fixtures/hiera/hiera_bad_18.yaml
 - spec/fixtures/hiera/hiera_good.yaml
+- spec/fixtures/test_module/manifests/deprecation_notice.pp
 - spec/fixtures/test_module/manifests/fail_error.pp
 - spec/fixtures/test_module/manifests/fail_warning.pp
 - spec/fixtures/test_module/manifests/future_syntax.pp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/spec/fixtures/test_module/manifests/deprecation_notice.pp 
new/spec/fixtures/test_module/manifests/deprecation_notice.pp
--- old/spec/fixtures/test_module/manifests/deprecation_notice.pp       
1970-01-01 01:00:00.000000000 +0100
+++ new/spec/fixtures/test_module/manifests/deprecation_notice.pp       
1970-01-01 01:00:00.000000000 +0100
@@ -0,0 +1,6 @@
+node test inherits default {
+  import 'pass.pp'
+  notify { 'this should give a deprecation notice':
+    message => 'inheritance is gone in the future parser',
+  }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/puppet-syntax/manifests_spec.rb 
new/spec/puppet-syntax/manifests_spec.rb
--- old/spec/puppet-syntax/manifests_spec.rb    1970-01-01 01:00:00.000000000 
+0100
+++ new/spec/puppet-syntax/manifests_spec.rb    1970-01-01 01:00:00.000000000 
+0100
@@ -10,50 +10,96 @@
 
   it 'should return nothing from a valid file' do
     files = fixture_manifests('pass.pp')
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
 
-    expect(res).to eq([])
+    expect(output).to eq([])
+    expect(has_errors).to eq(false)
   end
 
   it 'should return an error from an invalid file' do
     files = fixture_manifests('fail_error.pp')
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
 
-    expect(res.size).to eq(1)
-    expect(res[0]).to match(/Syntax error at .*:3$/)
+    expect(output.size).to eq(1)
+    expect(output[0]).to match(/Syntax error at .*:3$/)
+    expect(has_errors).to eq(true)
   end
 
   it 'should return a warning from an invalid file' do
     files = fixture_manifests('fail_warning.pp')
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
 
-    expect(res.size).to eq(2)
-    expect(res[0]).to match(/Unrecognised escape sequence '\\\[' .* at line 
3$/)
-    expect(res[1]).to match(/Unrecognised escape sequence '\\\]' .* at line 
3$/)
+    expect(output.size).to eq(2)
+    expect(output[0]).to match(/Unrecognised escape sequence '\\\[' .* at line 
3$/)
+    expect(output[1]).to match(/Unrecognised escape sequence '\\\]' .* at line 
3$/)
+    expect(has_errors).to eq(true)
   end
 
   it 'should ignore warnings about storeconfigs' do
     files = fixture_manifests('pass_storeconfigs.pp')
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
+
+    expect(output).to eq([])
+    expect(has_errors).to eq(false)
 
-    expect(res).to eq([])
   end
 
   it 'should read more than one valid file' do
     files = fixture_manifests(['pass.pp', 'pass_storeconfigs.pp'])
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
 
-    expect(res).to eq([])
+    expect(output).to eq([])
+    expect(has_errors).to eq(false)
   end
 
   it 'should continue after finding an error in the first file' do
     files = fixture_manifests(['fail_error.pp', 'fail_warning.pp'])
-    res = subject.check(files)
+    output, has_errors = subject.check(files)
+
+    expect(output.size).to eq(3)
+    expect(output[0]).to match(/Syntax error at '\}' .*:3$/)
+    expect(output[1]).to match(/Unrecognised escape sequence '\\\[' .* at line 
3$/)
+    expect(output[2]).to match(/Unrecognised escape sequence '\\\]' .* at line 
3$/)
+    expect(has_errors).to eq(true)
+  end
+
+  describe 'deprecation notices' do
+    # These tests should fail in Puppet 4, but we need to wait for the release
+    # before we'll know exactly how to test it.
+    if Puppet::Util::Package.versioncmp(Puppet.version, '3.7') >= 0
+      context 'on puppet >= 3.7' do
+        it 'should return deprecation notices as warnings' do
+          files = fixture_manifests('deprecation_notice.pp')
+          output, has_errors = subject.check(files)
+
+          expect(has_errors).to eq(false)
+          expect(output.size).to eq(2)
+          expect(output[0]).to match(/The use of 'import' is deprecated/)
+          expect(output[1]).to match(/Deprecation notice:/)
+        end
+      end
+    elsif Puppet::Util::Package.versioncmp(Puppet.version, '3.5') >= 0
+      context 'on puppet 3.5 and 3.6' do
+        it 'should return deprecation notices as warnings' do
+          files = fixture_manifests('deprecation_notice.pp')
+          output, has_errors = subject.check(files)
+
+          expect(has_errors).to eq(false)
+          expect(output.size).to eq(1)
+          expect(output[0]).to match(/The use of 'import' is deprecated/)
+        end
+      end
+    elsif Puppet::Util::Package.versioncmp(Puppet.version, '3.5') < 0
+      context 'on puppet < 3.5' do
+        it 'should not print deprecation notices' do
+          files = fixture_manifests('deprecation_notice.pp')
+          output, has_errors = subject.check(files)
 
-    expect(res.size).to eq(3)
-    expect(res[0]).to match(/Syntax error at '\}' .*:3$/)
-    expect(res[1]).to match(/Unrecognised escape sequence '\\\[' .* at line 
3$/)
-    expect(res[2]).to match(/Unrecognised escape sequence '\\\]' .* at line 
3$/)
+          expect(output).to eq([])
+          expect(has_errors).to eq(false)
+        end
+      end
+    end
   end
 
   describe 'future_parser' do
@@ -62,10 +108,11 @@
         expect(PuppetSyntax.future_parser).to eq(false)
 
         files = fixture_manifests(['future_syntax.pp'])
-        res = subject.check(files)
+        output, has_errors = subject.check(files)
 
-        expect(res.size).to eq(1)
-        expect(res[0]).to match(/Syntax error at '='; expected '\}' .*:2$/)
+        expect(output.size).to eq(1)
+        expect(output[0]).to match(/Syntax error at '='; expected '\}' .*:2$/)
+        expect(has_errors).to eq(true)
       end
     end
 
@@ -78,19 +125,34 @@
         context 'Puppet >= 3.2' do
           it 'should pass with future option set to true on future manifest' do
             files = fixture_manifests(['future_syntax.pp'])
-            res = subject.check(files)
+            output, has_errors = subject.check(files)
 
-            expect(res.size).to eq(0)
+            expect(output).to eq([])
+            expect(has_errors).to eq(false)
+          end
+        end
+        context 'Puppet >= 3.7' do
+          # Certain elements of the future parser weren't added until 3.7
+          if Puppet::Util::Package.versioncmp(Puppet.version, '3.7') >= 0
+            it 'should fail on what were deprecation notices in the non-future 
parser' do
+              files = fixture_manifests('deprecation_notice.pp')
+              output, has_errors = subject.check(files)
+
+              expect(output.size).to eq(1)
+              expect(output[0]).to match(/Node inheritance is not supported/)
+              expect(has_errors).to eq(true)
+            end
           end
         end
       else
-        context 'Puppet <= 3.2' do
+        context 'Puppet < 3.2' do
           it 'should return an error that the parser option is not supported' 
do
             files = fixture_manifests(['future_syntax.pp'])
-            res = subject.check(files)
+            output, has_errors = subject.check(files)
 
-            expect(res.size).to eq(1)
-            expect(res[0]).to match("Attempt to assign a value to unknown 
configuration parameter :parser")
+            expect(output.size).to eq(1)
+            expect(output[0]).to match("Attempt to assign a value to unknown 
configuration parameter :parser")
+            expect(has_errors).to eq(true)
           end
         end
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/puppet-syntax_spec.rb 
new/spec/puppet-syntax_spec.rb
--- old/spec/puppet-syntax_spec.rb      1970-01-01 01:00:00.000000000 +0100
+++ new/spec/puppet-syntax_spec.rb      1970-01-01 01:00:00.000000000 +0100
@@ -24,4 +24,9 @@
     expect(PuppetSyntax.future_parser).to eq(true)
   end
 
+  it 'should support a fail_on_deprecation_notices setting' do
+    PuppetSyntax.fail_on_deprecation_notices = false
+    expect(PuppetSyntax.fail_on_deprecation_notices).to eq(false)
+  end
+
 end


Reply via email to