by langgenius · v0.3.12
GitLab Project Datasource - Access projects, issues, merge requests, and files
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
A comprehensive Dify datasource plugin that enables seamless integration with GitLab, allowing you to access projects, issues, merge requests, and files from both GitLab.com and self-hosted GitLab instances.
.md), reStructuredText (.rst), AsciiDoc (.adoc).py), JavaScript (.js), TypeScript (.ts), Java (.java), C++ (.cpp), and more.yaml, .yml), JSON (.json), XML (.xml), TOML (.toml).csv), SQL (.sql), notebooks (.ipynb).html), CSS (.css), SCSS (.scss)Install the Plugin
# Download and install the plugin package
dify-plugin install gitlab-datasource.difypkg
Configure Authentication Choose one of the following authentication methods:
Option A: Personal Access Token (Recommended for development)
read_user, read_repository, apiOption B: OAuth 2.0 (Recommended for production)
Personal Access Token: glpat-xxxxxxxxxxxxxxxxxxxx
GitLab URL: https://gitlab.com (or your self-hosted URL)
GitLab Application Configuration:
Name: Dify GitLab Integration
Redirect URI: https://your-dify-instance.com/console/api/oauth/callback
Scopes: read_user read_repository api
Dify Configuration:
Client ID: your-gitlab-client-id
Client Secret: your-gitlab-client-secret
GitLab URL: https://gitlab.com (or your self-hosted URL)
For self-hosted GitLab instances:
GitLab URL: https://gitlab.your-company.com
Personal Access Token: glpat-xxxxxxxxxxxxxxxxxxxx
# Access project README
project_readme = datasource.get_content("project:username/project-name")
# Access specific file
file_content = datasource.get_content("file:username/project-name:path/to/file.md")
# Get issue with comments
issue_data = datasource.get_content("issue:username/project-name:123")
# Get merge request with discussions
mr_data = datasource.get_content("mr:username/project-name:456")
# Get recent issues
recent_issues = datasource.get_pages({
"project_filter": "username/project-name",
"content_type": "issues",
"limit": 10,
"state": "opened"
})
| Type | Format | Description |
|---|---|---|
project | project:namespace/project-name | Complete project information and README |
file | file:namespace/project-name:file/path | Individual file content |
issue | issue:namespace/project-name:issue-iid | Issue with comments and metadata |
mr | mr:namespace/project-name:mr-iid | Merge request with discussions |
{
"content": "Processed file content or information",
"title": "Content title",
"project": "namespace/project-name",
"type": "project|file|issue|mr",
"metadata": {
"url": "https://gitlab.com/...",
"last_updated": "2024-01-01T00:00:00Z",
"author": "username",
"labels": ["bug", "enhancement"]
}
}
Authentication Failed (401)
Error: Invalid GitLab access token
Solution: Verify your token is valid and has required scopes
Rate Limit Exceeded (429)
Error: GitLab API rate limit exceeded
Solution: Wait for the specified retry time or upgrade GitLab plan
Project Not Found (404)
Error: Project 'namespace/project' not found
Solution: Check project name and ensure you have access permissions
Self-hosted GitLab Issues
Error: Failed to connect to GitLab instance
Solution: Verify GitLab URL format and network connectivity
Enable debug logging:
import logging
logging.getLogger("gitlab_datasource").setLevel(logging.DEBUG)
Minimum Required Scopes:
read_user: Access user profile informationread_repository: Access project files and metadataapi: Access issues, merge requests, and other API endpointsFor Private Projects:
For enterprise installations and custom requirements:
This plugin is released under the MIT License. See LICENSE for details.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Made with ❤️ for the Dify community