Skip to content

Commit

Permalink
chore: log details of contract publication
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Aug 2, 2023
1 parent 92a8396 commit 5136faf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/pact_broker/contracts/contracts_to_publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ def self.from_hash(pacticipant_name: nil, pacticipant_version_number: nil, tags:
def pacticipant_names
contracts.flat_map(&:pacticipant_names).uniq
end

def provider_names
contracts.flat_map(&:provider_name).uniq
end

def logging_info
to_h.slice(:pacticipant_name, :pacticipant_version_number, :tags, :branch, :build_url).merge(provider_names: provider_names)
end
end
end
end
1 change: 1 addition & 0 deletions lib/pact_broker/contracts/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def triggered_webhooks_created_for_event(params)
end

def publish(parsed_contracts, base_url: )
logger.info("Publishing contracts", parsed_contracts.logging_info)
version, version_notices = create_version(parsed_contracts)
tags = create_tags(parsed_contracts, version)
pacts, pact_notices = create_pacts(parsed_contracts, base_url)
Expand Down

0 comments on commit 5136faf

Please sign in to comment.