StackStorm/st2 — pull request #927 by Kami (2014-12-21 00:16:45+00:00)
Title: Fix sensor registration and webhook trigger registration

This fixes sensor registration and webhook trigger registration (which appears never worked).

Here is a context on this bug - https://gist.github.com/Kami/7fd428765fe516673880

I'm too tired now to recap it in a more "friendly" and "readable" manner, but I will do it tomorrow.

P.S. #1 The change which introduced a bug didn't just broke registration, it also changed the behavior. Previously trigger information in the DB was updated every time the registration code was called. With the new / broken code, DB models were never updated, just created.

P.S. #2 We need tests for sensor / action / rules registration and for webhook trigger type registration.

P.S. #3 I mostly reverted to the old way of doing it. In the future, I will probably update `services.triggers` methods to also update a model if it already exists in the DB, but before doing that, I want full test coverage for those code paths. Last thing we want is another regression.