<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/spec/unit/interface, 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>(#8690) Accept 'global' options in Puppet Faces</title>
<updated>2011-07-28T22:20:54+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-28T22:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=023d9597b9895f57fda05dc79adad41684179eb2'/>
<id>023d9597b9895f57fda05dc79adad41684179eb2</id>
<content type='text'>
When we introduced verification of options, we forgot to handle the case that
global options from the Puppet settings system could be passed to the face.
This, in turn, means that the system would fail if you used any of those.

This remediates that, and now these work as expected.

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 introduced verification of options, we forgot to handle the case that
global options from the Puppet settings system could be passed to the face.
This, in turn, means that the system would fail if you used any of those.

This remediates that, and now these work as expected.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#8561, #7290) Implement the option contract fully.</title>
<updated>2011-07-22T23:27:17+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-22T22:15:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=82e5fa9561e2d4cb1d699a41c14f50953d8f2d97'/>
<id>82e5fa9561e2d4cb1d699a41c14f50953d8f2d97</id>
<content type='text'>
Rewrite the process of validating and updating the options to fully reflect
the contract - we fail if there are unknown options passed, report nicely
errors of duplicate names, pass only the canonical names to the action code,
and generally enforce nicely.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rewrite the process of validating and updating the options to fully reflect
the contract - we fail if there are unknown options passed, report nicely
errors of duplicate names, pass only the canonical names to the action code,
and generally enforce nicely.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#8561) Unify validation and modification of action arguments.</title>
<updated>2011-07-22T23:27:13+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-22T21:32:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=77441be2299bbb96ab9f048855b0fd4c16eb7b5a'/>
<id>77441be2299bbb96ab9f048855b0fd4c16eb7b5a</id>
<content type='text'>
Rather than having multiple, separate operations that modify and validate the
arguments to an action, a single pass makes sense.  This also means less walks
across the set of data, and a few less expensive method calls in Ruby.

Additionally, we work on a duplicate of the arguments hash rather than
directly modifying the original.  Because everything we do is at the top level
key/value mapping, this is sufficient to isolate the original.

While mostly theoretical, we now don't mutilate the hash passed in, so the
user won't get nastily surprised by the fact that we could have done so.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than having multiple, separate operations that modify and validate the
arguments to an action, a single pass makes sense.  This also means less walks
across the set of data, and a few less expensive method calls in Ruby.

Additionally, we work on a duplicate of the arguments hash rather than
directly modifying the original.  Because everything we do is at the top level
key/value mapping, this is sufficient to isolate the original.

While mostly theoretical, we now don't mutilate the hash passed in, so the
user won't get nastily surprised by the fact that we could have done so.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7290) Fail on unknown options.</title>
<updated>2011-07-22T23:27:08+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-22T21:13:50+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=69b4e70ac2fa2b265f6c92d7de073d51ae25d3ed'/>
<id>69b4e70ac2fa2b265f6c92d7de073d51ae25d3ed</id>
<content type='text'>
Part of the "social contract" of Faces, Actions and Options is that the
metadata we collect is authoritative: it covers everything that is possible.

In the initial release we didn't enforce that around options.  If you passed
an unknown option in the hash, we just silently ignored it in validation and
made it available down in the action.

Now, instead, we enforce that rule.  If you pass an unknown option we raise an
error and complain; anything that gets to the action will be listed in the set
of inspectable options.

Cases that depended on this behaviour to pass arbitrary content in the hash
should be rewritten to move that content down a level: take a hash value for
one option, and use that for your free content.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of the "social contract" of Faces, Actions and Options is that the
metadata we collect is authoritative: it covers everything that is possible.

In the initial release we didn't enforce that around options.  If you passed
an unknown option in the hash, we just silently ignored it in validation and
made it available down in the action.

Now, instead, we enforce that rule.  If you pass an unknown option we raise an
error and complain; anything that gets to the action will be listed in the set
of inspectable options.

Cases that depended on this behaviour to pass arbitrary content in the hash
should be rewritten to move that content down a level: take a hash value for
one option, and use that for your free content.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#8561) Use canonical names for options to actions.</title>
<updated>2011-07-22T23:26:20+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-22T21:11:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=6bec2df0860b71730b99ddd9f1764aa2ce0dc960'/>
<id>6bec2df0860b71730b99ddd9f1764aa2ce0dc960</id>
<content type='text'>
When we invoke an action, we parse a set of options.  These have a canonical
name, and optionally a set of aliases.  For example, :bar might have :b as an
alias to allow a short name to be given.

Previously we would just pass this on as received; if you passed :bar you got
:bar, and if you passed :b you got :b.  This works, but means that every
action has to write the same code to extract the appropriate version of an
option from whatever set of aliases might be passed.

Now, instead, we centralize that and always pass options as their canonical
name to the action code.  This makes it simpler to work with.  (This happens
before any validation, or other user-supplied, code to simplify everything
that handles options.)

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 invoke an action, we parse a set of options.  These have a canonical
name, and optionally a set of aliases.  For example, :bar might have :b as an
alias to allow a short name to be given.

Previously we would just pass this on as received; if you passed :bar you got
:bar, and if you passed :b you got :b.  This works, but means that every
action has to write the same code to extract the appropriate version of an
option from whatever set of aliases might be passed.

Now, instead, we centralize that and always pass options as their canonical
name to the action code.  This makes it simpler to work with.  (This happens
before any validation, or other user-supplied, code to simplify everything
that handles options.)

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</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>(#7123) Support runtime setting of 'default' on actions.</title>
<updated>2011-07-21T00:07:10+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-20T19:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=fd6a653cb32cb03e339655862c526fd5dccbfcf0'/>
<id>fd6a653cb32cb03e339655862c526fd5dccbfcf0</id>
<content type='text'>
Given the inheritance model for actions, we are sometimes going to need to set
them to 'default' at runtime, rather than during their static declaration.

Add tests to verify that this works correctly, and update the code to ensure
that happens.  This gives up caching of the default action, but this should be
an extremely rare operation - pretty much only CLI invocation, really.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Given the inheritance model for actions, we are sometimes going to need to set
them to 'default' at runtime, rather than during their static declaration.

Add tests to verify that this works correctly, and update the code to ensure
that happens.  This gives up caching of the default action, but this should be
an extremely rare operation - pretty much only CLI invocation, really.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#6787) Add `default_to` for options.</title>
<updated>2011-07-21T00:06:34+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-20T18:58:55+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=b75b1c19ecf6c278b065d203ac8486fa598caa8b'/>
<id>b75b1c19ecf6c278b065d203ac8486fa598caa8b</id>
<content type='text'>
This implement support for options with default values, allowing faces to set
those values when not invoked.  This can eliminate substantial duplicate code
from actions, especially when there are face-level options in use.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implement support for options with default values, allowing faces to set
those values when not invoked.  This can eliminate substantial duplicate code
from actions, especially when there are face-level options in use.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7204) Consolidate Semantic Versioning code.</title>
<updated>2011-07-19T17:55:58+00:00</updated>
<author>
<name>Pieter van de Bruggen</name>
<email>pieter@puppetlabs.com</email>
</author>
<published>2011-07-19T17:55:26+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=72abe6ce7192bba0b295a8a83483668d21050624'/>
<id>72abe6ce7192bba0b295a8a83483668d21050624</id>
<content type='text'>
This introduces a class representing a semantic version, and
implementing a few of the most common uses of them: validation,
comparison, and finding the greatest available version matching
a range.  This refactoring also allows us to easily expand our
matching of version ranges in the future, which is a big plus.

Reviewed-By: Daniel Pittman
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This introduces a class representing a semantic version, and
implementing a few of the most common uses of them: validation,
comparison, and finding the greatest available version matching
a range.  This refactoring also allows us to easily expand our
matching of version ranges in the future, which is a big plus.

Reviewed-By: Daniel Pittman
</pre>
</div>
</content>
</entry>
</feed>
