diff --git a/services/webhooks2tasks/src/handlers/gitlabPullRequestClosed.ts b/services/webhooks2tasks/src/handlers/gitlabPullRequestClosed.ts index f7fe5e9407..84d720a37e 100644 --- a/services/webhooks2tasks/src/handlers/gitlabPullRequestClosed.ts +++ b/services/webhooks2tasks/src/handlers/gitlabPullRequestClosed.ts @@ -16,7 +16,7 @@ export async function gitlabPullRequestClosed(webhook: WebhookRequestData, proje const meta: { [key: string]: any } = { projectName: project.name, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, pullrequestTitle: body.object_attributes.title, pullrequestUrl: body.object_attributes.url, repoName: body.object_attributes.target.name, @@ -29,7 +29,7 @@ export async function gitlabPullRequestClosed(webhook: WebhookRequestData, proje const ocsafety = string => string.toLocaleLowerCase().replace(/[^0-9a-z-]/g, '-'); - let branchName = `pr-${body.object_attributes.id}` + let branchName = `pr-${body.object_attributes.iid}` let openshiftProjectName = projectOpenShift.openshiftProjectPattern ? projectOpenShift.openshiftProjectPattern .replace('${branch}', ocsafety(branchName)) @@ -38,7 +38,7 @@ export async function gitlabPullRequestClosed(webhook: WebhookRequestData, proje const data: removeData = { projectName: project.name, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, pullrequestTitle: body.object_attributes.title, branch: branchName, openshiftProjectName: openshiftProjectName, @@ -48,7 +48,7 @@ export async function gitlabPullRequestClosed(webhook: WebhookRequestData, proje try { await createRemoveTask(data); sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:closed:handled`, meta, - `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.id} (${body.object_attributes.title})> closed in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` + `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.iid} (${body.object_attributes.title})> closed in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` ) return; } catch (error) { @@ -58,7 +58,7 @@ export async function gitlabPullRequestClosed(webhook: WebhookRequestData, proje case "UnknownActiveSystem": // These are not real errors and also they will happen many times. We just log them locally but not throw an error sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:handledButNoTask`, meta, - `*[${project.name}]* PR ${body.object_attributes.id} closed. No remove task created, reason: ${error}` + `*[${project.name}]* PR ${body.object_attributes.iid} closed. No remove task created, reason: ${error}` ) return; diff --git a/services/webhooks2tasks/src/handlers/gitlabPullRequestOpened.ts b/services/webhooks2tasks/src/handlers/gitlabPullRequestOpened.ts index 42e6ebbd2f..9d8021c053 100644 --- a/services/webhooks2tasks/src/handlers/gitlabPullRequestOpened.ts +++ b/services/webhooks2tasks/src/handlers/gitlabPullRequestOpened.ts @@ -17,7 +17,7 @@ export async function gitlabPullRequestOpened(webhook: WebhookRequestData, proje const meta = { projectName: project.name, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, pullrequestTitle: body.object_attributes.title, pullrequestUrl: body.object_attributes.url, repoName: body.object_attributes.target.name, @@ -46,21 +46,21 @@ export async function gitlabPullRequestOpened(webhook: WebhookRequestData, proje repoName: body.object_attributes.target.name, pullrequestUrl: body.object_attributes.url, pullrequestTitle: body.object_attributes.title, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, projectName: project.name, type: 'pullrequest', headBranchName: headBranchName, headSha: headSha, baseBranchName: baseBranchName, baseSha: baseSha, - branchName: `pr-${body.object_attributes.id}`, + branchName: `pr-${body.object_attributes.iid}`, buildName: buildName } try { await createDeployTask(data); sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:opened:handled`, data, - `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.id} (${body.object_attributes.title})> opened in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` + `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.iid} (${body.object_attributes.title})> opened in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` ) return; } catch (error) { @@ -70,7 +70,7 @@ export async function gitlabPullRequestOpened(webhook: WebhookRequestData, proje case "UnknownActiveSystem": // These are not real errors and also they will happen many times. We just log them locally but not throw an error sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:handledButNoTask`, meta, - `*[${project.name}]* PR ${body.object_attributes.id} opened. No deploy task created, reason: ${error}` + `*[${project.name}]* PR ${body.object_attributes.iid} opened. No deploy task created, reason: ${error}` ) return; diff --git a/services/webhooks2tasks/src/handlers/gitlabPullRequestUpdated.ts b/services/webhooks2tasks/src/handlers/gitlabPullRequestUpdated.ts index 4a877a81bd..57b25c17cd 100644 --- a/services/webhooks2tasks/src/handlers/gitlabPullRequestUpdated.ts +++ b/services/webhooks2tasks/src/handlers/gitlabPullRequestUpdated.ts @@ -17,7 +17,7 @@ export async function gitlabPullRequestUpdated(webhook: WebhookRequestData, proj const meta = { projectName: project.name, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, pullrequestTitle: body.object_attributes.title, pullrequestUrl: body.object_attributes.url, repoName: body.object_attributes.target.name, @@ -46,14 +46,14 @@ export async function gitlabPullRequestUpdated(webhook: WebhookRequestData, proj repoName: body.object_attributes.target.name, pullrequestUrl: body.object_attributes.url, pullrequestTitle: body.object_attributes.title, - pullrequestNumber: body.object_attributes.id, + pullrequestNumber: body.object_attributes.iid, projectName: project.name, type: 'pullrequest', headBranchName: headBranchName, headSha: headSha, baseBranchName: baseBranchName, baseSha: baseSha, - branchName: `pr-${body.object_attributes.id}`, + branchName: `pr-${body.object_attributes.iid}`, buildName: buildName } @@ -61,7 +61,7 @@ export async function gitlabPullRequestUpdated(webhook: WebhookRequestData, proj await createDeployTask(data); // gitlab does not identify well that this is an update to a merge request, so we manually set the event type here. sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:updated:handled`, data, - `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.id} (${body.object_attributes.title})> updated in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` + `*[${project.name}]* PR <${body.object_attributes.url}|#${body.object_attributes.iid} (${body.object_attributes.title})> updated in <${body.object_attributes.target.web_url}|${body.object_attributes.target.name}>` ) return; } catch (error) { @@ -71,7 +71,7 @@ export async function gitlabPullRequestUpdated(webhook: WebhookRequestData, proj case "UnknownActiveSystem": // These are not real errors and also they will happen many times. We just log them locally but not throw an error sendToLagoonLogs('info', project.name, uuid, `${webhooktype}:${event}:handledButNoTask`, meta, - `*[${project.name}]* PR ${body.object_attributes.id} updated. No deploy task created, reason: ${error}` + `*[${project.name}]* PR ${body.object_attributes.iid} updated. No deploy task created, reason: ${error}` ) return; diff --git a/tests/tasks/webhook-gitlab/pullrequest-closed.yaml b/tests/tasks/webhook-gitlab/pullrequest-closed.yaml index 80e9d0399f..f9e7b25c25 100644 --- a/tests/tasks/webhook-gitlab/pullrequest-closed.yaml +++ b/tests/tasks/webhook-gitlab/pullrequest-closed.yaml @@ -7,4 +7,4 @@ method: POST follow_redirects: yes body_format: json - body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":"1","name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":"{{ git_pr_number }}","iid":1,"last_edited_at":"2018-03-19 00:04:33 UTC","last_edited_by_id":2127130,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"merged","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"My Merge Request edit","updated_at":"2018-03-19 00:07:53 UTC","updated_by_id":2127130,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"edit test2","timestamp":"2018-03-19T00:06:27+00:00","url":"https://gitlab.com/michael.schmid1/test/commit/3f116b9ce232c1c84ddac414abb73e985b67aee2","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"merge"},"labels":[],"changes":{"state":{"previous":"opened","current":"closed"},"updated_at":{"previous":"2018-03-19 00:06:28 UTC","current":"2018-03-19 00:07:53 UTC"},"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}' + body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":"1","name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":123456789,"iid":"{{ git_pr_number }}","last_edited_at":"2018-03-19 00:04:33 UTC","last_edited_by_id":2127130,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"merged","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"My Merge Request edit","updated_at":"2018-03-19 00:07:53 UTC","updated_by_id":2127130,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"edit test2","timestamp":"2018-03-19T00:06:27+00:00","url":"https://gitlab.com/michael.schmid1/test/commit/3f116b9ce232c1c84ddac414abb73e985b67aee2","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"merge"},"labels":[],"changes":{"state":{"previous":"opened","current":"closed"},"updated_at":{"previous":"2018-03-19 00:06:28 UTC","current":"2018-03-19 00:07:53 UTC"},"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}' diff --git a/tests/tasks/webhook-gitlab/pullrequest-opened.yaml b/tests/tasks/webhook-gitlab/pullrequest-opened.yaml index 8c107957f1..84514f131d 100644 --- a/tests/tasks/webhook-gitlab/pullrequest-opened.yaml +++ b/tests/tasks/webhook-gitlab/pullrequest-opened.yaml @@ -7,4 +7,4 @@ method: POST follow_redirects: yes body_format: json - body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":"{{ git_pr_number }}","iid":1,"last_edited_at":null,"last_edited_by_id":null,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"opened","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"{{ git_pr_title }}","updated_at":"2018-03-19 00:01:08 UTC","updated_by_id":null,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"Add new file","timestamp":"2018-03-19T00:00:48Z","url":"https://gitlab.com/michael.schmid1/test/commit/0a4478d1f34b0e6a3d307f8be06eafdd35652f08","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"open"},"labels":[],"changes":{"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}' + body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":123456789,"iid":"{{ git_pr_number }}","last_edited_at":null,"last_edited_by_id":null,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"opened","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"{{ git_pr_title }}","updated_at":"2018-03-19 00:01:08 UTC","updated_by_id":null,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"Add new file","timestamp":"2018-03-19T00:00:48Z","url":"https://gitlab.com/michael.schmid1/test/commit/0a4478d1f34b0e6a3d307f8be06eafdd35652f08","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"open"},"labels":[],"changes":{"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}' diff --git a/tests/tasks/webhook-gitlab/pullrequest-updated.yaml b/tests/tasks/webhook-gitlab/pullrequest-updated.yaml index ee67e93cf7..5a3c401bab 100644 --- a/tests/tasks/webhook-gitlab/pullrequest-updated.yaml +++ b/tests/tasks/webhook-gitlab/pullrequest-updated.yaml @@ -7,4 +7,4 @@ method: POST follow_redirects: yes body_format: json - body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":"{{ git_pr_number }}","iid":1,"last_edited_at":null,"last_edited_by_id":null,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"opened","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"{{ git_pr_title }}","updated_at":"2018-03-19 00:01:08 UTC","updated_by_id":null,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"Add new file","timestamp":"2018-03-19T00:00:48Z","url":"https://gitlab.com/michael.schmid1/test/commit/0a4478d1f34b0e6a3d307f8be06eafdd35652f08","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"update"},"labels":[],"changes":{"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}' + body: '{"object_kind":"merge_request","user":{"name":"Michael Schmid","username":"michael.schmid1","avatar_url":"https://secure.gravatar.com/avatar/c4f5bd5f32eec798c2df7afe0040c49f?s=80\u0026d=identicon"},"project":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"{{ git_repo_ssh_url }}","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"object_attributes":{"assignee_id":null,"author_id":2127130,"created_at":"2018-03-19 00:01:08 UTC","description":"bla bla bbla","head_pipeline_id":null,"id":123456789,"iid":"{{ git_pr_number }}","last_edited_at":null,"last_edited_by_id":null,"merge_commit_sha":null,"merge_error":null,"merge_params":{"force_remove_source_branch":"0"},"merge_status":"unchecked","merge_user_id":null,"merge_when_pipeline_succeeds":false,"milestone_id":null,"source_branch":"{{ git_pr_branch }}","source_project_id":5796982,"state":"opened","target_branch":"{{ git_base_branch }}","target_project_id":5796982,"time_estimate":0,"title":"{{ git_pr_title }}","updated_at":"2018-03-19 00:01:08 UTC","updated_by_id":null,"url":"https://gitlab.com/michael.schmid1/test/merge_requests/1","source":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"target":{"id":5796982,"name":"test","description":"","web_url":"https://gitlab.com/michael.schmid1/test","avatar_url":null,"git_ssh_url":"git@gitlab.com:michael.schmid1/test.git","git_http_url":"https://gitlab.com/michael.schmid1/test.git","namespace":"michael.schmid1","visibility_level":0,"path_with_namespace":"michael.schmid1/test","default_branch":"master","ci_config_path":null,"homepage":"https://gitlab.com/michael.schmid1/test","url":"git@gitlab.com:michael.schmid1/test.git","ssh_url":"git@gitlab.com:michael.schmid1/test.git","http_url":"https://gitlab.com/michael.schmid1/test.git"},"last_commit":{"id":"{{ git_pr_commit_hash }}","message":"Add new file","timestamp":"2018-03-19T00:00:48Z","url":"https://gitlab.com/michael.schmid1/test/commit/0a4478d1f34b0e6a3d307f8be06eafdd35652f08","author":{"name":"Michael Schmid","email":"michael.schmid@amazee.com"}},"work_in_progress":false,"total_time_spent":0,"human_total_time_spent":null,"human_time_estimate":null,"action":"update"},"labels":[],"changes":{"total_time_spent":{"previous":null,"current":0}},"repository":{"name":"test","url":"git@gitlab.com:michael.schmid1/test.git","description":"","homepage":"https://gitlab.com/michael.schmid1/test"}}'