Skip to content

Add created_at to job webhooks

What does this MR do?

Related to #232887 (closed)

Tested using https://webhook.site/

Screenshots (strongly suggested)

Before

{
  "object_kind": "build",
  "ref": "root-master-patch-02048",
  "tag": false,
  "before_sha": "73e43273731cf0aa6fee618ef412572c34217d58",
  "sha": "012823f6a16195defbb74e716a17073a90ee5d7d",
  "build_id": 1031,
  "build_name": "dependency_scanning",
  "build_stage": "test",
  "build_status": "failed",
  "build_started_at": null,
  "build_finished_at": "2021-02-24T19:00:18.499Z",
  "build_duration": null,
  "build_allow_failure": true,
  "build_failure_reason": "stuck_or_timeout_failure",
  "pipeline_id": 63,
  "runner": null,
  "project_id": 2,
  "project_name": "Gitlab Org / Gitlab Shell",
  "user": {
    "id": 1,
    "name": "Administrator",
    "username": "root",
    "avatar_url": "http://127.0.0.1:3000/uploads/-/system/user/avatar/1/avatar.png",
    "email": "admin@example.com"
  },
  "commit": {
    "id": 63,
    "sha": "012823f6a16195defbb74e716a17073a90ee5d7d",
    "message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
    "author_name": "Administrator",
    "author_email": "admin@example.com",
    "author_url": "http://127.0.0.1:3000/root",
    "status": "failed",
    "duration": null,
    "started_at": null,
    "finished_at": "2021-02-24T19:00:30.391Z"
  },
  "repository": {
    "name": "Gitlab Shell",
    "url": "ssh://zamakkat@127.0.0.1:2222/gitlab-org/gitlab-shell.git",
    "description": "Sed velit voluptatem ut qui maiores id ut quae.",
    "homepage": "http://127.0.0.1:3000/gitlab-org/gitlab-shell",
    "git_http_url": "http://127.0.0.1:3000/gitlab-org/gitlab-shell.git",
    "git_ssh_url": "ssh://zamakkat@127.0.0.1:2222/gitlab-org/gitlab-shell.git",
    "visibility_level": 20
  },
  "environment": null
}

After

{
  "object_kind": "build",
  "ref": "root-master-patch-02048",
  "tag": false,
  "before_sha": "73e43273731cf0aa6fee618ef412572c34217d58",
  "sha": "012823f6a16195defbb74e716a17073a90ee5d7d",
  "build_id": 1031,
  "build_name": "dependency_scanning",
  "build_stage": "test",
  "build_status": "failed",
  "build_created_at": "2021-02-23T02:41:37.886Z",
  "build_started_at": null,
  "build_finished_at": "2021-02-24T19:00:18.499Z",
  "build_duration": null,
  "build_allow_failure": true,
  "build_failure_reason": "stuck_or_timeout_failure",
  "pipeline_id": 63,
  "runner": null,
  "project_id": 2,
  "project_name": "Gitlab Org / Gitlab Shell",
  "user": {
    "id": 1,
    "name": "Administrator",
    "username": "root",
    "avatar_url": "http://127.0.0.1:3000/uploads/-/system/user/avatar/1/avatar.png",
    "email": "admin@example.com"
  },
  "commit": {
    "id": 63,
    "sha": "012823f6a16195defbb74e716a17073a90ee5d7d",
    "message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
    "author_name": "Administrator",
    "author_email": "admin@example.com",
    "author_url": "http://127.0.0.1:3000/root",
    "status": "failed",
    "duration": null,
    "started_at": null,
    "finished_at": "2021-02-24T19:00:30.391Z"
  },
  "repository": {
    "name": "Gitlab Shell",
    "url": "ssh://zamakkat@127.0.0.1:2222/gitlab-org/gitlab-shell.git",
    "description": "Sed velit voluptatem ut qui maiores id ut quae.",
    "homepage": "http://127.0.0.1:3000/gitlab-org/gitlab-shell",
    "git_http_url": "http://127.0.0.1:3000/gitlab-org/gitlab-shell.git",
    "git_ssh_url": "ssh://zamakkat@127.0.0.1:2222/gitlab-org/gitlab-shell.git",
    "visibility_level": 20
  },
  "environment": null
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Justin Ho Tuan Duong

Merge request reports

Loading