Coder Social home page Coder Social logo

rocketchat-gitlab-hook's Introduction

RocketChat incoming webhook for gitlab integration

Add GitLab notifications via a new WebHook in Rocket.Chat

This repository only contains a single rocket chat integration script. Go there https://rocket.chat/docs/administrator-guides/integrations/gitlab for more info about using it

Important note:

I'm not using rocket chat anymore but still maintain this repository, even if I can have a long delay to merge PRs. If you are an active rocket chat user and want to take over with the project contact me directly at jgotti at jgotti dot org. Anyway You can still propose PR i'll review them even if it can take me some times but please:

  • make sure it works with recent versions
  • respect the coding style of the project

rocketchat-gitlab-hook's People

Contributors

bitbruder avatar blackskyliner avatar broferek avatar diegosouza avatar ele-atl avatar golflima avatar hosseinkhaledi avatar malko avatar marcdahlem avatar pothix avatar rolurq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocketchat-gitlab-hook's Issues

Unknown event 'undefined' occured. Data attached.

Unknown event 'undefined' occured. Data attached.
{
"url": {
"hash": null,
"search": null,
"query": {},
"pathname": "/hooks/yY4scaTDhWqmkuGAC/CENSORED",
"path": "/hooks/yY4scaTDhWqmkuGAC/CENSORED"
},
"url_raw": "/hooks/CENSORED",
"url_params": {
"integrationId": "yY4scaTDhWqmkuGAC",
"token": "CENSORED"
},
"content": {},
"content_raw": "[object Object]",
"headers": {
"connection": "upgrade",
"host": "chat.comugamers.com",
"x-real-ip": "162.158.62.51",
"x-forward-for": "167.114.103.105, 162.158.62.51",
"x-forward-proto": "http",
"x-nginx-proxy": "true",
"accept-encoding": "gzip",
"cf-ipcountry": "CA",
"x-forwarded-for": "167.114.103.105",
"cf-ray": "3e873985522d1876-EWR",
"x-forwarded-proto": "http",
"cf-visitor": "{"scheme":"http"}",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
"0cf-connecting-ip": "X"
},
"user": {
"_id": "X",
"name": "X",
"username": "X"
}
}

webhook not hapenning automatically

Hi,
I am using this webhook with below versions, but when i do some changes in my repository through gitlab site, nothing comes to the channel, but when i click "test hook" in gitlab it appears in chat!!

any guess what could be the issue..? also i didn't get how to use ".eslintrc.json" file is this file mandatory..?

Rocket chat version 048.2
Gitlab version : 8.7.0-rc4

Consider adding a license

Hi there!
Thank you for putting together this script and sharing it with both the Rocket.Chat and GitHub community.

To help assure the continued, safe use of this script, would you consider adding a license to the repository? It would be greatly appreciated if possible.

For some suggestions, I recommend checking the GitHub created Choose A License.

Split error with GitLab integration

Everything seems to work nicely, but it's kind of annoying that with pushes, MR's, and merges I get always an error:

Rocket.Cat ErrorHandler 5:37 PM Error occured while parsing an incoming webhook request. Details attached. Error: 'TypeError: Cannot read property 'split' of undefined', Message: 'Cannot read property 'split' of undefined', Stack: 'TypeError: Cannot read property 'split' of undefined at Script.systemEvent (script.js:1:12882) at Script.process_incoming_request (script.js:1:3656) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11) at Proxy.<anonymous> (vm.js:6:23) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11)'

I tried to remove the "split" section, but then I get:

Rocket.Cat ErrorHandler 5:08 PM Error occured while parsing an incoming webhook request. Details attached. Error: 'TypeError: this.systemEvent is not a function', Message: 'this.systemEvent is not a function', Stack: 'TypeError: this.systemEvent is not a function at Script.process_incoming_request (script.js:1:2186) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11) at Proxy.<anonymous> (vm.js:6:23) at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11)'

Any ideas what that might be?

Avatar not displayed correctly

I found a bug related to the avatars: when gravatar is used, i can see correctly the image of the user, but if the guy who pushed the commits doesn't have a gravatar image (just a normal uploaded avatar), i get no images, just a not found link pointing to a nonexistent path

This is the result with gravatar
LINK: https://www.dropbox.com/s/zhhr2aybfcodgc6/Screenshot%202017-07-10%2018.32.12.jpg?dl=0

This is the result without gravatar (just normal avatar uploaded)
LINK: https://www.dropbox.com/s/gul0nc94i95m1sw/Screenshot%202017-07-10%2018.32.00.jpg?dl=0
This is the wrong path used: /uploads/system/user/avatar/921231/avatar.png

Timestamp of Attachment ist not set

Problem: All Attachements are missing the 'ts' portion of the message. Thus leading to 1.1.1970 00:00 in the cite of the Botmessage.

Possible solution: We get dates throughout the gitlab pushes, it's within commits (timestamp) and within object_attributes (created_at). So I guess weshould extend the makeAttachement function and add the parameter timestamp and fill it with the corresponding dates and times.

Tag event doesn't work anymore

Hi Malko,

thanks for the new update(s) of the script.
Today, I updated the script in our Rocket.Chat.
Since that, the tag events do not show up anymore in our webhook channel.

Best regards
Marc

Error while send push event

Error occured while parsing an incoming webhook request. Details attached.
Error: 'TypeError: Cannot read property 'web_url' of undefined',
Message: 'Cannot read property 'web_url' of undefined',
Stack: 'TypeError: Cannot read property 'web_url' of undefined
at Script.pushEvent (script.js:1:7204)
at Script.process_incoming_request (script.js:1:2109)
at Fiber (evalmachine.:6:23)'

Allow use avatar from webhook-setting

Hi,
thx for your cool webhook!

How can I use avatar settings from Rocket.chat webhook page?

image

I have setup the avatar url (screen), but every chat msg have Gitlab user avatar instead my specified in webhook setting.

Avatar of private projects not displayed correctly.

I've run into this problem that when the webhook post a message for a push event, its avatar was missing. I inspected the DOM and found that the avatar image url was the avatar for that project/repository. Since the repository was private, requests for its url (especially sent from rocket client) were blocked and redirected to the signin page. I guess the script should avoid using project's avatar when it's not public accessible.

Messages should have a target="_blank" attribute in html a tags

In version 5.4.4 (at least), RocketChat opens links embedded in messages generated by this hook script by replacing the current page (either in the web interface or in the desktop client).

Links generated by this hook script doesn't have a target="_blank" attribute in the html a tags :

message-without-target

whereas a message created by typing an url in the chat has a target="_blank" attribute and opens correctly in a browser window or tab. :
message-with-target

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.