New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hooks #4

Open
zorbash opened this Issue Nov 8, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@zorbash
Member

zorbash commented Nov 8, 2016

Currently one can update a widget either using a job or HTTP POST to /widgets/:id.

We could also allow settings hooks for easier integration with external services.

Example usage with GitHub webhooks:

# File: hooks/github.exs

hook :github_issues do
  issue = body |> Poison.decode!

  # Other, heavier processing can be added here
 
  broadcast! :github_issues, 
             %{user: issue |> get_in(["sender", "login"]), 
               title: issue |> get_in(["issue", "title"])}
end 

Kitto with the above hook definition would pass the request context and handling of POST /hooks/github_issues to the code in the hook.

@zorbash zorbash added this to the 0.3.0 milestone Nov 8, 2016

@zorbash zorbash removed this from the 0.3.0 milestone Nov 16, 2016

@davejlong

This comment has been minimized.

Show comment
Hide comment
@davejlong

davejlong Nov 16, 2016

Member

Had this thought from #21. When building out hooks there should be a general hook where any service can POST to /hooks/some_hook which will broadcast whatever the POST body as some_hook. Totally configureless so someone can build out a real time dashboard based on webhooks without writing a single line of Elixir.

Member

davejlong commented Nov 16, 2016

Had this thought from #21. When building out hooks there should be a general hook where any service can POST to /hooks/some_hook which will broadcast whatever the POST body as some_hook. Totally configureless so someone can build out a real time dashboard based on webhooks without writing a single line of Elixir.

@zorbash

This comment has been minimized.

Show comment
Hide comment
@zorbash

zorbash Nov 16, 2016

Member

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?

Member

zorbash commented Nov 16, 2016

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?

@davejlong

This comment has been minimized.

Show comment
Hide comment
@davejlong

davejlong Nov 16, 2016

Member

In building this out I would probably look to bring POST /widgets/:id
into the hooks. Implementation. The current implementation requires the
hook to post a specific format. The hook implementation would flip it to
enforce the widget to take in the data specific to the metric.

On Wed, Nov 16, 2016, 4:23 PM Dimitrios Zorbas notifications@github.com
wrote:

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKs1WYTbx8y0QBVitzhLwlhL645Uf9uks5q-3RkgaJpZM4Ksqc_
.

Member

davejlong commented Nov 16, 2016

In building this out I would probably look to bring POST /widgets/:id
into the hooks. Implementation. The current implementation requires the
hook to post a specific format. The hook implementation would flip it to
enforce the widget to take in the data specific to the metric.

On Wed, Nov 16, 2016, 4:23 PM Dimitrios Zorbas notifications@github.com
wrote:

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKs1WYTbx8y0QBVitzhLwlhL645Uf9uks5q-3RkgaJpZM4Ksqc_
.

@zorbash

This comment has been minimized.

Show comment
Hide comment
@zorbash

zorbash Nov 16, 2016

Member

Oh i see, one can though even now create a dashboard only using POST /widgets/:id and not a single elixir job.

Member

zorbash commented Nov 16, 2016

Oh i see, one can though even now create a dashboard only using POST /widgets/:id and not a single elixir job.

@davejlong davejlong referenced this issue Nov 18, 2016

Closed

Implements hooks support #25

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment