| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can return a method bound to the current face instance when we access the
'when_rendering' hook, which allows us to directly call them. Make that
change, and add appropriate testing.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These define the API used by folks writing actions that supports their
rendering hooks. 'when_rendering' defines a helper method on the interface,
which runs the users code in their expected context.
'render_as' just sets the default rendering format; by default this is
:for_humans.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have some specific requirements around rendering, including the ability of
authors of actions to add nice, custom rendering. To support that we want
solid "basic" rendering for human-focused output.
This implements that generic rendering correctly and to spec, to give a sound
basis that we can build on for extensible rendering.
(#7013) better default rendering support for faces
We have some specific requirements around rendering, including the ability of
authors of actions to add nice, custom rendering. To support that we want
solid "basic" rendering for human-focused output.
This implements that generic rendering correctly and to spec, to give a sound
basis that we can build on for extensible rendering.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We tested that we could make something a default action, but we also want to
assert that we never accidentally make everything the default action.
Paired-With: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We used to skip printing if the return value from an action was false; this
made it impossible to display "false" to the user, which was a more meaningful
output in some cases than nothing.
maint: print 'false' in the default render method.
We used to skip printing if the return value from an action was false; this
made it impossible to display "false" to the user, which was a more meaningful
output in some cases than nothing.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This documentation has not been kept up to date with changes in the product,
since it originated way back in the prototype of interfaces.
Reviewed-By: Randall Hansen <randall@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We had a pending test for this, but forgot to write it way back when we were
implementing the feature. Add it now.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Right now we have no other support for multi-version loading in the code; we
should strip out support from the action loading to mirror.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This adds the 'description' method to the faces and actions, as well as
structured testing to ensure that the DSL works as expected.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Our summary documentation is used to provide single-line context to faces,
actions, and other items. To support this we hard-fail if someone tries to
use the summary to embed the long documentation, and point them to the right
place to add the extended text.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|\ \ \ \
| |_|/ /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Puppet kick's help referred only to the outdated authconfig (namespaceauth.conf) file, rather than
the modern rest_authconfig (auth.conf).
|
| | | |
| | | |
| | | |
| | | | |
--listen's description referred to the older XMLRPC authorization path.
|
|/ / / |
|
| | |
| | |
| | | |
Reviewed-By: Matt Robinson.
|
| | |
| | |
| | |
| | | |
Reviewed-By: Mike Stahnke
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
* ticket/2.7.x/7131-optional-arguments:
(#7131) Remove support for optional arguments to options
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As per the design decision documented in #7131, optional arguments to
options will no longer be supported. This patch causes such optional
arguments to raise an error, and tests for this behavior. Also cleaned
up some confusing use of the term "subject" in specs.
Paired-with: Daniel Pittman
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Running spec/unit/option_spec.rb before requiring puppet/interface
caused a circular require, and a failure.
Paired-With: Max Martin
|
|\ \ \
| | | |
| | | |
| | | | |
'bug/2.7.x/7013-interfaces-should-be-able-to-mark-options-as-required' into 2.7.x
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds another hook into the generated wrapper, which invokes a method to
validate arguments. This is used to raise an exception when required options
have not been passed to the method.
Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
|
| | |
| | |
| | | |
Reviewed-By: Daniel Pittman
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There were two times being used, and the previous fix only fixed one of them.
Reviewed-By: Jacob Helwig
|
|\| | |
| |/ /
|/| | |
|
|/ /
| |
| |
| |
| | |
This was breaking in other timezones because it was comparing to a string
literal representation of a time, which really varies between timezones.
|
|\ \
| | |
| | |
| | | |
'feature/2.7.x/6978-face-and-action-options-should-have-hooks-for-various-actions' into 2.7.x
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were generating the help output multiple times and testing it for multiple
properties; now we generate it once and test it multiple times. This makes
for less clear error reporting, but saving dozens of calls at ~ 1/3rd a second
each is worth it.
Paired-With: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We used to open-code terminus setting, which had a bunch of duplicate code.
Now, instead, we use the option hooks, resulting in the same behaviour with
much less code.
Paired-With: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We require that hooks take exactly three arguments; now we enforce that in the
DSL, to ensure we give good, and early, errors to users who do the wrong
thing.
Paired-With: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now that we support option hooks, we can use those to set the CA location
rather than open-coding each chunk of support. As a side benefit we also set
the CA location for inherited actions, as we should.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Options can now add before_action and after_action blocks; these are invoked
before or after any action is invoked on the face. This allows these options
to declare common behaviour and have it automatically applied to the actions
invoked.
Option hooks have no defined order of invocation: they will run in a
completely random order. Where there are dependencies they should be on the
value of the options hash passed to the invocation, not on side-effects of the
other invocations.
You are not able to influence the arguments, options, or calling of the action
body in a before or after decorator. This is by design.
The invocation passes to the hook:
1. The action object representing this action.
2. The arguments to the action, as an array.
3. The options for the action, as a hash.
Paired-With: Max Martin <max@puppetlabs.com>
|
| | |
| | |
| | |
| | | |
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
This also enables the 'help' action on the 'help'
face to serve as a default action.
Reviewed-By: Daniel Pittman
Reviewed-By: Nick Lewis
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
* tickets/2.7.x/7111-deprecation-warning-wordsmithing:
Cleanup trailing whitespace
(#7111) Clarify scoping deprecation warning
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
This modifies the deprecation warning to explicitly point out that the
specified behavior is deprecated, when it is slated to be removed,
along with what the user can do to prepare for its removal.
Paired-with: Randall Hansen <randall@puppetlabs.com>
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These make the JSON tests much easier to read and
write. They're the first custom matchers that I can
find, so they're breaking a bit of new ground,
but the JSON tests were pretty hard to read
and there was a lot of duplication, so it seemed
worth it.
Note that for some reason they're not working on
Facts - it seems to get immediately turned into
a full instance by the JSON parsing subsystem,
and I've no idea why.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | | |
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | | |
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were not correctly pulling request attributes out in all
cases, but now we do, which caused this test to start failing.
We special case the 'ip' attribute in the test now.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We'll be using this to do RPC over mcollective.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
They were currently failing if any values were nil,
which happened a lot.
We also prefer not to include nil values, since it muddies
the json unnecessarily.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It was unclear what the action was validating when no arguments were specified,
so now it notifies the user.
Paired-With: Jesse Wolfe
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
HEAD request support was implemented in 2.6.x, and the internal API in the HTTP
handler changed in 2.7.x. So when the branches were merged together, HEAD
requests ended up using the wrong API without any visible merge conflicts or
spec failures. This fixes them to use the correct API.
Reviewed-By: Matt Robinson
|