sprintly/sprint.ly-services — pull request #20 by joestump (2014-09-28 05:08:47+00:00)
Title: Create a decorator to control which models/actions are sent to which services

#### What's this PR do?

Creates a decorator called `listen_to` that takes arguments like `Item.created` or `Item.*` or `*.created`. A new payload format will include `action` (the default is `created` so this PR is backwards compatible). This allows service authors to control which events their service gets.

For backwards compatibility all services _except_ webhook only get `*.created` events. Webhooks will receive all events for all models (`*.created`, `*.deleted`, and `*.updated`) once the new payload format is deployed.

#### Where should the reviewer start?

With `lookout.decorators.listen_to`.

#### How should this be manually tested?

You can run the tests or try it locally.

#### Any background context you want to provide?

This feature [has been requested](http://help.sprint.ly/forums/166406-ideas/suggestions/6171819-finish-your-webhook-implementation) by customers.

#### What are the relevant tickets?

n/a

#### Screenshots (if appropriate)

n/a

#### What gif best describes this PR or how it makes you feel?

![](http://media.giphy.com/media/F91EvIQfKuN0I/giphy.gif)

#### Definition of Done:
- [ ] Is there appropriate test coverage? (e.g. ChefSpec, Mocha/Chai, Python, etc.)
- [ ] Does this PR require a Selenium test? (e.g. Browser-specific bugs or complicated UI bugs)
- [ ] Does this PR require a regression test? All fixes require a regression test.
- [ ] Does this PR require a blog post? If so, ensure marketing has signed off on content.
- [ ] Does the [knowledge base](https://sprint.ly/docs) need to be updated?
- [ ] Does this add new dependencies? If so, does Chef, M4, or PIP requirements need to be updated?
- [ ] Will this feature require a new piece of infrastructure be implemented?
- [ ] Are any new services fully automated in Chef?
- [ ] Are there ChefSpec tests for the new Chef recipes/cookbooks?
- [ ] Does this PR require new Mixpanel or GA events?
- [ ] Is there appropriate logging included?