pact_broker 2.38.1 → 2.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +2 -2
- data/CHANGELOG.md +45 -0
- data/DEVELOPER_DOCUMENTATION.md +9 -0
- data/Dockerfile +2 -0
- data/Gemfile +1 -1
- data/README.md +10 -3
- data/config/database.yml +10 -2
- data/docs/images/Pactflow logo - black small.png +0 -0
- data/lib/pact_broker/api.rb +5 -2
- data/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb +41 -0
- data/lib/pact_broker/api/decorators/dashboard_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/dashboard_text_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/integration_decorator.rb +2 -0
- data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +34 -0
- data/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb +27 -0
- data/lib/pact_broker/api/resources/badge.rb +4 -4
- data/lib/pact_broker/api/resources/can_i_deploy.rb +41 -0
- data/lib/pact_broker/api/resources/dashboard.rb +1 -1
- data/lib/pact_broker/api/resources/index.rb +15 -4
- data/lib/pact_broker/api/resources/latest_pact.rb +10 -4
- data/lib/pact_broker/api/resources/latest_verification_for_latest_pact.rb +19 -0
- data/lib/pact_broker/api/resources/pact.rb +5 -4
- data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +54 -0
- data/lib/pact_broker/api/resources/verification.rb +6 -1
- data/lib/pact_broker/badges/service.rb +11 -11
- data/lib/pact_broker/db/clean.rb +72 -12
- data/lib/pact_broker/doc/controllers/app.rb +3 -1
- data/lib/pact_broker/doc/views/can-i-deploy.markdown +14 -0
- data/lib/pact_broker/doc/views/index/pacticipant-version-tag.markdown +8 -0
- data/lib/pact_broker/doc/views/integrations.markdown +1 -1
- data/lib/pact_broker/doc/views/matrix.markdown +7 -0
- data/lib/pact_broker/doc/views/metrics.markdown +5 -0
- data/lib/pact_broker/domain/index_item.rb +3 -3
- data/lib/pact_broker/domain/pact.rb +28 -1
- data/lib/pact_broker/index/service.rb +38 -20
- data/lib/pact_broker/integrations/integration.rb +16 -0
- data/lib/pact_broker/integrations/service.rb +15 -1
- data/lib/pact_broker/matrix/can_i_deploy_query_schema.rb +25 -0
- data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +29 -0
- data/lib/pact_broker/matrix/quick_row.rb +255 -0
- data/lib/pact_broker/matrix/repository.rb +5 -17
- data/lib/pact_broker/matrix/row.rb +0 -1
- data/lib/pact_broker/metrics/service.rb +36 -2
- data/lib/pact_broker/pacts/all_pact_publications.rb +3 -2
- data/lib/pact_broker/pacts/head_pact.rb +30 -0
- data/lib/pact_broker/pacts/latest_pact_publications.rb +8 -1
- data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +5 -1
- data/lib/pact_broker/pacts/pact_publication.rb +2 -1
- data/lib/pact_broker/pacts/pact_version.rb +20 -0
- data/lib/pact_broker/pacts/repository.rb +33 -4
- data/lib/pact_broker/pacts/service.rb +15 -2
- data/lib/pact_broker/pacts/squash_pacts_for_verification.rb +37 -0
- data/lib/pact_broker/pacts/verifiable_pact.rb +30 -0
- data/lib/pact_broker/pacts/verifiable_pact_messages.rb +75 -0
- data/lib/pact_broker/test/test_data_builder.rb +30 -2
- data/lib/pact_broker/ui/view_models/index_item.rb +4 -4
- data/lib/pact_broker/ui/view_models/matrix_line.rb +1 -1
- data/lib/pact_broker/ui/views/index/show-with-tags.haml +1 -1
- data/lib/pact_broker/ui/views/index/show.haml +1 -1
- data/lib/pact_broker/ui/views/matrix/show.haml +2 -2
- data/lib/pact_broker/verifications/{verification_status.rb → pseudo_branch_status.rb} +10 -4
- data/lib/pact_broker/version.rb +1 -1
- data/script/docker/mysql-db-start.sh +10 -0
- data/spec/features/can_i_deploy_spec.rb +31 -0
- data/spec/features/get_latest_verification_for_pact_spec.rb +17 -0
- data/spec/features/get_provider_pacts_for_verification_spec.rb +39 -0
- data/spec/features/metrics_spec.rb +1 -1
- data/spec/features/pending_pacts_spec.rb +109 -0
- data/spec/integration/ui/matrix_spec.rb +30 -0
- data/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb +62 -0
- data/spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb +1 -1
- data/spec/lib/pact_broker/api/decorators/integration_decorator_spec.rb +5 -1
- data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +30 -5
- data/spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb +46 -0
- data/spec/lib/pact_broker/api/resources/badge_spec.rb +3 -3
- data/spec/lib/pact_broker/api/resources/provider_pacts_for_verification_spec.rb +35 -0
- data/spec/lib/pact_broker/api/resources/verification_spec.rb +18 -0
- data/spec/lib/pact_broker/badges/service_spec.rb +18 -18
- data/spec/lib/pact_broker/db/clean_spec.rb +69 -8
- data/spec/lib/pact_broker/doc/coverage_spec.rb +8 -2
- data/spec/lib/pact_broker/index/service_spec.rb +28 -14
- data/spec/lib/pact_broker/integrations/integration_spec.rb +60 -0
- data/spec/lib/pact_broker/integrations/service_spec.rb +27 -0
- data/spec/lib/pact_broker/matrix/quick_row_spec.rb +31 -0
- data/spec/lib/pact_broker/matrix/repository_spec.rb +8 -8
- data/spec/lib/pact_broker/matrix/service_spec.rb +4 -4
- data/spec/lib/pact_broker/metrics/service_spec.rb +56 -0
- data/spec/lib/pact_broker/pacts/pact_version_spec.rb +69 -0
- data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +65 -0
- data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_spec.rb +54 -24
- data/spec/lib/pact_broker/pacts/service_find_for_verification_spec.rb +51 -0
- data/spec/lib/pact_broker/pacts/squash_pacts_for_verification_spec.rb +92 -0
- data/spec/lib/pact_broker/pacts/verifiable_pact_messages_spec.rb +93 -0
- data/spec/lib/pact_broker/pacts/verifiable_pact_spec.rb +0 -0
- data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +10 -10
- data/spec/lib/pact_broker/verifications/{verification_status_spec.rb → pseudo_branch_status_spec.rb} +4 -4
- data/spec/support/shared_examples_for_responses.rb +7 -1
- metadata +56 -13
- data/lib/pact_broker/api/resources/pending_provider_pacts.rb +0 -21
- data/spec/features/get_pacts_to_verify_spec.rb +0 -41
- data/spec/features/get_wip_provider_pacts_spec.rb +0 -26
- data/spec/lib/pact_broker/api/resources/pending_provider_pacts_spec.rb +0 -34
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'pact_broker/api/resources/latest_provider_pacts'
|
2
|
-
|
3
|
-
module PactBroker
|
4
|
-
module Api
|
5
|
-
module Resources
|
6
|
-
describe PendingProviderPacts do
|
7
|
-
before do
|
8
|
-
allow(PactBroker::Pacts::Service).to receive(:find_pending_pact_versions_for_provider).and_return(pacts)
|
9
|
-
allow(PactBroker::Api::Decorators::ProviderPactsDecorator).to receive(:new).and_return(decorator)
|
10
|
-
allow_any_instance_of(PendingProviderPacts).to receive(:resource_exists?).and_return(provider)
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:provider) { double('provider') }
|
14
|
-
let(:pacts) { double('pacts') }
|
15
|
-
let(:path) { '/pacts/provider/Bar/pending' }
|
16
|
-
let(:decorator) { instance_double('PactBroker::Api::Decorators::ProviderPactsDecorator') }
|
17
|
-
|
18
|
-
subject { get path; last_response }
|
19
|
-
|
20
|
-
it "finds the pending pacts for the provider" do
|
21
|
-
expect(PactBroker::Pacts::Service).to receive(:find_pending_pact_versions_for_provider).with("Bar")
|
22
|
-
subject
|
23
|
-
end
|
24
|
-
|
25
|
-
it "sets the correct resource title" do
|
26
|
-
expect(decorator).to receive(:to_json) do | options |
|
27
|
-
expect(options[:user_options][:title]).to eq "Pending pact versions for the provider Bar"
|
28
|
-
end
|
29
|
-
subject
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|