Skip to content

Resolve "Webhooks do not show when Discussion Lock changes"

What does this MR do?

This MR adds into the Webhook data the field: discussion_locked

Screenshots

Before

{
    "object_kind": "issue",
    "event_type": "issue",
    "user": {
        "name": "Administrator",
        "username": "root",
        "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "email": "admin@example.com"
    },
    "project": {
        "id": 8,
        "name": "Html5 Boilerplate",
        "description": "Sit commodi ipsum molestias aut.",
        "web_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate",
        "avatar_url": null,
        "git_ssh_url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "git_http_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate.git",
        "namespace": "H5bp",
        "visibility_level": 20,
        "path_with_namespace": "h5bp/html5-boilerplate",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "http://127.0.0.1:3000/h5bp/html5-boilerplate",
        "url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "ssh_url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "http_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate.git"
    },
    "object_attributes": {
        "author_id": 14,
        "closed_at": null,
        "confidential": false,
        "created_at": "2020-03-22 16:14:17 UTC",
        "description": "Aliquid ut officiis architecto est id ab nostrum.",
        "due_date": null,
        "id": 75,
        "iid": 8,
        "last_edited_at": null,
        "last_edited_by_id": null,
        "milestone_id": 37,
        "moved_to_id": null,
        "duplicated_to_id": null,
        "project_id": 8,
        "relative_position": 1073745823,
        "state_id": 1,
        "time_estimate": 0,
        "title": "Minus adipisci mollitia dolores commodi odit earum aut temporibus beatae.",
        "updated_at": "2020-03-25 14:38:55 UTC",
        "updated_by_id": 1,
        "weight": null,
        "url": "http://127.0.0.1:3000/h5bp/html5-boilerplate/-/issues/8",
        "total_time_spent": 0,
        "human_total_time_spent": null,
        "human_time_estimate": null,
        "assignee_ids": [
            12
        ],
        "assignee_id": 12,
        "labels": [
            {
                "id": 62,
                "title": "Bruffe",
                "color": "#c9d1d3",
                "project_id": null,
                "created_at": "2020-03-21 16:13:59 UTC",
                "updated_at": "2020-03-21 16:13:59 UTC",
                "template": false,
                "description": null,
                "type": "GroupLabel",
                "group_id": 28
            },
            {
                "id": 64,
                "title": "Brynewood",
                "color": "#e5ab00",
                "project_id": null,
                "created_at": "2020-03-21 16:13:59 UTC",
                "updated_at": "2020-03-21 16:13:59 UTC",
                "template": false,
                "description": null,
                "type": "GroupLabel",
                "group_id": 28
            },
            {
                "id": 105,
                "title": "Cavalier",
                "color": "#0315c6",
                "project_id": 8,
                "created_at": "2020-03-21 16:14:00 UTC",
                "updated_at": "2020-03-21 16:14:00 UTC",
                "template": false,
                "description": null,
                "type": "ProjectLabel",
                "group_id": null
            }
        ],
        "state": "opened",
        "action": "update"
    },
    "labels": [
        {
            "id": 62,
            "title": "Bruffe",
            "color": "#c9d1d3",
            "project_id": null,
            "created_at": "2020-03-21 16:13:59 UTC",
            "updated_at": "2020-03-21 16:13:59 UTC",
            "template": false,
            "description": null,
            "type": "GroupLabel",
            "group_id": 28
        },
        {
            "id": 64,
            "title": "Brynewood",
            "color": "#e5ab00",
            "project_id": null,
            "created_at": "2020-03-21 16:13:59 UTC",
            "updated_at": "2020-03-21 16:13:59 UTC",
            "template": false,
            "description": null,
            "type": "GroupLabel",
            "group_id": 28
        },
        {
            "id": 105,
            "title": "Cavalier",
            "color": "#0315c6",
            "project_id": 8,
            "created_at": "2020-03-21 16:14:00 UTC",
            "updated_at": "2020-03-21 16:14:00 UTC",
            "template": false,
            "description": null,
            "type": "ProjectLabel",
            "group_id": null
        }
    ],
    "changes": {
        "updated_at": {
            "previous": "2020-03-24 15:53:50 UTC",
            "current": "2020-03-25 14:38:55 UTC"
        }
    },
    "repository": {
        "name": "Html5 Boilerplate",
        "url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "description": "Sit commodi ipsum molestias aut.",
        "homepage": "http://127.0.0.1:3000/h5bp/html5-boilerplate"
    },
    "assignees": [
        {
            "name": "Miguelina Rohan",
            "username": "darcy",
            "avatar_url": "https://www.gravatar.com/avatar/23d86788073f85c61e2ca622cd32ef00?s=80&d=identicon",
            "email": "vernon@batzdare.name"
        }
    ]
}

After


{
    "object_kind": "issue",
    "event_type": "issue",
    "user": {
        "name": "Administrator",
        "username": "root",
        "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
        "email": "admin@example.com"
    },
    "project": {
        "id": 8,
        "name": "Html5 Boilerplate",
        "description": "Sit commodi ipsum molestias aut.",
        "web_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate",
        "avatar_url": null,
        "git_ssh_url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "git_http_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate.git",
        "namespace": "H5bp",
        "visibility_level": 20,
        "path_with_namespace": "h5bp/html5-boilerplate",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "http://127.0.0.1:3000/h5bp/html5-boilerplate",
        "url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "ssh_url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "http_url": "http://127.0.0.1:3000/h5bp/html5-boilerplate.git"
    },
    "object_attributes": {
        "author_id": 14,
        "closed_at": null,
        "confidential": false,
        "created_at": "2020-03-22 16:14:17 UTC",
        "description": "Aliquid ut officiis architecto est id ab nostrum.",
        "discussion_locked": true,
        "due_date": null,
        "id": 75,
        "iid": 8,
        "last_edited_at": null,
        "last_edited_by_id": null,
        "milestone_id": 37,
        "moved_to_id": null,
        "duplicated_to_id": null,
        "project_id": 8,
        "relative_position": 1073745823,
        "state_id": 1,
        "time_estimate": 0,
        "title": "Minus adipisci mollitia dolores commodi odit earum aut temporibus beatae.",
        "updated_at": "2020-03-25 14:49:48 UTC",
        "updated_by_id": 1,
        "weight": null,
        "url": "http://127.0.0.1:3000/h5bp/html5-boilerplate/-/issues/8",
        "total_time_spent": 0,
        "human_total_time_spent": null,
        "human_time_estimate": null,
        "assignee_ids": [
            12
        ],
        "assignee_id": 12,
        "labels": [
            {
                "id": 62,
                "title": "Bruffe",
                "color": "#c9d1d3",
                "project_id": null,
                "created_at": "2020-03-21 16:13:59 UTC",
                "updated_at": "2020-03-21 16:13:59 UTC",
                "template": false,
                "description": null,
                "type": "GroupLabel",
                "group_id": 28
            },
            {
                "id": 64,
                "title": "Brynewood",
                "color": "#e5ab00",
                "project_id": null,
                "created_at": "2020-03-21 16:13:59 UTC",
                "updated_at": "2020-03-21 16:13:59 UTC",
                "template": false,
                "description": null,
                "type": "GroupLabel",
                "group_id": 28
            },
            {
                "id": 105,
                "title": "Cavalier",
                "color": "#0315c6",
                "project_id": 8,
                "created_at": "2020-03-21 16:14:00 UTC",
                "updated_at": "2020-03-21 16:14:00 UTC",
                "template": false,
                "description": null,
                "type": "ProjectLabel",
                "group_id": null
            }
        ],
        "state": "opened",
        "action": "update"
    },
    "labels": [
        {
            "id": 62,
            "title": "Bruffe",
            "color": "#c9d1d3",
            "project_id": null,
            "created_at": "2020-03-21 16:13:59 UTC",
            "updated_at": "2020-03-21 16:13:59 UTC",
            "template": false,
            "description": null,
            "type": "GroupLabel",
            "group_id": 28
        },
        {
            "id": 64,
            "title": "Brynewood",
            "color": "#e5ab00",
            "project_id": null,
            "created_at": "2020-03-21 16:13:59 UTC",
            "updated_at": "2020-03-21 16:13:59 UTC",
            "template": false,
            "description": null,
            "type": "GroupLabel",
            "group_id": 28
        },
        {
            "id": 105,
            "title": "Cavalier",
            "color": "#0315c6",
            "project_id": 8,
            "created_at": "2020-03-21 16:14:00 UTC",
            "updated_at": "2020-03-21 16:14:00 UTC",
            "template": false,
            "description": null,
            "type": "ProjectLabel",
            "group_id": null
        }
    ],
    "changes": {
        "discussion_locked": {
            "previous": false,
            "current": true
        },
        "updated_at": {
            "previous": "2020-03-25 14:38:55 UTC",
            "current": "2020-03-25 14:49:48 UTC"
        }
    },
    "repository": {
        "name": "Html5 Boilerplate",
        "url": "ssh://tjp@127.0.0.1:2222/h5bp/html5-boilerplate.git",
        "description": "Sit commodi ipsum molestias aut.",
        "homepage": "http://127.0.0.1:3000/h5bp/html5-boilerplate"
    },
    "assignees": [
        {
            "name": "Miguelina Rohan",
            "username": "darcy",
            "avatar_url": "https://www.gravatar.com/avatar/23d86788073f85c61e2ca622cd32ef00?s=80&d=identicon",
            "email": "vernon@batzdare.name"
        }
    ]
}

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

Closes #212452 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports