Code Monkey home page Code Monkey logo

Comments (11)

timabbott avatar timabbott commented on July 22, 2024

Opened #70 with some notes on how to add an integration if anyone's interested.

from zulip.

TomaszKolek avatar TomaszKolek commented on July 22, 2024

@timabbott
Here we should use webhooks instead of API .
API allows for the same actions like web interface but configuration the API (even if we make it easier) requires from user some technical skills. And its additional not needed maintenance of course

So I prefer using webhooks.
User did some checker in pingdom.com then add a hook that we handle.
This way does not require from the user doing the same configuration twice. And, what is the most important, user can use graphical interface of pingdom.

Small architecture question:
webhooks.py has more than 1000 lines. Quite a lot ;-)
What do you think about quick refactor?

webhooks:
    __init__.py
    common.py
    beanstalk.py
    github.py
    . (another)
    pingdom.py
    . (another)
    travis.py

In common.py we can have abstract class like

class WebhookHandlerAbstract(object):
    def handle():
     ....

In init we can have just simple functions like:

def api_benstal_webhook(...):
     BenstalkWebhookHandler().handle()

@timabbott Quick answer is welcome due to just 14 days trial of pingdom ;-)

from zulip.

timabbott avatar timabbott commented on July 22, 2024

Using webhooks here sounds good to me.

I agree that we will want to split webhooks.py into one-file-per-hook. If you choose to work on that, please write your changes in a way that's easy to review and carefully follow the Zulip commit guidelines http://zulip.readthedocs.org/en/latest/code-style.html#version-control

So for that refactor, I'd recommend first a commit moving webhooks.py to webhook/init.py, and then individual commits moving individual integrations out of the common file.

from zulip.

timabbott avatar timabbott commented on July 22, 2024

Also I would avoid combining the change to split out the files with a change to add a WebhookHandlerAbstract construct; it usually works best to avoid combining two totally different refactors into the same commit. (does this make sense?)

Also, at present there's little in common between the various webhooks, so I don't think there's a reason to create a WebhookHandlerAbstract class anyway.

from zulip.

TomaszKolek avatar TomaszKolek commented on July 22, 2024

WebhookHandlerAbstract is not good name/type - it's just an interface.

from zulip.

TomaszKolek avatar TomaszKolek commented on July 22, 2024

#513
Please take a look @timabbott

from zulip.

TomaszKolek avatar TomaszKolek commented on July 22, 2024

TomaszKolek#1

@timabbott
It's on my fork because I'm working on refactored webhooks version.
Please look if we've not missed our concepts.

from zulip.

timabbott avatar timabbott commented on July 22, 2024

Cool! That approach looks pretty good.

from zulip.

TomaszKolek avatar TomaszKolek commented on July 22, 2024

#537 - created, ready to review.

from zulip.

timabbott avatar timabbott commented on July 22, 2024

Merged in 44ed9da, thanks @TomaszKolek for building this!

from zulip.

timabbott avatar timabbott commented on July 22, 2024

FYI @zack-ahdach.

from zulip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.