-
Notifications
You must be signed in to change notification settings - Fork 438
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
Feature: add webhook notification capability #724
base: master
Are you sure you want to change the base?
Conversation
ping @posativ @ix5 @blatinier : any chance to see it merged or reviewed? |
Can't say much, but here are my thoughts:
|
Thanks for your feedback.
I did not know that but it's quite old (not sure it's still applicable) and it's a concern only when we format some secret no? If you prefer, we can switch to
Sure but it would be quite harder to handle different cases (HTTP warnings, redirections, etc...).
I will. |
Exclude .venv from flake8
Add webhook Fix string formatting Fix string formatting Make it compatible with Python 3.5 ?! Add default webhook section Clean up and docstrings Handle HTTP errors Add webhook template for Slack Add requests as dependency Remove unused var Complete post data without template Enable cache
It would be great if this had some unit tests. |
Sure! I did not write them because I can't find which tests framework is recommended. Can you tell me which one please? (pypi package name) |
We're using nosetests; you can invoke them with nose or by running "make test" |
Ok. What I need is the PyPi package to install it as testing dependency in a virtual env (I don't want to install something widely on my system). I can't find noestests on pypi.org but I've found 2 nose* packages: this one https://pypi.org/project/nose/ or this one https://pypi.org/project/nose2/? |
I think the pypi name is just "nose", but you should also be able to just use python's standard unittest framework to run the tests - we don't use anything nose-specific. |
Good news because running make test returns an error (Ubuntu 20.04, after make init with node 14): :~/Git/External/isso$ make test
python3 setup.py nosetests
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'nosetests'
make: *** [Makefile:71 : test] Erreur 1 Thanks for your help. I'll try to write some unit tests with the standard lib. |
|
I & @mskian ended up creating this - https://github.com/mskian/isso-telegram-notifier |
Nice work! Why not develop it right into Isso? |
If this was added to mainline isso, it would be hard to make sure that it kept working - the maintainers can't test with lots of different configurations. |
Nice work! I have not verified the functionality myself, but the code looks neat. Please add (unit) tests as requested by @jelmer |
# webhook URL | ||
url = | ||
|
||
# path to the JSON template. Optional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can users supply an absolute or relative path here? Please state so clearly.
def setUp(self): | ||
self.path = tempfile.NamedTemporaryFile().name | ||
|
||
def makeClient(self, ip): | ||
|
||
conf = config.load(pkg_resources.resource_filename('isso', 'defaults.ini')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't include these unrelated formatting changes - they make the PR harder to review.
@Guts this is a great feature, would you mind rebasing and addressing the points raised by jelmer and myself? |
It'll be great to have this feature. It'll enable me to trigger a build of my static website in which I render the Isso comments at build time. |
I propose here to add the possibility to send a notification to a web hook for each new comment.
Notable changes
Questions
Misc