Commit def00fea authored by İsmail Arılık's avatar İsmail Arılık

Add deployment_id to deployment payloads

`deployment_id` is included  in the webhook payload for deployments.
This will allow users to identify the deployment directly,
without going through the deployable object.

Changelog: changed
parent 65b4b26f
......@@ -1396,6 +1396,7 @@ X-Gitlab-Event: Deployment Hook
"object_kind": "deployment",
"status": "success",
"status_changed_at":"2021-04-28 21:50:00 +0200",
"deployment_id": 15,
"deployable_id": 796,
"deployable_url": "http://10.126.0.2:3000/root/test-deployment-webhooks/-/jobs/796",
"environment": "staging",
......
......@@ -16,6 +16,7 @@ module Gitlab
object_kind: 'deployment',
status: deployment.status,
status_changed_at: status_changed_at,
deployment_id: deployment.id,
deployable_id: deployment.deployable_id,
deployable_url: deployable_url,
environment: deployment.environment.name,
......
......@@ -27,6 +27,7 @@ RSpec.describe Gitlab::DataBuilder::Deployment do
expect(data[:status]).to eq('failed')
expect(data[:status_changed_at]).to eq(status_changed_at)
expect(data[:deployment_id]).to eq(deployment.id)
expect(data[:deployable_id]).to eq(deployable.id)
expect(data[:deployable_url]).to eq(expected_deployable_url)
expect(data[:environment]).to eq("somewhere")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment