|
| 1 | +--- |
| 2 | +kind: change |
| 3 | +title: Deployment webhook payload changes |
| 4 | +created_at: 2014-10-21 |
| 5 | +author_name: atmos |
| 6 | +--- |
| 7 | + |
| 8 | +On November 4th, 2014, we will begin sending a new format for [deployment][1] and [deployment status][2] payloads for webhooks. In the meantime we'll be running in a compatability mode that will give integrators the time needed to start taking advantage of the new format. Integrators who are working with webhooks and deployments are advised to upgrade to the new payload format to avoid service interruption. |
| 9 | + |
| 10 | +This change brings the payloads for these events more inline with the responses you'd receive from the API. Instead of having deployment and deployment status attributes as top-level keys, we will now nest them under `deployment` and `deployment_status` keys. Since we're still in the [preview period][3] for the deployments API we felt it was best to correct this inconsistency now. |
| 11 | + |
| 12 | +## DeploymentEvent Changes |
| 13 | + |
| 14 | +#### Old Format |
| 15 | + |
| 16 | +<pre><code class="language-javascript"> |
| 17 | +{ |
| 18 | + "id": 42, |
| 19 | + "sha": "deadbeef", |
| 20 | + "ref": "master", |
| 21 | + "task": "deploy", |
| 22 | + "name": "my-org/our-app", |
| 23 | + "environment": "production", |
| 24 | + "payload": {…}, |
| 25 | + "description": "Deploying master", |
| 26 | + "repository": {…}, |
| 27 | + "sender": {…} |
| 28 | +} |
| 29 | + |
| 30 | +</code></pre> |
| 31 | + |
| 32 | +#### Current Format - 2014/10/22 |
| 33 | + |
| 34 | +<pre><code class="language-javascript"> |
| 35 | +{ |
| 36 | + "id": 42, |
| 37 | + "sha": "deadbeef", |
| 38 | + "ref": "master", |
| 39 | + "task": "deploy", |
| 40 | + "name": "my-org/our-app", |
| 41 | + "environment": "production", |
| 42 | + "payload": {…}, |
| 43 | + "description": "Deploying master", |
| 44 | + "repository": {…}, |
| 45 | + "deployment": { |
| 46 | + "url": "https://api.github.com/repos/my-org/our-app/deployments/42", |
| 47 | + "id": 42, |
| 48 | + "sha": "deadbeef", |
| 49 | + "ref": "master", |
| 50 | + "task": "deploy", |
| 51 | + "name": "my-org/our-app", |
| 52 | + "environment": "production", |
| 53 | + "payload": {…}, |
| 54 | + "description": "Deploying master", |
| 55 | + "creator": {…}, |
| 56 | + "created_at": "2014-09-23T16:37:49Z", |
| 57 | + "updated_at": "2014-09-23T16:37:49Z", |
| 58 | + "statuses_url": "https://api.github.com/repos/my-org/our-app/deployments/42/statuses" |
| 59 | + }, |
| 60 | + "sender": {…} |
| 61 | +} |
| 62 | + |
| 63 | +</code></pre> |
| 64 | + |
| 65 | +#### New Format - 2014/11/05 |
| 66 | + |
| 67 | +<pre><code class="language-javascript"> |
| 68 | +{ |
| 69 | + "deployment": { |
| 70 | + "url": "https://api.github.com/repos/my-org/our-app/deployments/42", |
| 71 | + "id": 42, |
| 72 | + "sha": "deadbeef", |
| 73 | + "ref": "master", |
| 74 | + "task": "deploy", |
| 75 | + "name": "my-org/our-app", |
| 76 | + "environment": "production", |
| 77 | + "payload": {…}, |
| 78 | + "description": "Deploying master", |
| 79 | + "creator": {…}, |
| 80 | + "created_at": "2014-09-23T16:37:49Z", |
| 81 | + "updated_at": "2014-09-23T16:37:49Z", |
| 82 | + "statuses_url": "https://api.github.com/repos/my-org/our-app/deployments/42/statuses" |
| 83 | + }, |
| 84 | + "repository": {…}, |
| 85 | + "sender": {…} |
| 86 | +} |
| 87 | +</code></pre> |
| 88 | + |
| 89 | +## DeploymentStatusEvent Changes |
| 90 | + |
| 91 | +#### Old Format |
| 92 | + |
| 93 | +<pre><code class="language-javascript"> |
| 94 | +{ |
| 95 | + "id": 2600, |
| 96 | + "state": "success", |
| 97 | + "deployment": {…}, |
| 98 | + "target_url": "https://gist.github.com/deadbeef", |
| 99 | + "description": "Deployment was successful", |
| 100 | + "repository": {…}, |
| 101 | + "sender": {…} |
| 102 | +} |
| 103 | +</code></pre> |
| 104 | + |
| 105 | +#### Current Format - 2014/10/22 |
| 106 | + |
| 107 | +<pre><code class="language-javascript"> |
| 108 | +{ |
| 109 | + "id": 2600, |
| 110 | + "state": "success", |
| 111 | + "target_url": "https://gist.github.com/deadbeef", |
| 112 | + "description": "Deployment was successful", |
| 113 | + "repository": {…}, |
| 114 | + "deployment_status": { |
| 115 | + "url": "https://api.github.com/repos/my-org/our-app/deployments/42/statuses2600", |
| 116 | + "id": 2600, |
| 117 | + "state": "success", |
| 118 | + "creator": {…}, |
| 119 | + "target_url": "https://gist.github.com/deadbeef", |
| 120 | + "description": "Deployment was successful", |
| 121 | + "created_at": "2014-09-23T16:45:49Z", |
| 122 | + "updated_at": "2014-09-23T16:45:49Z", |
| 123 | + "deployment_url": "https://api.github.com/repos/my-org/our-app/deployments/42", |
| 124 | + "repository_url": "https://api.github.com/repos/my-org/our-app" |
| 125 | + }, |
| 126 | + "deployment": {…}, |
| 127 | + "sender": {…} |
| 128 | +} |
| 129 | +</code></pre> |
| 130 | + |
| 131 | +#### New Format - 2014/11/05 |
| 132 | + |
| 133 | +<pre><code class="language-javascript"> |
| 134 | +{ |
| 135 | + "deployment_status": { |
| 136 | + "url": "https://api.github.com/repos/my-org/our-app/deployments/42/statuses2600", |
| 137 | + "id": 2600, |
| 138 | + "state": "success", |
| 139 | + "creator": {…}, |
| 140 | + "target_url": "https://gist.github.com/deadbeef", |
| 141 | + "description": "Deployment was successful", |
| 142 | + "created_at": "2014-09-23T16:45:49Z", |
| 143 | + "updated_at": "2014-09-23T16:45:49Z", |
| 144 | + "deployment_url": "https://api.github.com/repos/my-org/our-app/deployments/42", |
| 145 | + "repository_url": "https://api.github.com/repos/my-org/our-app" |
| 146 | + }, |
| 147 | + "deployment": {…}, |
| 148 | + "repository": {…}, |
| 149 | + "sender": {…} |
| 150 | +} |
| 151 | +</code></pre> |
| 152 | + |
| 153 | +If you have any questions or feedback, please [get in touch][get-in-touch]. |
| 154 | + |
| 155 | +[1]: https://developer.github.com/v3/activity/events/types/#deploymentevent |
| 156 | +[2]: https://developer.github.com/v3/activity/events/types/#deploymentstatusevent |
| 157 | +[3]: https://developer.github.com/changes/2014-01-09-preview-the-new-deployments-api/ |
| 158 | +[get-in-touch]: https://github.com/contact?form[subject]=Deployments+API |
0 commit comments