Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
xyz_1011
Partner - Creator
Partner - Creator

gitlab connector

Hi all,

is there a way to get all files from a given gitlab repository and store them in a dedicated space ?

Thanks a lot for some advise.

Labels (2)
1 Solution

Accepted Solutions
AfeefaTk
Support
Support

Hi @xyz_1011 

I have done this by configuring the automation to listen "On Merge Request" webhook event in Gitlab, add a condition block to check if the created source branch has been merged to the main branch, and if merged get the content of the file and use "Set Load Script" block from Qlik Cloud Services connector to update the loadscript of Qlik Sense app.

We already have a template called "Set load script in Qlik Sense app from merged GitHub pull request" which you can refer to and replace the GitHub blocks with GitLab blocks.

https://community.qlik.com/t5/Official-Support-Articles/Qlik-Application-Automation-Set-load-script-...

I have also created simple demo automation for your reference.

Thanks

View solution in original post

10 Replies
Shai_E
Support
Support

Hello,

It seems like currently what is available in QAA is the "Get File from Repository" but that is for a single file, it requires a project id, branch, and file path.

Another option is perhaps to use the "Raw API List Request" block to make a request to "list repository tree" endpoint for git labs api.

Repositories API | GitLab

I didnt dabble with this connector much, but this is what i could find.

Note that the response is just some information in regard to the files, not the files themselves.

I hope it helps.

xyz_1011
Partner - Creator
Partner - Creator
Author

Thanks @Shai_E 

Would you know if i can embedd the „Get File from Repository“ in a loop to go through an array of file paths that my preceeding „on Push event“ might return ?

Indeed i need to get the files themselves into my tenant. Not just their meta data. Any idea how that could be done ?

Thanks!

Shai_E
Support
Support

Hi @xyz_1011 

I would assume that you can use that block in a loop, it sounds logical to me.

In regard to your second question i am not sure it is possible with the QAA module.

@AfeefaTk perhaps you have an idea in regard to this? i didnt dabble much with this connector.

AfeefaTk
Support
Support

Hi @xyz_1011 

Yes, I think that would work.

If I understand correctly you have a list of repository files retrieved using the "Raw API List Request" block, and you need more information about the file in the repository which can be achieved using the "Get File from Repository" block within the loop of "Raw API List Request" block and specifying the file path to the file

Hope this helps

Thanks

 

xyz_1011
Partner - Creator
Partner - Creator
Author

Hi @AfeefaTk  Thanks a lot for your reply. What i am really after, is getting all relevant files (in the sense of being updated, deleted or added) from my gitlab repository into my tenant (stored in a given space). And i do need the file - not the description of the file. As i am still new to QAA would you maybe be able to share some template workflow that would be able to do what i am after ?

Background: I am using QVS files that include my scripts. My apps read them via an include statement. These QVS files are all stored in my gitlab repository. I am looking for an automated way to get these files into my tenant everytime they are being updated (basically after every 'git push' event).

Not sure, if QAA is the only way to approach this, but i havent found anything else yet. 

Thanks again for your help!

AfeefaTk
Support
Support

Hi @xyz_1011 

We have a template called "Commit an app to GitHub" which performs Qlik Sense app version control on GitHub

More information can be found here

Could you please try using the same approach with GitLab connector and see if that works?

You can refer to GitLab Getting Started Article 

Please let me know if you are facing any further difficulties

Thanks

AfeefaTk
Support
Support

Hi @xyz_1011 

Sorry, I misread your comment

It seems you need to get the files from Gitlab and import these files to the Qlik Sense tenant.

You can see the template "Import an app from GitHub" which creates an app based on the GitHub file.

Could you please try the same using Gitlab?

Thanks

 

 

xyz_1011
Partner - Creator
Partner - Creator
Author

Hey @AfeefaTk , 

thanks for the tip, however, i do not want to import an app from gitlab. What i want is to get the content of a QVS file which resides in gitlab and eventually use this QVS file's content as a LOAD script in an app...

Thanks for some more advise 🙂

AfeefaTk
Support
Support

Hi @xyz_1011 

I have done this by configuring the automation to listen "On Merge Request" webhook event in Gitlab, add a condition block to check if the created source branch has been merged to the main branch, and if merged get the content of the file and use "Set Load Script" block from Qlik Cloud Services connector to update the loadscript of Qlik Sense app.

We already have a template called "Set load script in Qlik Sense app from merged GitHub pull request" which you can refer to and replace the GitHub blocks with GitLab blocks.

https://community.qlik.com/t5/Official-Support-Articles/Qlik-Application-Automation-Set-load-script-...

I have also created simple demo automation for your reference.

Thanks