Is there an API in GitLab for a project’s integrations?
I’m having trouble finding it in the API docs.
My particular interest is with the JIRA integration. What I’m looking to do is simply get the JIRA project code via an API request. I understand that integrations aren’t a regular component of GitLab and thus might not be supported via an API. But I’m wondering if there’s any way to do this.
As an area of last resort I can try and hack the GitLab UI’s responses for the JIRA integration page and “scrape” the project code out of the HTML. But I’d like to avoid that.
Background
I want to mention that I’m well into building a sort of “extended” GitLab Dashboard and API. The short story is that this returns the same data as the GitLab API but with extensions I call “derived properties” that are computed by " plugins ".
Plugins, in essence just add fields to the standard gitlab responses for things like projects, commits, pipelines, etc. So for example, I might want some data returned from the project’s pom.xml
(or `package.json’).
A plugin is thus somewhat like the IDE “framework” support in that it understands something about the usage. I might have a JIRA plugin that goes and assembles JIRA issues related to the project code, or SonarQube plugin that returns the code coverage of level of project smells.
In some some the plugin “discovers” the usage of the framework from the content of GitLab (source files, or integrations) and then makes requests to assemble the data.
In addition to adding this sorta extension to the GitLab models, it also has code to push these as documents to Elastic so one can build customized Kibana dashboards.
I’m hoping to get my company to allow me to contribute this to open source.
Hi @DaBlick
You are mapping GitLab Instance/Group/Project with a Jira instance. You don’t map it with one Jira Project.
When I configure Jira integration I can then ‘mention’ any issue from any project in the whole Jira instance.
That’s why there is no ‘Jira Project code’ anywhere.
hi @balonik
You’re response is how to get the features of the integration working. But that’s not what I’m trying to do.
What I"m trying to do, for the use case of my dashboard, to figure out WHAT JIRA project code is associate with “this” GitLab project. And the GitLab JIRA plugin (as you can see from this screen shot) surely seems to provide a way to configure that.
What I’m trying to do is merely retrieve WHAT the user put into that configuration field.
Oh, that field. No, there isn’t API for that, yet. UI uses “issues_enabled” and “project_key” params, but they don’t work with Services API endpoint.
@balonik I understand the challenges of having a GitLab API return non-GitLab plugin configurations.
I might just ask projects to set an environment variable with the JIRA project code.
One idea though - this is a feature-request I suppose - is this. I would tend to to think that they Integration plugin configs are in a GitLab-managed table in a data store. Perhaps there could be be some kinda of “generic” integration endpoint. It might start out by returning the integrations themselves (and generic state and what not) but then also (if my assumption is correct), return the configs.
Of course, this is subject to security in that the API should not return any data that would not be visible to the user via the UI.
Thanks for your comments.
@DaBlick
there already is API for supported Integrations where you can get/put integration configuration.
The thing is that Integrations are going through a major overhaul and not everything is available in APIs, yet.
Also if you would like to propose some feature GitLab issue tracket is a better place for it.