Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 5dd3863

Browse files
v3: API client sees an error when trying to generate a diff for a future manifest version
[finishes #173478928] Co-authored-by: James Palmer <jpalmer@pivotal.io> Co-authored-by: Merric de Launey <mdelauney@pivotal.io>
1 parent 080a393 commit 5dd3863

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

docs/v3/source/includes/resources/manifests/_create_diff.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Content-Type: application/json
4141
}
4242
```
4343

44-
Create a manifest diff for apps in the provided manifest and their underlying processes.
44+
Create a manifest diff for apps in the provided manifest and their underlying processes. Currently manifest_diff only supports version 1 manifests.
4545

4646
#### Definition
4747
`GET /v3/spaces/:guid/manifest_diff`

spec/request/space_manifests_spec.rb

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@
529529

530530
let(:yml_manifest) do
531531
{
532+
'version' => 1,
532533
'applications' => [
533534
{
534535
'name' => app1_model.name,
@@ -572,7 +573,6 @@
572573
end
573574
it_behaves_like 'permissions for single object endpoint', ALL_PERMISSIONS
574575
end
575-
576576
context 'the manifest is unparseable' do
577577
let(:yml_manifest) do
578578
{
@@ -597,6 +597,31 @@
597597
expect(parsed_response['errors'].first['detail']).to eq('The request is invalid')
598598
end
599599
end
600+
context 'the manifest is a not supported version' do
601+
let(:yml_manifest) do
602+
{
603+
'version' => 1234567,
604+
'applications' => [
605+
{
606+
'name' => 'new-app',
607+
},
608+
]
609+
}.to_yaml
610+
end
611+
612+
before do
613+
space.organization.add_user(user)
614+
space.add_developer(user)
615+
end
616+
617+
it 'returns an appropriate error' do
618+
post "/v3/spaces/#{space.guid}/manifest_diff", yml_manifest, yml_headers(user_header)
619+
parsed_response = MultiJson.load(last_response.body)
620+
621+
expect(last_response).to have_status_code(422)
622+
expect(parsed_response['errors'].first['detail']).to eq('Unsupported manifest schema version. Currently supported versions: [1].')
623+
end
624+
end
600625
context 'the space does not exist' do
601626
let(:yml_manifest) do
602627
{

0 commit comments

Comments
 (0)