-
Notifications
You must be signed in to change notification settings - Fork 49
Initial http reaction #253
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
Conversation
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 you create an issue for this with various config options supported?
Added to the PR description. |
Yes, thanks for adding it. Can we please also create issue - as anyways for major changes we require the PR to link to an issue. |
|
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.
LGTM
Description
Initial implementation of an Http reaction. This enables the user to craft Http calls that will be invoked when query result set changes occur.
The URL of the request and the payload can be constructed from a handlebars template.
For example, the following configuration will
post
tohttps://api.github.com/repos/{{repo}}/issues/{{issue_number}}/comments
, where the variables are sourced from the result set item that was added. The JSON body of the request is also constructed using handlebars.Configuration Schema
Reaction-Level configuration
baseUrl
: The base URL to use for all Http requests that will be made. eg.https://api.github.com
. Query specific requests will build on this URL by adding a path,token
(optional): The bearer token to use for authentication.Per-Query Configuration
The following 3 sections can be included per query
added
(optional): Describes the Http request for items added to the result set.updated
(optional): Describes the Http request for items updated the result set.deleted
(optional): Describes the Http request for items deleted from the result set.Each of these will describe the Http request to make for
added
,updated
, anddeleted
changes respectively.The configuration for each of these is as follows:
url
: The path to append to thebaseUrl
for the request. This can be a handlebars template, where you can merge data from the result set diff. Added results will have anafter
field that contains an object that is the added item, updated results will havebefore
andafter
objects, and deleted results will only have abefore
object. For example:/repos/{{after.repo}}/issues/{{after.issue_number}}/comments
method
: The Http method to use,PUT
,POST
,GET
,DELETE
, etc.body
: The body of the request. This can be a handlebars template, where you can merge data from the result set diff. Added results will have anafter
field that contains an object that is the added item, updated results will havebefore
andafter
objects, and deleted results will only have abefore
object.headers
: An object containing any additional custom headers to include in the Http request.What is missing