Using GitLab Diagrams
PlantUML Diagrams for Confluence cloud app allows users to import their GitLab diagrams into Confluence pages.
Setup
Step 1: GitLab OAuth App
In order to connect GitLab account with the app, user should first create OAuth app on their GitLab account. For companies, we suggest creating separate account for this role as a security measure.
Go to gitlab.com and login into account.
Click on the account image on top left side:
From the drop-down menu select “Preferences“
From the left menu bar select “Applications”
Click “Add new Application“ on the right.
Give OAuth app a name and insert redirect URL. Correct URL is: https://puml4cc.stratus-addons.com/atgl. Give only read_api permission.
Save the application. On the next page, copy and save application secret and ID. Make sure newly created OAuth App is listed under “Authorized Applications”.
Step 2: App setup
Open PlantUML Diagrams for Confluence setup page. Select “GitLab” tab.
Populate fields and click on “Save Settings“. This will persist connection details. Note that only gitlab.com is supported for now.
Click on Connect With GitLab button. This will initiate connection procedure. At this point you need to grant permission to OAuth App to communicate with PlantUML Diagrams for Confluence app. After you allow communication, both apps are connected and Confluence users will be able to use repositories visible to OAuth app.
Using repository explorer
Main concepts
In the diagram editor, in the top toolbar, there is a GitLab icon. When GitLab icon is clicked, Repository Explorer will open showing available repositories. Users can browse repositories using File Explorer or input the URL directly.
Repository URL feature
In order to avoid browsing repositories, users can directly put repository URL into GitLab repository URL field. It’s a HTTPS URL received from “Clone from HTTPS“ feature on the GitLab project page. When users provide this URL, they will be automatically redirected to given project Branches view. If URL is invalid, error message will be shown.
Direct link feature
User can always choose direct link feature to avoid navigating through the repositories.
Open GitLab and navigate to the file you wish to include into Confluence page. Copy URL from the browser. Paste that URL into upper right field in Repository Explorer:
If the URL is valid, Select button will be enabled. Click on the button and the diagram will be loaded into editor.
Pagination
If linked account has more than 100 repositories with PlantUML diagrams, user can use the pagination feature.
In this example linked account has more than 100 repositories. Pagination control is visible and can be used for the navigation.