GitLab Integration [GOT CREATED]

An integration for GitLab should be added:

I would like to work on this topic or test the work of others.

1 Like

Great, thanks! You can then check out the Github nodes. They are probably a good starting point as the nodes should pretty much work the same:

1 Like

I started with gitlab-nodejs and realized very quickly that third-party dependencies are currently not usable (or difficult to use). Yes, now I’m going to reimplement the existing Github nodes for Gitlab.

Third-party dependencies should technically not be a problem. They should work without a problem. I just discourage the use to not end up with more and more dependencies as described here Introduction | Docs

Taking the GIthub-Node as a starting point is probably not just faster it also make sure that things work consistent between nodes.

Maybe this is better a topic for an independent thread:
I build a custom Docker image that additionally has node-gitlab installed running npm install -g .... But when starting the container the missing gitlab library will still be complained about.
I totally understand the risk of arbitrary thirt-party dependencies - and a REST client can certainly be developed without a special SDK. But implementing proprietary protocols (e.g. Kafka) is much more difficult.

Hm when does it throw that error? When you execute n8n-node-dev build, when you start n8n or when you execute the node?

Totally agree with you for some things a special SDK is needed and it would be really strange and stupid having to reimplement everything. In this case it is totally OK to install a special module which takes care of that. However for all simple REST things (under which probably around 80% of the integrations fall) I want to avoid it. No need to have 10 different libraries which make http requests.

Anyhow, integrations which are more complicated and are not needed by the most users I would however prefer that they get implemented in own packages and then only be installed by people which really needed them. It is already possible to create a package named “n8n-nodes-*” and defining the “n8n” key in the package.json (like in the “nodes-base” page). It will then find the nodes and load them. Still have to document it though…

Created now an issue in Github and gave it the “Hacktoberfest” tag so that it counts toward it in case you are participating:
https://github.com/n8n-io/n8n/issues/27

@CrystalMethod Are you working on that? Because another user expressed interest and did not hear from you for 19 days.

Thanks a lot to lucafaggianelli as he created the integration and I did just merge it. Will release a new n8n version which includes it later in the day.

1 Like

The lastest version of [email protected] includes now the Gitlab integration.

1 Like

@jan
I can’t seem to get the GitLab node to work for any operation. I always get the following error :frowning:
ERROR: 404 - {“error”:“404 Not Found”}

StatusCodeError: 404 - {"error":"404 Not Found"}
    at new StatusCodeError (/usr/local/lib/node_modules/n8n/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/usr/local/lib/node_modules/n8n/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/n8n/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:185:22)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)

I am using the cloud version of GitLab with teh default URL and a proper API token. Could you please help me understand what could be going wrong?

It looks like you supply some incorrect information. Most likely it is either “Project Owner” or “Project Name”. So I would check them and make 100% sure that they are correct.

As Gitlab Server you should have the following set: https://gitlab.com

Yeah, I suspect that too. Let me try to test this via curl commands first. I’ll report back here.

1 Like

@jan
Could you please clarify these?
Should the project name include the namespace too? I have a project ‘abc’ that lies in the group/namespace ‘xyz’ that I am trying to access. How should the project name be mentioned in such cases? Should it be ‘xyz/abc’?
Also, would the Owner name be the username or the actual name of the owner?

I am able to fetch everything perfectly via CURL. But I am still unclear about what I am doing wrong in n8n.

The namespace goes with the “Project Owner”.

So it is probably the easiest to simply check the URL it displays you in the browser. If the URL is:
https://gitlab.com/owner/namespace/project

You would use:
Project Owner: owner/namespace
Project Name: project

That made everything work fine!
Thanks a ton! :slight_smile:

1 Like