lib/pact_broker/matrix/service.rb in pact_broker-2.23.3 vs lib/pact_broker/matrix/service.rb in pact_broker-2.23.4

- old
+ new

@@ -1,7 +1,8 @@ require 'pact_broker/repositories' require 'pact_broker/matrix/row' +require 'pact_broker/matrix/deployment_status_summary' module PactBroker module Matrix module Service @@ -15,15 +16,21 @@ def refresh_tags params, &block matrix_repository.refresh_tags(params, &block) end - def find criteria, options = {} - matrix_repository.find criteria, options + def find selectors, options = {} + query_results = matrix_repository.find selectors, options + pacticipant_names = selectors.collect{ | s| s[:pacticipant_name] } + integrations = matrix_repository.find_integrations(pacticipant_names) + deployment_status_summary = DeploymentStatusSummary.new(query_results.rows, query_results.resolved_selectors, integrations) + QueryResultsWithDeploymentStatusSummary.new(query_results.rows, query_results.selectors, query_results.options, query_results.resolved_selectors, deployment_status_summary) end def find_for_consumer_and_provider params - matrix_repository.find_for_consumer_and_provider params[:consumer_name], params[:provider_name] + selectors = [{ pacticipant_name: params[:consumer_name] }, { pacticipant_name: params[:provider_name] }] + options = { latestby: 'cvpv' } + find(selectors, options) end def find_for_consumer_and_provider_with_tags params consumer_criteria = { pacticipant_name: params[:consumer_name],