Skip to content

Commit

Permalink
chore: add logging for matrix and pacts for verification selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 1, 2020
1 parent d12ef80 commit 5d52aaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def resource_title
end

def to_json
log_request
PactBroker::Api::Decorators::VerifiablePactsDecorator.new(pacts).to_json(
decorator_options(
include_pending_status: parsed_query_params.include_pending_status,
Expand Down Expand Up @@ -82,6 +83,11 @@ def query
end
end
end

def log_request
parameters = request.get? ? query : params
logger.info "Fetching pacts for verification by #{provider_name}", provider_name: provider_name, params: parameters
end
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions lib/pact_broker/matrix/service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'pact_broker/logging'
require 'pact_broker/repositories'
require 'pact_broker/matrix/row'
require 'pact_broker/matrix/deployment_status_summary'
Expand All @@ -9,8 +10,10 @@ module Service
extend self
extend PactBroker::Repositories
extend PactBroker::Services
include PactBroker::Logging

def find selectors, options = {}
logger.info "Querying matrix", selectors: selectors, options: 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, deployment_status_summary)
Expand Down

0 comments on commit 5d52aaa

Please sign in to comment.