Commit graph

120 commits

Author SHA1 Message Date
Paul Beckingham
0a62061ca8 L10N
- Localized the new strings in Hooks.cpp.
2015-02-15 02:03:24 -05:00
Paul Beckingham
5a060802e7 Hooks
- It is now an error for a failing hook script to fail to also generate some
  feedback.
- Updated NEWS file to mention stricter hook script controls.
2015-02-14 18:16:32 -05:00
Paul Beckingham
adac566665 Unit Tests
- Corrected expected output from the on-modify-misbehave4 test hook script.
- Moved JSON syntax error details to debug output.
2015-02-14 17:50:28 -05:00
Paul Beckingham
a2e980c6b8 Hooks
- Deferred JSON checking until after we know whether the hooks voluntarily
  failed the event.
2015-02-14 17:33:48 -05:00
Paul Beckingham
e00704a375 Hooks
- Cleaned up logic for crude JSON detection.
2015-02-14 17:31:37 -05:00
Paul Beckingham
8fb3161a02 Hooks
- Modified expected output from an on-modify hooks script, because it's 1 line
  of JSON, not 2.
2015-02-14 17:19:44 -05:00
Paul Beckingham
c5a2b7f759 Unit Tests
- Fixed exected error for on-add-misbehave5. This highlights a potential
  error in the test suite with the one failing test.
2015-02-14 17:03:43 -05:00
Paul Beckingham
bd785ffad5 Hooks
- Added a new on-launch-misbehave2 script that emits unexpected JSON.
2015-02-14 16:14:20 -05:00
Paul Beckingham
3cce6c23f5 Hooks
- Hooks now verify the expected number of JSON lines emitted by hook scripts.
2015-02-14 15:50:51 -05:00
Paul Beckingham
1cfdfbae52 Hooks
- Removed the ability for hooks to add tasks, or modify tasks that are outside
  the context of the current event. This makes hooks a local mechanism that
  operates only on local changes. Modifications/additions coming in via sync
  command are not processed by hooks.
2015-01-31 17:47:58 -05:00
Paul Beckingham
4865269630 Hooks
- Modified loop so it no longer walks the whole list unnecessarily.
- Minor style tweaks.
2015-01-25 10:33:03 -05:00
Tomas Babej
8683574b18 Hooks: Make sure that original task is properly detected
On modify event uses UUID of the original task being modified
to determine which line should be interpreted as modification
of the task.

This was achieved by searching by a substring in a specific JSON
format, which, consenquently, failed on JSON strings of other (valid)
formats.
2015-01-25 10:28:04 -05:00
Tomas Babej
654159b2fd Hooks: Add per-hook time measurement 2015-01-19 16:07:34 -05:00
Tomas Babej
6fdf0738a7 Hooks: Improve debugging messages for on-exit hooks 2015-01-18 13:27:32 -05:00
Paul Beckingham
411fab3a27 Hooks
- Added debug output on startup, if a hook script is found and does not have
  a valid name.
2015-01-07 22:54:55 -05:00
Paul Beckingham
b7ad091d00 Updated copyright to 2015 2015-01-01 00:00:41 -05:00
Paul Beckingham
d9222606e7 Hooks
- The on-exit hook can now terminate processing.
2014-10-19 01:47:33 -04:00
Paul Beckingham
7895ea0f42 Hooks
- Added safety measure in case of a hook misfire.
- Made debug output consistent.
2014-10-19 01:32:41 -04:00
Paul Beckingham
7e2582f2b8 Hooks
- Fixed bug where the identifier "on-modify" contained some bogus UTF8.
- Ensured that every input line has a \n.
2014-10-19 00:57:30 -04:00
Paul Beckingham
719e9d242b Hooks
- Bug due to missing reference & in calls to callHookScript.  Dumbass.
2014-10-18 23:59:40 -04:00
Paul Beckingham
f1639e6862 Hooks
- Revised all event functions to use the new callHookScript method, which is
  now common to all events.
2014-10-18 23:47:32 -04:00
Paul Beckingham
d1f6b36ecf Hooks
- Standardized formatting of hook input and output in debug.hooks mode.
2014-10-18 17:26:20 -04:00
Paul Beckingham
8d75d0c7f3 Hooks
- Reduced validation to simply checking that a description attribute is present.
  This is the bare minimum for the Task(const std::string&) contructor.
2014-10-18 17:23:39 -04:00
Paul Beckingham
21bbedbfc5 Hooks
- Now performs a full JSON parse on hook script output before accepting it as a
  task.
2014-10-18 16:59:46 -04:00
Paul Beckingham
b6be1cdc99 Hooks
- Factored out the code that determines if the JSON output from a hook script is
  actually JSON.
2014-10-18 16:55:26 -04:00
Wilhelm Schuermann
ae9705561c Hooks
- Throw exception instead of segfaulting for on-add hooks not adhering to the specs. More work needed.
2014-10-14 15:58:24 -04:00
Paul Beckingham
7521dc56e8 Hooks
- Supports 'debug.hooks' configuration setting.
2014-10-06 23:04:44 -04:00
Paul Beckingham
5b7e6df00b Util
- The execute() function needed to fill the STDIN pipe before the fork, not
  after the fork, so the data is ready before the child process reads.
2014-09-14 17:43:19 -04:00
Paul Beckingham
bfc6e38851 Hooks
- ::onExit now provides a set of all changeѕ tasks to the hook script, in
  read-only form.
2014-09-14 17:04:12 -04:00
Paul Beckingham
8be6c589da Hooks
- Implemented new interface.  Testing time.
2014-09-14 15:55:22 -04:00
Paul Beckingham
ab72cdad4d Hooks
- Stubbed new ::onAdd and ::onModify interfaces.
2014-09-14 15:42:47 -04:00
Paul Beckingham
7e35508bb4 Hooks
- Added a run-time enable/disable control, for nested add/modify calls.
2014-09-09 23:36:45 -04:00
Paul Beckingham
78650ac8c3 Hooks
- Added a master control, rc.hooks, which defaults to 'on', but can be used
  to disable hook processing in general.
2014-09-08 01:22:35 -04:00
Paul Beckingham
6dff1f36bf Hooks
- Added notes regarding the use of 'first', which may be problematic.
2014-09-08 00:01:54 -04:00
Paul Beckingham
5ce317bb48 Hooks
- Modified ::onExit to remove the indicator that data was modified. This is not
  supported.
2014-09-07 22:56:28 -04:00
Paul Beckingham
a9cf61c1d1 Hooks
- Removed code supporting data modification during the on-exit event.
- Fixed hook script interface descriptions.
2014-09-07 22:44:03 -04:00
Paul Beckingham
60260fb813 Hooks
- Removed obsolete ::execute method, instead relying on the util.cpp variant.
2014-08-30 23:53:59 -04:00
Paul Beckingham
273d9fe070 Hooks
- Code cleanup.
2014-08-30 23:29:30 -04:00
Paul Beckingham
4ef189d7b6 Hooks
- ::onExit now indicates whether changes were made.
2014-08-09 21:06:16 -04:00
Paul Beckingham
9996e5adef Hooks
- Correct handling for JSON and non-JSON output.
2014-08-09 20:19:02 -04:00
Paul Beckingham
2ea9b8786e Hooks
- It is safe to call free() with a null pointer.
2014-08-07 07:51:22 -04:00
Paul Beckingham
f2a545bc25 Hooks
- First pass at a portable 'popen' implementation.  Thanks to Wim.
2014-07-01 20:02:27 -04:00
Paul Beckingham
9f6e37fa06 Portability
- Reordered includes to allow build on FreeBSD (thanks to Pietro Cerutti).
2014-05-30 15:25:34 -04:00
Paul Beckingham
5baa999459 Build
- Added missing define for FreeBSD.
2014-05-29 20:21:34 -04:00
Paul Beckingham
5513a0c843 Hooks
- Updated method comments.
2014-05-18 16:10:36 -04:00
Paul Beckingham
0ffc95e312 Hooks
- Added Hooks::list method to provide a list of known hooks.
2014-05-17 14:20:46 -04:00
Paul Beckingham
9248f1569f Hooks
- Corrected check for trivial input.
2014-05-14 22:47:12 -04:00
Paul Beckingham
d70c8eef5c Hooks
- ::onLaunch now conforms to design.
2014-05-14 22:39:56 -04:00
Paul Beckingham
3010ac667b Hooks
- ::onAdd now conforms to design.
2014-05-14 22:39:35 -04:00
Paul Beckingham
0d2bc00527 Hooks
- ::onExit now comforms to design.
2014-05-14 22:10:40 -04:00