Adding webhooks and webhook invocation to RB-Gateway
Review Request #9402 — Created Nov. 26, 2017 and discarded
Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
Webhooks can now be registered into config.json. Functions to register webhooks into the config and saving of the config have been implemented but have not yet been hooked up into routes.go.
Webhooks can be invoked by calling a send-webhook command of rb-gateway while passing appropriate data. Currently only post-commit events are supported.
A sample hookscript for invoking rb-gateway webhooks for git repository post-commit events has been included.
Currently there are no automated tests for testing the new features but they are testable by running the sample git post-commit hookscript:
First, configure the config.json appropriately using the sample_config.json as a base. for the sample webhook Configuration url, you can use https://requestb.in/ as a receiving url. Try running rb-gateway to makesure config.json is parsed correctly.
Second, configure the sample hookscript: "sample_Git_post-commit_hookscript.sh". Make sure the repo name field and path to rb-gateway is correct and that the file is executable. You can test out the webhook invocation simply by running the script or installing it into your repository. It won't do anything if your repo has no commits yet. This testing method only works for git repos for now unless you modify the hookscript to be compatible with other scms.
Description | From | Last Updated |
---|---|---|
Payload is laid out in nice columns, but Commit and Webhook aren't. This might be because your text editor is … |
RC rcreagha | |
The trailing whitespace should be removed from this line. |
RC rcreagha |
- Commit:
-
9dc0ba5a340982d3311f5f73c04da0aafddcc9c874564835bb6c50d2f252e7aed87fdc7d4ff0a123
- Diff:
-
Revision 2 (+109)
Checks run (2 succeeded)
- Change Summary:
-
- rb-gateway post-commit webhooks are now Invokable
- Added in command line flags to send hook data to rb-gateway to invoke appropriately registered post-commit webhooks.
- Added in basic webhook validation and webhook registration.
- Refactored and added to util.go to allow saving of config.json.
- Commit:
-
74564835bb6c50d2f252e7aed87fdc7d4ff0a12329e24c41823bb50f7f1140b81dd6f2db6bc44d3c
- Diff:
-
Revision 3 (+288 -19)
Checks run (2 succeeded)
- Change Summary:
-
deleted some white space
- Commit:
-
29e24c41823bb50f7f1140b81dd6f2db6bc44d3c7ff7a8e41d7395c5623261da37653ed30dfc4306
- Diff:
-
Revision 4 (+288 -19)
Checks run (2 succeeded)
- Description:
-
~ [WIP] adding in webhook struct in webhook.go and adding in the functions for invoking a webhook
~ [WIP] Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
+ + Webhooks can now be registered into config.json. Functions to register webhooks into the config and saving of the config have been implemented but have not yet been hooked up into routes.go.
+ + Webhooks can be invoked by calling a send-webhook command of rb-gateway while passing appropriate data. Currently only post-commit events are supported.
- Testing Done:
-
+ Currently there are no automated tests for testing the new features but they are testable by running the sample git post-commit hookscript:
+ First, configure the config.json appropriately using the sample_config.json as a base. for the sample webhook Configuration url, you can use https://requestb.in/ as a receiving url. Try running rb-gateway to makesure config.json is parsed correctly. + Second, configure the sample hookscript: "sample_Git_post-commit_hookscript.sh". Make sure the repo name field and path to rb-gateway is correct and that the file is executable. You can test out the webhook invokation simply by running the script or installing it into your repository. It won't do anything if your repo has no commits yet. This testing method only works for git repos for now unless you modify the hookscript to be compatible with other scms. - Commit:
-
7ff7a8e41d7395c5623261da37653ed30dfc4306053d4d21c7cb42e519aee55a21d834eeb5638728
Checks run (2 succeeded)
- Description:
-
[WIP] Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
Webhooks can now be registered into config.json. Functions to register webhooks into the config and saving of the config have been implemented but have not yet been hooked up into routes.go.
Webhooks can be invoked by calling a send-webhook command of rb-gateway while passing appropriate data. Currently only post-commit events are supported.
+ + A sample hookscript to for invoking rb-gateway webhooks for git repository post-commit events has been included.
- Description:
-
[WIP] Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
Webhooks can now be registered into config.json. Functions to register webhooks into the config and saving of the config have been implemented but have not yet been hooked up into routes.go.
Webhooks can be invoked by calling a send-webhook command of rb-gateway while passing appropriate data. Currently only post-commit events are supported.
~ A sample hookscript to for invoking rb-gateway webhooks for git repository post-commit events has been included.
~ A sample hookscript for invoking rb-gateway webhooks for git repository post-commit events has been included.
- Change Summary:
-
Changed the config file path to come from path of rb-gateway because it used to assume the config file was in the same folder as the caller of rb-gateway. This was a problem when hookscripts in a different folder attempted to call rb-gateway.
- Commit:
-
053d4d21c7cb42e519aee55a21d834eeb5638728ccd88222c4b2a2513830c44c34336461a2fca442
Checks run (2 succeeded)
- Summary:
-
[WIP] Adding Webhooks to RB-GatewayAdding webhooks and webhook invocation to RB-Gateway
- Description:
-
~ [WIP] Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
~ Adding the ability to register and invoke webhooks to RB-Gateway will allow the service to notify a url of repository events. Currently this project involves adding code to rb-gateway for configuring and invoking webhooks and adding in a rb-gateway command to invoke webhooks and integrate into repository hook scripts. see https://www.notion.so/reviewboard/RB-Gateway-Webhooks-29b5037924d14aff83e2b53b86087a23 for more project details (this review request covers task 1 and 2).
Webhooks can now be registered into config.json. Functions to register webhooks into the config and saving of the config have been implemented but have not yet been hooked up into routes.go.
Webhooks can be invoked by calling a send-webhook command of rb-gateway while passing appropriate data. Currently only post-commit events are supported.
A sample hookscript for invoking rb-gateway webhooks for git repository post-commit events has been included.
- Testing Done:
-
Currently there are no automated tests for testing the new features but they are testable by running the sample git post-commit hookscript:
First, configure the config.json appropriately using the sample_config.json as a base. for the sample webhook Configuration url, you can use https://requestb.in/ as a receiving url. Try running rb-gateway to makesure config.json is parsed correctly. ~ Second, configure the sample hookscript: "sample_Git_post-commit_hookscript.sh". Make sure the repo name field and path to rb-gateway is correct and that the file is executable. You can test out the webhook invokation simply by running the script or installing it into your repository. It won't do anything if your repo has no commits yet. This testing method only works for git repos for now unless you modify the hookscript to be compatible with other scms. ~ Second, configure the sample hookscript: "sample_Git_post-commit_hookscript.sh". Make sure the repo name field and path to rb-gateway is correct and that the file is executable. You can test out the webhook invocation simply by running the script or installing it into your repository. It won't do anything if your repo has no commits yet. This testing method only works for git repos for now unless you modify the hookscript to be compatible with other scms.