Skip to content

Commit 3008140

Browse files
committed
feat: move pb:wip-provider-pacts to beta:wip-provider-pacts
1 parent f4a03c0 commit 3008140

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

lib/pact_broker/api.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ module PactBroker
4141
add ['pacts', 'provider', :provider_name, 'latest', :tag], Api::Resources::LatestProviderPacts, {resource_name: "latest_tagged_provider_pact_publications"}
4242
add ['pacts', 'latest'], Api::Resources::LatestPacts, {resource_name: "latest_pacts"}
4343

44-
if PactBroker.feature_enabled?(:wip_pacts)
45-
add ['pacts', 'provider', :provider_name, 'wip'], Api::Resources::WipProviderPacts, {resource_name: "wip_provider_pact_publications"}
46-
end
44+
# WIP pacts
45+
add ['pacts', 'provider', :provider_name, 'wip'], Api::Resources::WipProviderPacts, {resource_name: "wip_provider_pact_publications"}
4746

4847
# Deprecated pact
4948
add ['pact', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number], Api::Resources::Pact, {resource_name: "pact_publications", deprecated: "true"} # Deprecate, singular /pact

lib/pact_broker/api/resources/index.rb

+11-9
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ def links
6868
title: 'All pact versions for the specified provider',
6969
templated: true
7070
},
71-
'pb:wip-provider-pacts' =>
72-
{
73-
href: base_url + '/pacts/provider/{provider}/wip',
74-
title: 'WIP pact versions for the specified provider',
75-
templated: true
76-
},
7771
'pb:latest-version' => {
7872
href: base_url + '/pacticipants/{pacticipant}/latest-version',
7973
title: 'Latest pacticipant version',
@@ -89,15 +83,23 @@ def links
8983
title: 'Webhooks',
9084
templated: false
9185
},
86+
'beta:wip-provider-pacts' =>
87+
{
88+
href: base_url + '/pacts/provider/{provider}/wip',
89+
title: 'WIP pact versions for the specified provider',
90+
templated: true
91+
},
9292
'curies' =>
9393
[{
9494
name: 'pb',
9595
href: base_url + '/doc/{rel}?context=index',
9696
templated: true
97+
},{
98+
name: 'beta',
99+
href: base_url + '/doc/{rel}?context=index',
100+
templated: true
97101
}]
98-
}.tap do | it |
99-
it.delete('pb:wip-provider-pacts') if ENV['RACK_ENV'] == 'production'
100-
end
102+
}
101103
end
102104
end
103105
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Work In Progress Pacts
2+
3+
This feature is in beta. It allows WIP pacts (pacts that have not yet been succesfully verified) to run against a provider without failing the build.

spec/service_consumers/provider_states_for_pact_ruby.rb

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
no_op
77
end
88

9+
provider_state "the relation for retrieving WIP pacts exists in the index resource" do
10+
no_op
11+
end
12+
13+
provider_state "consumer-1 has a WIP pact with provider provider-1" do
14+
set_up do
15+
TestDataBuilder.new
16+
.create_provider('provider-1')
17+
.create_consumer('consumer-1')
18+
.create_consumer_version('1.3.0')
19+
.create_pact
20+
end
21+
end
22+
923
provider_state 'consumer-1 and consumer-2 have pacts with provider provider-1' do
1024
set_up do
1125
TestDataBuilder.new

0 commit comments

Comments
 (0)