40 Commits

Author SHA1 Message Date
Chris Roberts
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Chris Roberts
bcbbc825e0 Add test coverage on builder 2020-03-24 17:15:41 -07:00
Chris Roberts
d08c68ecf3 Adjust how trigger actions are inserted into the stack
This adjusts how triggers are implemented during a normal run. Any
defined triggers which are applicable are located and injected into
the run stack as the stack is built, including hook type triggers.

Support is included for dynamic hook lookup.

The data type used when defining triggers has also been relaxed to
support symbols, strings, or constants.
2020-03-17 15:07:36 -07:00
Chris Roberts
98f0ec6ab7 Dynamically apply hooks to actions prior to execution
Removes dynamic calls of before/after hooks and replaces it with
proper lookups for hooks defined for the action to run. If hooks
are found for an action, the action is placed in a new builder
and the hooks are applied. The new stack is extracted, finalized,
and then executed.
2020-03-03 16:23:31 -08:00
Chris Roberts
80c05460ab Call hooks before and after each action if they are available 2019-12-18 13:11:30 -08:00
Brian Cain
ee985f9f7f
Fix typo in UI Prefix for trigger UI 2019-03-21 10:11:38 -07:00
Brian Cain
08214ec90f
Ensure action param is a symbol, and if nil return to do nothing 2019-02-01 13:34:15 -08:00
Brian Cain
6ac23f1a15
Add fire trigger test for cli class 2019-02-01 13:34:15 -08:00
Brian Cain
071d8b09cd
Add machine for hook and action triggers 2019-02-01 13:34:15 -08:00
Brian Cain
5e4850a0d2
Use name instead of class 2019-02-01 13:34:15 -08:00
Brian Cain
ae0960f2da
Add comment to wardens finalize_action method 2019-02-01 13:34:15 -08:00
Brian Cain
fefb702359
Introduce type and command triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Mitchell Hashimoto
5054ae95fd core: log when OUT actions are called in middleware 2013-09-15 17:18:34 -07:00
Mitchell Hashimoto
80a7c8a0cb Hook class 2013-02-06 14:21:31 -08:00
Mitchell Hashimoto
50d7b0aba4 Fix bug where Call didn't propagate recovery. Warden has no recovery.
The issue here is that when a middleware failed and a recovery sequence
started, it would halt at the "call" step because the "Call" didn't
properly recover the child sequence.

An additional issue was that a Warden had no "recover" method, meaning
embedded Wardens wouldn't recover their stacks properly.
2012-12-23 16:29:25 -08:00
Mitchell Hashimoto
e16010041a Warden only logs an error once 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
0887a18079 Make some fixes to get tests passing on Ruby 1.8.7 2011-12-26 17:45:55 -08:00
Mitchell Hashimoto
3cd262ed75 Unit tests for Vagrant::Action::Builder 2011-12-22 20:17:45 -08:00
Mitchell Hashimoto
b878f1bd66 class => module Action 2011-12-09 17:23:27 -08:00
Mitchell Hashimoto
e4c0a0bf0a Convert warden to use log4r 2011-12-01 21:56:56 -08:00
Mitchell Hashimoto
907c3b318a Logging of vagrant, action running, and warden 2011-07-10 16:48:00 -07:00
Mitchell Hashimoto
7c7f5d48fe Don't need to call ".new" on raising exceptions 2010-12-21 20:04:21 -08:00
Brian P O'Rourke
4e2472befc Typo fixes for docs 2010-12-14 22:06:15 -08:00
Mitchell Hashimoto
cf823cadb5 Action warden doesn't do recovery process on SystemExit exceptions, allowing double ctrl-C to work properly again. 2010-10-01 10:08:38 -07:00
Mitchell Hashimoto
2e3be3789e More documentation and fixed some YARD warnings 2010-09-23 09:53:18 -07:00
Mitchell Hashimoto
7c42300002 Expose the exception which triggers recovery methods through the "vagrant.error" environmental hash 2010-09-13 23:43:37 -06:00
Mitchell Hashimoto
0094f066ca Warden properly handles interrupts 2010-09-01 16:15:24 -07:00
Mitchell Hashimoto
71101c9d3d Raise interrupt error earlier so the rescue chain actually gets called 2010-09-01 14:58:22 -07:00
Mitchell Hashimoto
f00955dfa1 Remove superfluous util module includes 2010-09-01 14:52:44 -07:00
Mitchell Hashimoto
60c20565b2 Replace straight abort on interrupt with clean exit via exception 2010-09-01 14:50:15 -07:00
Mitchell Hashimoto
ccc45ebd7a Begin moving from error_and_exit to exceptions. Fail hard! 2010-08-28 12:23:40 -07:00
Mitchell Hashimoto
354a82a177 Make some minor changes to warden to reduce the array reversals 2010-08-28 00:00:21 -07:00
John Bender
c519f14626 moved rescue to recover 2010-08-22 00:08:54 -07:00
John Bender
36f0eb8feb rescue upgraded to handle return values or calls with env errors. added error and exit call/interupt handling 2010-08-22 00:08:54 -07:00
John Bender
4e732631d8 tests for begin rescue 2010-08-22 00:08:54 -07:00
John Bender
b251d9b954 begin rescue added 2010-08-22 00:08:54 -07:00
John Bender
114511742e tests added for basic warden call forwarding 2010-08-22 00:08:54 -07:00
John Bender
2c1da9566c first pass at the action warden, currently just reproducing basic rack functionality 2010-08-22 00:08:54 -07:00