<commit_before>require 'pact_broker/repositories'
require 'pact_broker/matrix/row'
require 'pact_broker/matrix/deployment_status_summary'

module PactBroker
  module Matrix
    module Service

      extend self
      extend PactBroker::Repositories
      extend PactBroker::Services

      def find selectors, options = {}
        query_results = matrix_repository.find selectors, options
        deployment_status_summary = DeploymentStatusSummary.new(query_results.rows, query_results.resolved_selectors, query_results.integrations)
        QueryResultsWithDeploymentStatusSummary.new(query_results.rows, query_results.selectors, query_results.options, query_results.resolved_selectors, query_results.integrations, deployment_status_summary)
      end

      def find_for_consumer_and_provider params, options = {}
        selectors = [{ pacticipant_name: params[:consumer_name] }, { pacticipant_name: params[:provider_name] }]
        default_options = { latestby: 'cvpv' }
        find(selectors, default_options.merge(options))
      end

      def find_for_consumer_and_provider_with_tags params
        consumer_criteria = {
          pacticipant_name: params[:consumer_name],
          tag: params[:tag],
          latest: true
        }<commit_msg>feat(matrix): do not default to latestby=cvpv for consumer/provider matrix<commit_after>require 'pact_broker/repositories'
require 'pact_broker/matrix/row'
require 'pact_broker/matrix/deployment_status_summary'

module PactBroker
  module Matrix
    module Service

      extend self
      extend PactBroker::Repositories
      extend PactBroker::Services

      def find selectors, options = {}
        query_results = matrix_repository.find selectors, options
        deployment_status_summary = DeploymentStatusSummary.new(query_results.rows, query_results.resolved_selectors, query_results.integrations)
        QueryResultsWithDeploymentStatusSummary.new(query_results.rows, query_results.selectors, query_results.options, query_results.resolved_selectors, query_results.integrations, deployment_status_summary)
      end

      def find_for_consumer_and_provider params, options = {}
        selectors = [{ pacticipant_name: params[:consumer_name] }, { pacticipant_name: params[:provider_name] }]
        find(selectors, options)
      end

      def find_for_consumer_and_provider_with_tags params
        consumer_criteria = {
          pacticipant_name: params[:consumer_name],
          tag: params[:tag],
          latest: true
        }
{'fraction_non_alphanumeric': 0.07265469061876248, 'fraction_numerical': 0.0, 'mean_word_length': 4.103869653767821, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3810089', 'n_tokens_mistral': 713, 'n_tokens_neox': 691, 'n_words': 129}