Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/presenters/v3/deployment_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def to_hash
guid: deployment.guid,
created_at: deployment.created_at,
updated_at: deployment.updated_at,
state: deployment.state,
status: {
value: deployment.status_value,
reason: deployment.status_reason,
Expand Down
2 changes: 0 additions & 2 deletions docs/v3/source/includes/api_resources/_deployments.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

{
"guid": "59c3d133-2b83-46f3-960e-7765a129aea4",
"state": "DEPLOYING",
"status": {
"value": "ACTIVE",
"reason": "DEPLOYING",
Expand Down Expand Up @@ -72,7 +71,6 @@
"resources": [
{
"guid": "59c3d133-2b83-46f3-960e-7765a129aea4",
"state": "DEPLOYED",
"status": {
"value": "FINALIZED",
"reason": "DEPLOYED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Name | Type | Description
**guid** | _uuid_ | Unique identifier for the deployment
**created_at** | _[timestamp](#timestamps)_ | The time with zone when the object was created
**updated_at** | _[timestamp](#timestamps)_ | The time with zone when the object was last updated
**state** | _string_ | **(deprecated)** This field will be removed in the future; use the `status` fields to determine deployment state instead
**status.value** | _string_ | The current status of the deployment; valid values are `ACTIVE` (meaning in progress) and `FINALIZED` (meaning finished, either successfully or not)
**status.reason** | _string_ | The reason for the status of the deployment;<br>following list represents valid values:<br>1. If **status.value** is `ACTIVE`<br>- `DEPLOYING`<br>- `CANCELING`<br>2. If **status.value** is `FINALIZED`<br>- `DEPLOYED`<br>- `CANCELED`<br>- `SUPERSEDED` (another deployment created for app before completion)<br>- `DEGENERATE` (the deployment was created incorrectly by the system)
**status.details** | _object_ | The details for the status of the deployment shows a timestamp of the last successful healthcheck
Expand Down
24 changes: 1 addition & 23 deletions spec/request/deployments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -116,7 +115,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -198,7 +196,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -316,7 +313,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -393,7 +389,6 @@
parsed_response = MultiJson.load(last_response.body)
expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -473,7 +468,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYED_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYED_STATUS_REASON,
Expand Down Expand Up @@ -638,7 +632,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -698,7 +691,6 @@

expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -815,7 +807,6 @@
parsed_response = MultiJson.load(last_response.body)
expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -877,7 +868,6 @@
parsed_response = MultiJson.load(last_response.body)
expect(parsed_response).to be_a_response_like({
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -986,10 +976,9 @@
status_reason: VCAP::CloudController::DeploymentModel::SUPERSEDED_STATUS_REASON)
}

def json_for_deployment(deployment, app_model, droplet, state, status_value, status_reason, cancel_link=true)
def json_for_deployment(deployment, app_model, droplet, status_value, status_reason, cancel_link=true)
{
guid: deployment.guid,
state: state,
status: {
value: status_value,
reason: status_reason,
Expand Down Expand Up @@ -1063,11 +1052,9 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
},
resources: [
json_for_deployment(deployment, app_model, droplet,
VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON),
json_for_deployment(deployment2, app2, droplet2,
VCAP::CloudController::DeploymentModel::CANCELING_STATE,
VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::CANCELING_STATUS_REASON),
]
Expand All @@ -1086,19 +1073,16 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
code: 200,
response_objects: [
json_for_deployment(deployment3, app3, droplet3,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATE,
VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATUS_REASON,
false
),
json_for_deployment(deployment4, app4, droplet4,
VCAP::CloudController::DeploymentModel::CANCELED_STATE,
VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::CANCELED_STATUS_REASON,
false
),
json_for_deployment(deployment5, app5, droplet5,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATE,
VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::SUPERSEDED_STATUS_REASON,
false
Expand Down Expand Up @@ -1143,13 +1127,11 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
code: 200,
response_objects: [
json_for_deployment(deployment3, app3, droplet3,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATE,
VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATUS_REASON,
false
),
json_for_deployment(deployment5, app5, droplet5,
VCAP::CloudController::DeploymentModel::DEPLOYED_STATE,
VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::SUPERSEDED_STATUS_REASON,
false
Expand Down Expand Up @@ -1194,7 +1176,6 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
code: 200,
response_objects: [
json_for_deployment(deployment, app_model, droplet,
VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON),
]
Expand Down Expand Up @@ -1300,7 +1281,6 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
'resources' => [
{
'guid' => deployment.guid,
'state' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATE,
'status' => {
'value' => VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE,
'reason' => VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON,
Expand Down Expand Up @@ -1373,7 +1353,6 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta

expect(last_response.body).to be_empty
deployment.reload
expect(deployment.state).to eq(VCAP::CloudController::DeploymentModel::CANCELING_STATE)
expect(deployment.status_value).to eq(VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE)
expect(deployment.status_reason).to eq(VCAP::CloudController::DeploymentModel::CANCELING_STATUS_REASON)

Expand All @@ -1382,7 +1361,6 @@ def json_for_deployment(deployment, app_model, droplet, state, status_value, sta
require 'cloud_controller/deployment_updater/scheduler'
VCAP::CloudController::DeploymentUpdater::Updater.new(deployment, Steno.logger('blah')).cancel
deployment.reload
expect(deployment.state).to eq(VCAP::CloudController::DeploymentModel::CANCELED_STATE)
expect(deployment.status_value).to eq(VCAP::CloudController::DeploymentModel::FINALIZED_STATUS_VALUE)
expect(deployment.status_reason).to eq(VCAP::CloudController::DeploymentModel::CANCELED_STATUS_REASON)
end
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/presenters/v3/deployment_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module VCAP::CloudController::Presenters::V3
result = DeploymentPresenter.new(deployment).to_hash
expect(result[:guid]).to eq(deployment.guid)

expect(result[:state]).to eq(VCAP::CloudController::DeploymentModel::DEPLOYING_STATE)
expect(result[:status][:value]).to eq(VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE)
expect(result[:status][:reason]).to eq(VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON)
expect(result[:status][:details][:last_successful_healthcheck]).to eq('2019-07-12 19:01:54')
Expand Down Expand Up @@ -71,7 +70,6 @@ module VCAP::CloudController::Presenters::V3
result = DeploymentPresenter.new(deployment).to_hash
expect(result[:guid]).to eq(deployment.guid)

expect(result[:state]).to eq(VCAP::CloudController::DeploymentModel::DEPLOYING_STATE)
expect(result[:status][:value]).to eq(VCAP::CloudController::DeploymentModel::ACTIVE_STATUS_VALUE)
expect(result[:status][:reason]).to eq(VCAP::CloudController::DeploymentModel::DEPLOYING_STATUS_REASON)

Expand Down