atmos/heaven — pull request #84 by atmos (2014-09-18 19:00:22+00:00)
Title: New deployment payloads

We're going to be modifying the deployment payload webhook format to have a top-level key for deployment and deployment_status payloads. It's going to look this.

Proposed Deployment Payload Changes
===================================

DeploymentEvent paylods
-----------------------

#### Existing

```ruby
{
:id => @deployment.id,
:sha => @deployment.sha,
:ref => @deployment.ref,
:task => @deployment.task,
:name => @deployment.repository.name_with_owner,
:environment => @deployment.environment,
:payload => @deployment.json_payload,
:description => @deployment.description,
:repository => {…},
:sender => {…}
}
```

#### Proposed

```ruby
{
:deployment => {
:url => url(deployment_url),
:id => deployment.id,
:sha => deployment.sha,
:ref => deployment.ref,
:task => deployment.task,
:payload => deployment.json_payload,
:environment => deployment.environment,
:description => deployment.description,
:creator => user_hash(deployment.creator),
:created_at => time(deployment.created_at),
:updated_at => time(deployment.updated_at),
:statuses_url => url("#{deployment_url}/statuses"),
:repository_url => url(repository_url)
},
:repository => {…},
:sender => {…}
```

DeploymentStatusEvent paylods
-----------------------

#### Existing

```ruby
{
:id => @deployment_status.id,
:state => state,
:deployment => deployment_hash(deployment), # Same as proposed format for deployment above
:target_url => target_url,
:description => description,
:repository => {…},
:sender => {…}
}
```

#### Proposed

```ruby
{
:deployment_status => {
:url => url(status_url),
:id => deployment_status.id,
:state => deployment_status.state,
:creator => user_hash(deployment_status.creator),
:description => deployment_status.description,
:target_url => deployment_status.target_url,
:created_at => time(deployment_status.created_at),
:updated_at => time(deployment_status.updated_at),
:deployment_url => url(deployment_url),
:repository_url => url(repository_url)
},
:deployment => {…}, # Same as proposed above
:repository => {…},
:sender => {…}
}
```