<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/spec/lib/puppet, branch master</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>maint: Fix Face testing bug 1.9.2 revealed.</title>
<updated>2011-07-25T18:06:58+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-25T18:06:58+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=d522b0b824285d025884ff271cda957df1c9951d'/>
<id>d522b0b824285d025884ff271cda957df1c9951d</id>
<content type='text'>
Ruby 1.8.7 is fairly lax about various bits of introspection, including that
we can't tell much about what arguments a block takes.  Ruby 1.9.2 makes it
possible to do this, though.

Meanwhile, the Faces system uses this to make sure that scripts and actions
take the right set of arguments, to avoid surprises: failing early and
explicitly is better than failing at runtime.

Which, in final turn, exposes that I forgot to accept the right arguments in a
couple of my testing actions for Faces, but didn't notice because 1.8.7
doesn't check that, and I didn't test on 1.9.2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 1.8.7 is fairly lax about various bits of introspection, including that
we can't tell much about what arguments a block takes.  Ruby 1.9.2 makes it
possible to do this, though.

Meanwhile, the Faces system uses this to make sure that scripts and actions
take the right set of arguments, to avoid surprises: failing early and
explicitly is better than failing at runtime.

Which, in final turn, exposes that I forgot to accept the right arguments in a
couple of my testing actions for Faces, but didn't notice because 1.8.7
doesn't check that, and I didn't test on 1.9.2.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7184) Load the core of obsolete versions of Faces.</title>
<updated>2011-07-22T20:29:32+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-21T23:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=532c4f37e4f8289cf4a9871ebc0cb5086c2ba26a'/>
<id>532c4f37e4f8289cf4a9871ebc0cb5086c2ba26a</id>
<content type='text'>
When we define an action on an older version of a Face, we must be sure to
directly load the core of that version, not just define it with the external
Action(s) that it had.

Otherwise we break our contract, which is that any core Actions for a specific
version will be available to your external Action for as long as we support
that core version.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we define an action on an older version of a Face, we must be sure to
directly load the core of that version, not just define it with the external
Action(s) that it had.

Otherwise we break our contract, which is that any core Actions for a specific
version will be available to your external Action for as long as we support
that core version.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7184) Find actions bound to other versions of Faces.</title>
<updated>2011-07-22T20:29:29+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-21T23:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2cd3bc47993fbd32a77ca9dfdd51353f2dfbcb58'/>
<id>2cd3bc47993fbd32a77ca9dfdd51353f2dfbcb58</id>
<content type='text'>
When we first touch a Face, we load all the available Actions from disk.

Given they define themselves against a specific version of a Face, they are
automatically available tied to the correct version; this makes it trivially
possible to locate those on demand and return them.

Now, we have the ability to find and, consequently, invoke Actions on older
versions of Faces.  We don't load enough context, though: the older face will
only have external Actions defined, not anything core.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we first touch a Face, we load all the available Actions from disk.

Given they define themselves against a specific version of a Face, they are
automatically available tied to the correct version; this makes it trivially
possible to locate those on demand and return them.

Now, we have the ability to find and, consequently, invoke Actions on older
versions of Faces.  We don't load enough context, though: the older face will
only have external Actions defined, not anything core.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>#7211: more helpful error messages in various cases.</title>
<updated>2011-05-31T22:26:41+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-05-31T22:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=618495c7b70671ff1da1653c76d1524ff3f615b7'/>
<id>618495c7b70671ff1da1653c76d1524ff3f615b7</id>
<content type='text'>
We were emitting a bunch of unhelpful failure messages, surrounding invalid
actions and especially default actions interacting with the command-line.

This cleans those up, to give a helpful, informative, and correct message in
all cases.  Notably, we no longer report that there is no "default" action
when you specify an unknown action on a face.

This change revealed some other weaknesses in our unit tests, now correctly,
that result in slightly more robust code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were emitting a bunch of unhelpful failure messages, surrounding invalid
actions and especially default actions interacting with the command-line.

This cleans those up, to give a helpful, informative, and correct message in
all cases.  Notably, we no longer report that there is no "default" action
when you specify an unknown action on a face.

This change revealed some other weaknesses in our unit tests, now correctly,
that result in slightly more robust code.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7291) The 'script' version of actions needs options argument</title>
<updated>2011-05-16T22:13:48+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-05-13T23:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=615946619b7121ab724fac1a3d78b8f4072b867d'/>
<id>615946619b7121ab724fac1a3d78b8f4072b867d</id>
<content type='text'>
Ruby 1.9 is stricter about arity for for arguments passed as a block.  A
test case just hadn't been updated to take this into account for Face
scripts (a simpler form of action), which isn't surprising since script
isn't used anywhere in the code, which makes it a prime candidate for
removal as far as I'm concerned, but apparently Luke wants it in there.

Reviewed-by: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 1.9 is stricter about arity for for arguments passed as a block.  A
test case just hadn't been updated to take this into account for Face
scripts (a simpler form of action), which isn't surprising since script
isn't used anywhere in the code, which makes it a prime candidate for
removal as far as I'm concerned, but apparently Luke wants it in there.

Reviewed-by: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7329) Consistent naming for rendering formats and hooks.</title>
<updated>2011-05-03T23:09:51+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-05-02T23:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=18b3584e16515cfc45aeaa8d0913de8e8bcb3e95'/>
<id>18b3584e16515cfc45aeaa8d0913de8e8bcb3e95</id>
<content type='text'>
We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and
so forth; unqualified names.

On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except
the `:for_humans` and `:json` formats.  Which is kind of confusing because of
the internal inconsistency, and because it doesn't match the public name.

Fix the code to resolve both, so the `to_*` format still works, but we mostly
expect to use the `*` version, to match public expectation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and
so forth; unqualified names.

On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except
the `:for_humans` and `:json` formats.  Which is kind of confusing because of
the internal inconsistency, and because it doesn't match the public name.

Fix the code to resolve both, so the `to_*` format still works, but we mostly
expect to use the `*` version, to match public expectation.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7282) action without `when_invoked` should fail...</title>
<updated>2011-05-02T17:08:26+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-30T00:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da'/>
<id>b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da</id>
<content type='text'>
We used to let actions be declared without the `when_invoked` block, which was
usually a sign of either someone writing their method code direct in action
declaration, or someone forgetting to add their code at all.

This was just let silently by: the error only showed up when you finally tried
to invoke the action, and a NoMethod error was raised by the face.

...except for our own testing.  We took advantage of this a whole pile of
times in there; fixing the original UI issue means fixing all those too.

Reviewed-By: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We used to let actions be declared without the `when_invoked` block, which was
usually a sign of either someone writing their method code direct in action
declaration, or someone forgetting to add their code at all.

This was just let silently by: the error only showed up when you finally tried
to invoke the action, and a NoMethod error was raised by the face.

...except for our own testing.  We took advantage of this a whole pile of
times in there; fixing the original UI issue means fixing all those too.

Reviewed-By: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#6962) Add integration tests on Face documentation.</title>
<updated>2011-04-27T19:10:20+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-27T17:38:41+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=0256d67e1a51a37f2c87ec197bdff6ef3a6b269f'/>
<id>0256d67e1a51a37f2c87ec197bdff6ef3a6b269f</id>
<content type='text'>
We now run all the faces, and their actions, as well as global help through
the wringer in this test: this way we can be confident that we have, at least,
the ability to generate the help without a user-visible failure.

We also check that we have set copyright and license terms in our own faces.
Theoretically this might fail if the end user has extra faces on LOAD_PATH,
but my hope is that we won't hit that...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We now run all the faces, and their actions, as well as global help through
the wringer in this test: this way we can be confident that we have, at least,
the ability to generate the help without a user-visible failure.

We also check that we have set copyright and license terms in our own faces.
Theoretically this might fail if the end user has extra faces on LOAD_PATH,
but my hope is that we won't hit that...
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7157) Return a non-zero exit code on face failure.</title>
<updated>2011-04-22T22:39:06+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-22T18:53:30+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=f77304b703cbaaf5b46b974a0c80b73cece4a2aa'/>
<id>f77304b703cbaaf5b46b974a0c80b73cece4a2aa</id>
<content type='text'>
When a face or action fails we should exit non-zero on the CLI to signal this
to our caller.  "Fails" is defined as "raises an exception"; we don't treat
any return value as a significant failure.

Reviewed-By: Jesse Wolf &lt;jesse@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a face or action fails we should exit non-zero on the CLI to signal this
to our caller.  "Fails" is defined as "raises an exception"; we don't treat
any return value as a significant failure.

Reviewed-By: Jesse Wolf &lt;jesse@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'remotes/lak/tickets/next/7118-summaries_for_all_faces' into 2.7.x</title>
<updated>2011-04-21T23:33:59+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-21T23:33:59+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=3c22e770625f3cc788b0d138c8101e259a534736'/>
<id>3c22e770625f3cc788b0d138c8101e259a534736</id>
<content type='text'>
Fix conflicts due to version drift in:
	lib/puppet/face/certificate.rb
	lib/puppet/face/facts.rb
	lib/puppet/face/node.rb
	lib/puppet/face/secret_agent.rb
	spec/lib/puppet/face/basetest.rb
	spec/unit/face/help_spec.rb

Reviewed-By: Markus Roberts &lt;markus@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix conflicts due to version drift in:
	lib/puppet/face/certificate.rb
	lib/puppet/face/facts.rb
	lib/puppet/face/node.rb
	lib/puppet/face/secret_agent.rb
	spec/lib/puppet/face/basetest.rb
	spec/unit/face/help_spec.rb

Reviewed-By: Markus Roberts &lt;markus@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
