<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/spec/unit/parser/ast, branch ticket/master/7841</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>Adding []/[]= support to Scope</title>
<updated>2011-07-15T18:51:49+00:00</updated>
<author>
<name>Luke Kanies</name>
<email>luke@puppetlabs.com</email>
</author>
<published>2011-06-08T14:03:54+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=0d2e0672eb516a1b1f2ced6b8c74bd2064dd205e'/>
<id>0d2e0672eb516a1b1f2ced6b8c74bd2064dd205e</id>
<content type='text'>
The interface to scope is much clearer this way anyway,
but this is needed to integrate Puppet with Hiera[1].
It just provides hash-like behavior to Scope, which Hiera
and others can now easily rely on.

I also went through all of the code that used Scope#lookupvar
and Scope#setvar and changed it if possible, and at the same
time cleaned up a lot of tests that were unnecessarily stubbing
(and thus making it difficult to tell if I had actually broken
anything).

1 - https://github.com/ripienaar/hiera

Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The interface to scope is much clearer this way anyway,
but this is needed to integrate Puppet with Hiera[1].
It just provides hash-like behavior to Scope, which Hiera
and others can now easily rely on.

I also went through all of the code that used Scope#lookupvar
and Scope#setvar and changed it if possible, and at the same
time cleaned up a lot of tests that were unnecessarily stubbing
(and thus making it difficult to tell if I had actually broken
anything).

1 - https://github.com/ripienaar/hiera

Signed-off-by: Luke Kanies &lt;luke@puppetlabs.com&gt;
Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7681) Allow array variables as resource references</title>
<updated>2011-05-26T20:32:11+00:00</updated>
<author>
<name>Nick Lewis</name>
<email>nick@puppetlabs.com</email>
</author>
<published>2011-05-26T20:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=9f6dec267467334dcc5e1157b9dce57a325cbb73'/>
<id>9f6dec267467334dcc5e1157b9dce57a325cbb73</id>
<content type='text'>
The commit df088c9ba16dce50c17a79920c1ac186db67b9e9 introduced a regression
where

  $files = ["/tmp/one", "/tmp/two"]
  file { "/tmp/one": content =&gt; "one", }
  file { "/tmp/two": content =&gt; "two", }
  file { "/tmp/three":
    content =&gt; "three",
    require =&gt; File[$files],
  }

no longer worked.  File[$files] was concatenating the elements of $files to
create a single title, instead of expanding to multiple File dependencies.

Since resource reference titles are implicitly wrapped in an array, if one of
the elements of that array is a variable containing an array, the list of
titles is a nested array. Prior to the change causing the regression, we would
flatten arrays when evaluating them, under certain circumstances.  We no longer
ever flatten AST arrays when evaluating them, so anywhere that we really do
need a flattened array, we have to manually flatten it.

ResourceReference expects its list of titles to be a single, flat list of
titles, so we have to make it so.

Paired-with: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit df088c9ba16dce50c17a79920c1ac186db67b9e9 introduced a regression
where

  $files = ["/tmp/one", "/tmp/two"]
  file { "/tmp/one": content =&gt; "one", }
  file { "/tmp/two": content =&gt; "two", }
  file { "/tmp/three":
    content =&gt; "three",
    require =&gt; File[$files],
  }

no longer worked.  File[$files] was concatenating the elements of $files to
create a single title, instead of expanding to multiple File dependencies.

Since resource reference titles are implicitly wrapped in an array, if one of
the elements of that array is a variable containing an array, the list of
titles is a nested array. Prior to the change causing the regression, we would
flatten arrays when evaluating them, under certain circumstances.  We no longer
ever flatten AST arrays when evaluating them, so anywhere that we really do
need a flattened array, we have to manually flatten it.

ResourceReference expects its list of titles to be a single, flat list of
titles, so we have to make it so.

Paired-with: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7507) Add ability to filter Ruby 1.9 spec failures</title>
<updated>2011-05-17T16:57:26+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-05-16T23:10:21+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=9da1454e71b8330e929ac5616eefa44388c90832'/>
<id>9da1454e71b8330e929ac5616eefa44388c90832</id>
<content type='text'>
By running:

    rspec spec --tag ~@fails_on_ruby_1.9.2

We can now just run the specs that pass under Ruby 1.9.  Obviously in
the long term we want to have all the specs passing, but until then we
need notification when we regress.  From now on new code will be
required to pass under Ruby 1.9, and Jenkins will give us email
notification if it doesn't or if we break something that was already
working.

Reviewed-by: Daniel Pittman &lt;daniel@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By running:

    rspec spec --tag ~@fails_on_ruby_1.9.2

We can now just run the specs that pass under Ruby 1.9.  Obviously in
the long term we want to have all the specs passing, but until then we
need notification when we regress.  From now on new code will be
required to pass under Ruby 1.9, and Jenkins will give us email
notification if it doesn't or if we break something that was already
working.

Reviewed-by: Daniel Pittman &lt;daniel@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: clean up the spec test headers in bulk.</title>
<updated>2011-04-13T07:36:38+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-13T07:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=db11770718c61f9ee3d5fcd703c5c0c7c05227ca'/>
<id>db11770718c61f9ee3d5fcd703c5c0c7c05227ca</id>
<content type='text'>
We now use a shebang of: #!/usr/bin/env rspec

This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We now use a shebang of: #!/usr/bin/env rspec

This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix for #5027 -- generate a deprication warning for dynamic lookup</title>
<updated>2011-04-12T19:47:32+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-10-25T16:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=d0a56522f9c574b4a6db81caf4589175c901b09e'/>
<id>d0a56522f9c574b4a6db81caf4589175c901b09e</id>
<content type='text'>
This fix implements the same logic as Nick &amp; Paul's patch in a different way.
There aren't any tests yet and I'm still working out if I agree with the
handling of some edge cases, so this should be considered premliminary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fix implements the same logic as Nick &amp; Paul's patch in a different way.
There aren't any tests yet and I'm still working out if I agree with the
handling of some edge cases, so this should be considered premliminary.
</pre>
</div>
</content>
</entry>
<entry>
<title>Towards 5027 -- add options hash to lookupvar as with setvar</title>
<updated>2011-04-12T19:47:32+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-10-25T06:29:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=739260b28d7c09bacbb34cd4f4d4a32cfee01385'/>
<id>739260b28d7c09bacbb34cd4f4d4a32cfee01385</id>
<content type='text'>
This patch adds an options hash to lookupvar analogous to the one taken by
setvar and uses it to pass in source location for error reporting.  It also
fixes the mechanism used by setvar (file was not being passed correctly), adds
line and file information to errors in templates, and extends/corrects tests.

As presently written it does not gather userful line numbers from inline
templates and there are no tests for the template line number generation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds an options hash to lookupvar analogous to the one taken by
setvar and uses it to pass in source location for error reporting.  It also
fixes the mechanism used by setvar (file was not being passed correctly), adds
line and file information to errors in templates, and extends/corrects tests.

As presently written it does not gather userful line numbers from inline
templates and there are no tests for the template line number generation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor en route to #5027 -- remove usestring parameter from lookupvar</title>
<updated>2011-04-12T19:47:31+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-10-22T00:24:09+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=31f8e660c8f4c0ec01f140322cf7c585144a0888'/>
<id>31f8e660c8f4c0ec01f140322cf7c585144a0888</id>
<content type='text'>
The usestring parameter to lookupvar was objectionable for several reasons;
first, it performed a function orthogonal to the main purpose of the method,
second its default was the least common value, and third it was causing other
code to work for reasons that were not obvious (extlookup).

This refactor breaks the value-transforming function out into a seperate
method which allows the user to specify the value to be used in lieu of :undef
and removes the parameter.  The function, Scope#undef_as(default,exp) is
written so that it can be used in user code (templates, functions, etc.) if
needed.

This refactor will introduce a user-visible behaviour change in the case where
users were counting on lookupvar to return "" for undefined variables.  The
best solution is to have them use undef_as, replacing:

    lookupvar('myvar')

with

    undef_as('',lookupvar('myvar'))

(with the option to specify another default value if desired).  If this is too
objectionable, we could rename the existing lookupvar as raw_lookupvar and
define

    def lookupvar(v)
      undef_as('',raw_lookupvar(v))
    end

to restore the present behaviour.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The usestring parameter to lookupvar was objectionable for several reasons;
first, it performed a function orthogonal to the main purpose of the method,
second its default was the least common value, and third it was causing other
code to work for reasons that were not obvious (extlookup).

This refactor breaks the value-transforming function out into a seperate
method which allows the user to specify the value to be used in lieu of :undef
and removes the parameter.  The function, Scope#undef_as(default,exp) is
written so that it can be used in user code (templates, functions, etc.) if
needed.

This refactor will introduce a user-visible behaviour change in the case where
users were counting on lookupvar to return "" for undefined variables.  The
best solution is to have them use undef_as, replacing:

    lookupvar('myvar')

with

    undef_as('',lookupvar('myvar'))

(with the option to specify another default value if desired).  If this is too
objectionable, we could rename the existing lookupvar as raw_lookupvar and
define

    def lookupvar(v)
      undef_as('',raw_lookupvar(v))
    end

to restore the present behaviour.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: just require 'spec_helper', thanks rspec2</title>
<updated>2011-04-08T23:06:57+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-08T23:06:57+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=6ed00515e8614233160d74b1c32b75fab27ac722'/>
<id>6ed00515e8614233160d74b1c32b75fab27ac722</id>
<content type='text'>
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...

...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name.  Yay.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...

...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name.  Yay.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#6830) Fix overly stubbed tests</title>
<updated>2011-03-29T18:00:47+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-03-29T04:35:34+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=29f3dda2aaa4a6225baaa5819ebad32909b01f93'/>
<id>29f3dda2aaa4a6225baaa5819ebad32909b01f93</id>
<content type='text'>
In Ruby 1.9 calling .each on a stub calls to_a, and if you're not
stubbing to_a you get:

  unexpected invocation: #&lt;Mock:option1&gt;.to_a()

Could have stubbed to_a also, but less stubbing is better in these cases

Reviewed-by: Jesse Wolfe &lt;jesse@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Ruby 1.9 calling .each on a stub calls to_a, and if you're not
stubbing to_a you get:

  unexpected invocation: #&lt;Mock:option1&gt;.to_a()

Could have stubbed to_a also, but less stubbing is better in these cases

Reviewed-by: Jesse Wolfe &lt;jesse@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>    Merge branch '2.6.x' into next</title>
<updated>2011-03-18T21:10:24+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-03-18T21:10:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2ae88067492f7922a3c4d53b6fa8c849b193f76a'/>
<id>2ae88067492f7922a3c4d53b6fa8c849b193f76a</id>
<content type='text'>
    * 2.6.x: (36 commits)
      Updated CHANGELOG for 2.6.7rc1
      (#5073) Download plugins even if you're filtering on tags
      Fix #5610: Prevent unnecessary RAL lookups
      Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next"
      (#6723) Fix withenv environment restoration bug
      (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord
      Remove extra trailing whitespace from lib/puppet/resource.rb
      (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs
      (#6707) Fix typo in rest_authconfig.rb
      (#6689) Make inventory_active_record terminus search quickly
      (#5392) Give a better error when realizing a non-existant resource
      (#2645) Adding a less-stubby test to verify the "system" attribute's behavior
      Update CHANGELOG for 2.6.6
      maint: Remove serialization of InventoryFact values
      maint: Rename InventoryHost to InventoryNode
      Fixed #2645 - Added support for creating system users
      maint: Remove spec run noise
      maint:Refactor of mount provider integration tests
      (#6338) Support searching on metadata in InventoryActiveRecord terminus
      (#6338) Implement search for InventoryActiveRecord facts terminus
      ...

    This merge includes essentially reverting #4904's change to the mount
    type since tests that came in from 2.6.x specified different
    behavior and what's correct is not clear to me.  I've reopened #4904 and
    added it to our backlog, and talked to Nigel about the RFC that's
    currently out on the puppet-users mailing list for a bigger refactor of
    how the mount provider works.

    Manually Resolved Conflicts:
        spec/spec_helper.rb
        spec/unit/indirector/queue_spec.rb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    * 2.6.x: (36 commits)
      Updated CHANGELOG for 2.6.7rc1
      (#5073) Download plugins even if you're filtering on tags
      Fix #5610: Prevent unnecessary RAL lookups
      Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next"
      (#6723) Fix withenv environment restoration bug
      (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord
      Remove extra trailing whitespace from lib/puppet/resource.rb
      (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs
      (#6707) Fix typo in rest_authconfig.rb
      (#6689) Make inventory_active_record terminus search quickly
      (#5392) Give a better error when realizing a non-existant resource
      (#2645) Adding a less-stubby test to verify the "system" attribute's behavior
      Update CHANGELOG for 2.6.6
      maint: Remove serialization of InventoryFact values
      maint: Rename InventoryHost to InventoryNode
      Fixed #2645 - Added support for creating system users
      maint: Remove spec run noise
      maint:Refactor of mount provider integration tests
      (#6338) Support searching on metadata in InventoryActiveRecord terminus
      (#6338) Implement search for InventoryActiveRecord facts terminus
      ...

    This merge includes essentially reverting #4904's change to the mount
    type since tests that came in from 2.6.x specified different
    behavior and what's correct is not clear to me.  I've reopened #4904 and
    added it to our backlog, and talked to Nigel about the RFC that's
    currently out on the puppet-users mailing list for a bigger refactor of
    how the mount provider works.

    Manually Resolved Conflicts:
        spec/spec_helper.rb
        spec/unit/indirector/queue_spec.rb
</pre>
</div>
</content>
</entry>
</feed>
