Gitlab: webhook: merge request event - gitlab

I have created a webhook in gitlab on a merge request event. And to see what was in the event, I used the ruby example in the docs.
Then I use the test button.
Looking at the json body, I notice that the object kind is "push", even though this is a Merge Request Event. I have other webhooks which are Push events.
The docs for gitlab webhooks show a merge request as having an object kind field of "merge_request". Of course the docs could be out of date.
Any ideas why I appear to be getting push data on a merge request event?
Regards,
John

So the problem is a feature in gitlab. When testing a webhook, it only sends a push event, even if the webhook fires on other events.

Related

How to create parameterised webhook url on gitlab?

The use-case would be to trigger certain jobs, only after an MR is not in WIP anymore.
The idea what I'm exploring is to create a merge-request webhook, that would trigger a pipeline.
However in order to do this, I have to get the ref from the webhook's request body to call the trigger accordingly.
What options do I have?
Running a server just for processing the webhook and redirecting to the correct endpoint is not really an option.
Running a server just for processing the webhook and redirecting to the correct endpoint
I dont see any other way. I'm in same boat. Gonna use Heroku for just this bit. Oh well.

Push Notifications to Socket IO (nodeJS) to Slack

I'm trying to implement Push Notifications from Acumatica to my own NodeJS Server using SocketIO to get real-time notifications.
I am using the Webhook Type to send Data to Slack, unfortunately Slack only needed
"text" parameter to post on their webhook.
Acumatica has its own sets of parameters. I've looked up on how to create class-based Notification Structure defined by Acumatica Documentation, I can't find a way to compress all the JSON returned by the Data Query into "text" params, or any other way to customize the data query returned by Acumatica.
I'm trying to look into other Push Notification Methods in Acumatica.
You have 2 possibilities to do:
you can write your own service to transfer acumatica push notifications to slack form and resend them to slack.
you can customize acumatica and add there your own hooktype.
In this case you should implement a pair of interfaces: IPushNotificationSender and IPushNotificationSenderFactory
this hook will be automatically added to your hook type selector.

Can I get Dialogflow send a request to my webhook when I trigger an event?

I want to trigger an intent/event in Dialogflow [from my webhook/server] and have Dialogflow send a request to my /webhook instead of just responding to the POST request that I made which triggered the event. Is that possible? I want to send the user a message based on their input in our web application, but the response types could vary greatly so I can't define the message and payload in the DF web panel.
edit: [in brackets]
Yes, Dialogflow can send information to a webhook - it refers to this as fulfillment.
Keep in mind that the JSON sent by Dialogflow will be in its format, not yours, and it expects a reply in its format as well. This reply will include the message to be sent back to the user (the response to the original POST request).

How to use webhooks?

I am working on a project where I need to integrate the google-services(like Gmail, Gcalendar). When the user gets a mail or something added to the gCalender I need to activate some code. Can I achieve it by webhooks or need to do polling with some time duration.
If I use webhooks, how to determine which user data that I get(consider I have thousands of users).
You can use webhooks to get push notifications. Webhooks are very similar to API's but they are inverted instead. For example instead of you making a call to an API you would define a callback URL in which the receiving end will then HTTP Post the information that you want, e.g name etc.
the creation or registration of a webhook will be the combination of:
--> a Friendly name for that webhook.
--> the URL where the callback should be sent
--> the scope of the webhook
--> the events to post to the URL either all events or a set of specific events.
Name: "MyWebhook"
URL: http://www.webhookapplication.com/webhookreciever
Scope: Project = .... and fixversion IN ("5.1")
Events: Updated and create etc.
You can create webhooks by first setting up an unique URL which I use RequestBin for e.g http://requestb.in/XXXXXXXX
Most Event Webhooks will notify a URL that you choose via the HTTP Post with information about events that occur.
A good example about webhooks can be found here:
https://sendgrid.com/docs/API_Reference/Webhooks/index.html
And this here will example how to use the send grid event to email:
https://sendgrid.com/docs/API_Reference/Webhooks/event.html

Notify all participants about merge request

Is there a way to notify all gitlab project participants about new merge request, so they can review changes and vote? At the moment only a responsible person is notified and this is IMHO not very well team-oriented.
If this isn't supported, that would be a feature request to add to the "feedback.gitlab.com" page.
But consider also "Notify only requester and not whole team on comment in merge request":
the whole team is notified via email when someone comments on a merge request.
Please add the functionality to just notify the one who created the merge request to be notified
This is done since 5.3, which means a comment on a change request should notify a group, and not just the owner.

Resources