Skip to content

Commit dc373d7

Browse files
tcdowneysethboyles
andcommitted
Create revisions in V2 app update
Revisions will now work with `cf start` and `cf restart` [finishes #165542128](https://www.pivotaltracker.com/story/show/165542128) Co-authored-by: Tim Downey <[email protected]> Co-authored-by: Seth Boyles <[email protected]>
1 parent 1eb68e7 commit dc373d7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/actions/v2/app_update.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def start_or_stop(app, request_attrs)
115115
if request_attrs.key?('state')
116116
case request_attrs['state']
117117
when ProcessModel::STARTED
118-
AppStart.start_without_event(app, create_revision: false)
118+
AppStart.start_without_event(app)
119119
when ProcessModel::STOPPED
120120
V2::AppStop.stop(app, StagingCancel.new(@stagers))
121121
end

spec/unit/actions/v2/app_update_spec.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,16 @@ module VCAP::CloudController
132132
app.update(droplet_guid: droplet.guid)
133133
end
134134

135-
it 'does not create a revision' do
135+
it 'creates a revision' do
136136
app.update(revisions_enabled: true)
137137

138138
request_attrs = {
139139
'state' => ProcessModel::STARTED,
140140
}
141141

142142
app_update.update(app, process, request_attrs)
143-
expect(app.reload.revisions.count).to eq(0)
143+
expect(app.reload.revisions.count).to eq(1)
144+
expect(app.latest_revision.droplet_guid).to eq(droplet.guid)
144145
end
145146
end
146147

0 commit comments

Comments
 (0)