-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Extend webhook notifications with build status (queued, running, failed, succeeded) & commit id #2251
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
Comments
Both of these additions sound like features we should have. I think this stands to be a single ticket here. It should be simple enough to attribute the changeset that triggered the build. In order to trigger webhook notifications on extraneous functions, we would have to add more task triggers in the project build functions. Currently, the notifications are only triggered at the point that the project build failed. This is the function to call, however there should really be a wrapper task around this to send these additional notifications asynchronously: |
@agjohnson, I'd like to take this up! |
Great! If you need some more direction, I can update the description here a bit further. Let me know if you have questions on any implementation details, I'm happy to answer. |
Sorry about getting back so late! It would be of immense help if you can update the description further & give me a little direction on how to start. I've been going through the celery docs to familiarize myself with tasks. |
@agjohnson Could you help @shubheksha out here? She's trying to contribute for the first time and she would like you to give her some more specific guidance on this particular issue. E.g. is reading up on celery useful at all? What exactly did you mean by "there should really be a wrapper task around this"? (I wish I knew this code base better so I could answer that myself!) |
@agjohnson Are you too busy? I can work out a plan for @shubheksha if you're unavailable. |
Please do help!
|
Sorry all, this fell off my radar :( I can expand on some of what i laid out above, but @Korijn, more help would be always be welcome here as well! |
@shubheksha I updated the description with some more explicit information on how this would be implemented. Feel free to raise a question here if something doesn't make sense, I'm happy to provide more guidance. This will require some basic knowledge of Celery, but only enough to implement a |
Thank you, @Korijn & @gvanrossum. 😄 |
@shubheksha were you able to start working on this? are you still interested on this issue? Maybe we can take a look together. |
@Korijn There are only one calls of I think this issue should cover sending webhook notification all the time of the build, while its queyed, failed or successed. |
Has anyone made progresses on this? How can I help? I can develop this myself if you wish. I simply need someone to update the description. Apparently the notification process is already a task so I should just have to wire things in order to have notifications on build queue/startup/finish, right? I was thinking about making a Gitter integration for Read the Docs but I saw that there was only the failure notification. It would be really nice if we could implement this then we could have all build status appear in Gitter activity tab just like for Travis or others. [Edit] [Edit 02.11.2018] |
Has this issue gone stale? If not, I would like to work on it. |
Seems like nobody is working on this, I will start working on it. |
As @safwanrahman said |
Sounds good to me? Why don't you give it a try? There lies an additional challenge in supporting the build status APIs of github and bitbucket and the like. They require perhaps a different format (check their docs). |
While working on this I faced a design issue. |
Hi. Is this issue still open? |
Webhook build notifications currently trigger only on build failure. Also, the
commit_id
that was built is missing from the JSON object that is sent.If possible, I'd like to extend this feature to trigger on any build status transition:
Also, in order to integrate with e.g. Bitbucket/Github build status APIs, the
commit_id
should be included in the JSON object that is sent.Requirements
Webhooks are not currently set up as an asynchronous task, meaning sending these notifications will block the process. We should instead be executing these as Celery tasks. The function that currently sends these notifications is here:
https://github.com/rtfd/readthedocs.org/blob/712e75d30a92bbdcf3a2597dafc16c58897eeefc/readthedocs/projects/tasks.py#L776
This will require the following work items:
webhook_notification
should be changed to execute a task instead. This will require settingwebhook_notification
as a Celery task as well. This should only execute on theweb
task queue.webhook_notification
should add theBuild.commit
attribute to the data payloadHere is the actual build task:
https://github.com/rtfd/readthedocs.org/blob/712e75d30a92bbdcf3a2597dafc16c58897eeefc/readthedocs/projects/tasks.py#L105
Here is where builds currently send failure notifications:
https://github.com/rtfd/readthedocs.org/blob/712e75d30a92bbdcf3a2597dafc16c58897eeefc/readthedocs/projects/tasks.py#L185
Builds are triggered from:
https://github.com/rtfd/readthedocs.org/blob/f6603f40599fac810993989cffc55da82f19feeb/readthedocs/core/utils/__init__.py#L67
The text was updated successfully, but these errors were encountered: