历史版本3 :【Gitlab】研发代码审核结果推送 返回文档
编辑时间:
内容长度:图片数:目录数:
修改原因:
1.场景编辑
对于信息部而言,需求实现的一般流程为“业务提出需求-研发开发需求-测试审核需求-业务验收需求”,其中研发的开发一般发生于代码平台。
数知鸟支持集成代码平台,在数知鸟内实时推送代码开发进度,节省人工通知时间、简化跨平台查看进度的操作,让研发进度更透明。
下文以Gitlab为例。
2.Gitlab集成设置编辑
2.1新增测试webhook
「设置」>「webhooks」,根据帮助文档进行操作、贴入测试webhook链接,勾选“请求合并事件”,点击“添加webhook”
2.2了解请求结构与内容
发现关键信息处于请求中的body结构中,具体信息如下,有效信息为代码提交着user.username/代码任务名称title/代码状态state
{
"object_kind": "merge_request",
"event_type": "merge_request",
"user": {
"id": 31717,
"name": "wei lai",
"username": "weilai",
"avatar_url": null,
"email": "[REDACTED]"
},
"project": {
"id": 75877,
"name": "Learn GitLab - Ultimate trial",
"description": "Learn how to use GitLab to support your software development life cycle.",
"web_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"avatar_url": "https://jihulab.com/uploads/-/system/project/avatar/75877/Artboard.jpg",
"git_ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"git_http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git",
"namespace": "weilai",
"visibility_level": 0,
"path_with_namespace": "weilai1/learn-gitlab-ultimate-trial",
"default_branch": "master",
"ci_config_path": "",
"homepage": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git"
},
"object_attributes": {
"assignee_id": null,
"author_id": 31717,
"created_at": "2022-11-30 20:21:21 +0800",
"description": "",
"head_pipeline_id": null,
"id": 186306,
"iid": 1,
"last_edited_at": null,
"last_edited_by_id": null,
"merge_commit_sha": null,
"merge_error": null,
"merge_params": {
"force_remove_source_branch": "1"
},
"merge_status": "preparing",
"merge_user_id": null,
"merge_when_pipeline_succeeds": false,
"milestone_id": null,
"source_branch": "dev",
"source_project_id": 75877,
"state_id": 1,
"target_branch": "master",
"target_project_id": 75877,
"time_estimate": 0,
"title": "EP-1 更新 README.md",
"updated_at": "2022-11-30 20:21:21 +0800",
"updated_by_id": null,
"url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial/-/merge_requests/1",
"source": {
"id": 75877,
"name": "Learn GitLab - Ultimate trial",
"description": "Learn how to use GitLab to support your software development life cycle.",
"web_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"avatar_url": "https://jihulab.com/uploads/-/system/project/avatar/75877/Artboard.jpg",
"git_ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"git_http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git",
"namespace": "weilai",
"visibility_level": 0,
"path_with_namespace": "weilai1/learn-gitlab-ultimate-trial",
"default_branch": "master",
"ci_config_path": "",
"homepage": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git"
},
"target": {
"id": 75877,
"name": "Learn GitLab - Ultimate trial",
"description": "Learn how to use GitLab to support your software development life cycle.",
"web_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"avatar_url": "https://jihulab.com/uploads/-/system/project/avatar/75877/Artboard.jpg",
"git_ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"git_http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git",
"namespace": "weilai",
"visibility_level": 0,
"path_with_namespace": "weilai1/learn-gitlab-ultimate-trial",
"default_branch": "master",
"ci_config_path": "",
"homepage": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial",
"url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"ssh_url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"http_url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial.git"
},
"last_commit": {
"id": "a8629e88b02abfd346d06bda8da86f85205e12bf",
"message": "更新 README.md",
"title": "更新 README.md",
"timestamp": "2022-11-30T12:17:15+00:00",
"url": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial/-/commit/a8629e88b02abfd346d06bda8da86f85205e12bf",
"author": {
"name": "wei lai",
"email": "171706193@qq.com"
}
},
"work_in_progress": false,
"total_time_spent": 0,
"time_change": 0,
"human_total_time_spent": null,
"human_time_change": null,
"human_time_estimate": null,
"assignee_ids": [],
"reviewer_ids": [],
"labels": [],
"state": "opened",
"blocking_discussions_resolved": true,
"first_contribution": false,
"detailed_merge_status": "checking",
"action": "open"
},
"labels": [],
"changes": {
"merge_status": {
"previous": "unchecked",
"current": "preparing"
}
},
"repository": {
"name": "Learn GitLab - Ultimate trial",
"url": "git@jihulab.com:weilai1/learn-gitlab-ultimate-trial.git",
"description": "Learn how to use GitLab to support your software development life cycle.",
"homepage": "https://jihulab.com/weilai1/learn-gitlab-ultimate-trial"
}
}
2.3新增正式webhook
3.数知鸟集成设置编辑
3.1新增“集成服务”
「设置」>「集成配置」>「集成服务」,新增配置、设置集成名称。
3.2配置“集成服务”
1)设置动态数据映射
2)在webhook卡片中设置集成服务作用空间
3)添加“筛选需求”步骤并配置
4)保存
4.检验编辑
在集成服务列表中,可点击查看具体运行情况,了解是否成功运行