malko / rocketchat-gitlab-hook Goto Github PK
View Code? Open in Web Editor NEWAdd GitLab notifications via a new WebHook in Rocket.Chat
License: Other
Add GitLab notifications via a new WebHook in Rocket.Chat
License: Other
When option Collapse embedded media by default
is enabled , attachments message won't display.
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
Steps to reproduce:
Unknown event 'Confidential Issue Hook' 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"
}
}
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
GitLab deployment events are not covered by script, this leads to execute the unknown block of the switch statement.
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.
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.
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 :
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. :
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
hey there, would it be possible to create gitlab issues for a certain project?
e.g.: /fancy-project new issue @joe do the right thing
I'm getting
Tue, 06 Feb 2018 17:11:30 GMT b04882ba by Unknown: Commit message
on git commit messages.
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)'
Has anybody tested this Webhook script with the latest Rocketchat version? :)
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.