实现了 GitLab 全功能集成,包含 Webhook 处理、API 客户端、消息收发、会话管理、安全校验、限流器等完整模块,支持 Issues、Merge Requests、流水线等事件监听与交互。
183 lines
5.2 KiB
JSON
183 lines
5.2 KiB
JSON
{
|
||
"id": "gitlab",
|
||
"name": "GitLab",
|
||
"version": "1.0.0",
|
||
"label": "GitLab",
|
||
"aliases": ["gl", "gitlab-issues", "gitlab-mr"],
|
||
"description": "GitLab 渠道插件,支持 Issues、Merge Requests、Comments 的交互和项目管理。",
|
||
"author": "Yuxi Team",
|
||
"license": "MIT",
|
||
"order": 61,
|
||
"entry_point": "yuxi.channel.extensions.gitlab",
|
||
"dependencies": ["python-gitlab"],
|
||
"python_requires": ">=3.12",
|
||
"capabilities": {
|
||
"chat_types": ["direct", "group"],
|
||
"message_types": ["text", "image", "file"],
|
||
"interactions": [],
|
||
"reactions": true,
|
||
"typing_indicator": false,
|
||
"threads": true,
|
||
"edit": true,
|
||
"unsend": false,
|
||
"reply": true,
|
||
"media": true,
|
||
"native_commands": false,
|
||
"polls": false,
|
||
"group_management": false,
|
||
"streaming": true,
|
||
"streaming_mode": "block",
|
||
"block_streaming": true,
|
||
"block_streaming_chunk_min_chars": 800,
|
||
"block_streaming_chunk_max_chars": 4000,
|
||
"block_streaming_chunk_break_preference": "paragraph",
|
||
"block_streaming_coalesce_min_chars": 400,
|
||
"block_streaming_coalesce_max_chars": 2000,
|
||
"polling_fallback": false
|
||
},
|
||
"config_schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"token": {
|
||
"type": "string",
|
||
"title": "GitLab Access Token",
|
||
"description": "GitLab Personal/Project/Group Access Token",
|
||
"format": "password"
|
||
},
|
||
"api_base_url": {
|
||
"type": "string",
|
||
"title": "API Base URL",
|
||
"description": "GitLab 实例地址(默认 https://gitlab.com)",
|
||
"default": "https://gitlab.com",
|
||
"format": "uri"
|
||
},
|
||
"webhook_secret": {
|
||
"type": "string",
|
||
"title": "Webhook Secret",
|
||
"description": "GitLab webhook 签名验证密钥",
|
||
"format": "password"
|
||
},
|
||
"default_project": {
|
||
"type": "string",
|
||
"title": "Default Project",
|
||
"description": "默认操作的项目路径(格式:group/project)"
|
||
},
|
||
"allowed_projects": {
|
||
"type": "array",
|
||
"title": "Allowed Projects",
|
||
"description": "允许访问的项目路径列表",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"allowed_events": {
|
||
"type": "array",
|
||
"title": "Allowed Webhook Events",
|
||
"description": "允许处理的 webhook 事件类型",
|
||
"items": {
|
||
"type": "string",
|
||
"enum": [
|
||
"push",
|
||
"tag_push",
|
||
"issue",
|
||
"merge_request",
|
||
"note",
|
||
"wiki_page",
|
||
"pipeline",
|
||
"job",
|
||
"build",
|
||
"deployment",
|
||
"release",
|
||
"member",
|
||
"subgroup",
|
||
"feature_flag",
|
||
"emoji",
|
||
"confidential_issue",
|
||
"confidential_note"
|
||
]
|
||
},
|
||
"default": [
|
||
"issue",
|
||
"merge_request",
|
||
"note"
|
||
]
|
||
},
|
||
"auto_reply_enabled": {
|
||
"type": "boolean",
|
||
"title": "Auto Reply Enabled",
|
||
"description": "是否启用自动回复新 Issues/MRs",
|
||
"default": true
|
||
},
|
||
"auto_reply_template": {
|
||
"type": "string",
|
||
"title": "Auto Reply Template",
|
||
"description": "自动回复模板内容",
|
||
"format": "textarea",
|
||
"default": "Thank you for your contribution! We'll review it soon."
|
||
},
|
||
"label_mapping": {
|
||
"type": "object",
|
||
"title": "Label Mapping",
|
||
"description": "标签映射规则",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"dm_policy": {
|
||
"type": "string",
|
||
"title": "DM Policy",
|
||
"description": "私信访问控制策略",
|
||
"enum": ["open", "pairing", "closed"],
|
||
"default": "open"
|
||
},
|
||
"group_policy": {
|
||
"type": "string",
|
||
"title": "Group Policy",
|
||
"description": "群组访问控制策略",
|
||
"enum": ["open", "allowlist", "closed"],
|
||
"default": "open"
|
||
},
|
||
"max_comment_length": {
|
||
"type": "integer",
|
||
"title": "Max Comment Length",
|
||
"description": "评论最大字符数",
|
||
"default": 10000,
|
||
"minimum": 100,
|
||
"maximum": 100000
|
||
},
|
||
"rate_limit_per_minute": {
|
||
"type": "integer",
|
||
"title": "Rate Limit Per Minute",
|
||
"description": "每分钟最大请求数",
|
||
"default": 60,
|
||
"minimum": 10,
|
||
"maximum": 2000
|
||
},
|
||
"enable_ci_integration": {
|
||
"type": "boolean",
|
||
"title": "Enable CI Integration",
|
||
"description": "是否启用 CI/CD 流水线状态查询",
|
||
"default": true
|
||
},
|
||
"enable_mr_summary": {
|
||
"type": "boolean",
|
||
"title": "Enable MR Summary",
|
||
"description": "是否启用 Merge Request 摘要功能",
|
||
"default": true
|
||
}
|
||
},
|
||
"required": ["token", "api_base_url"]
|
||
},
|
||
"webhook": {
|
||
"enabled": true,
|
||
"path": "/webhooks/gitlab",
|
||
"methods": ["POST"],
|
||
"auth_type": "token",
|
||
"secret_header": "X-Gitlab-Token"
|
||
},
|
||
"min_api_version": "1.0.0",
|
||
"documentation_url": "https://docs.gitlab.com/ee/api/",
|
||
"icon": "gitlab",
|
||
"color": "#FC6D26",
|
||
"tags": ["gitlab", "git", "devops", "ci-cd", "enterprise"]
|
||
} |