pact_broker-client 1.76.0 → 1.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/CHANGELOG.md +7 -0
- data/lib/pact_broker/client/pacts/list_latest_versions.rb +66 -0
- data/lib/pact_broker/client/version.rb +1 -1
- data/lib/pact_broker/client/webhooks/test.rb +16 -0
- data/pact-broker-client.gemspec +28 -0
- metadata +6 -8
- data/.github/dependabot.yml +0 -6
- data/.github/workflows/delete_branch_in_pactflow.yml +0 -24
- data/.github/workflows/release_gem.yml +0 -74
- data/.github/workflows/smartbear-issue-label-added.yml +0 -11
- data/.github/workflows/triage.yml +0 -15
- data/.github/workflows/trigger_pact_docs_update.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba8a36ef12a731a17e237202de9fa3dc360f61799b395450f0ba02ecc1189ef
|
4
|
+
data.tar.gz: d2885db7e9aff85730cf0756bb53529f6f4643b0ae4ea818ad1b6226262227ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95f96215e9736915c0f8eff7444612d9ae8172dfcbb8eff3c567b91837153590376506357bc29d7d78d6c235bb40f21b5643ea08de87dfd6a2227ecc2b4601a2
|
7
|
+
data.tar.gz: 2131968ab5b1f6efe8e3940457b353b023d5f817627f757b6ecbc3e67bbc3fbee45c7bef08cba9dc08bde25c147d416269c5eb1626f81caf2e566094170fd21e
|
data/.rspec
ADDED
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'pact_broker/client/hal'
|
2
|
+
require 'pact_broker/client/command_result'
|
3
|
+
require 'pact_broker/client/hal_client_methods'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
module PactBroker
|
7
|
+
module Client
|
8
|
+
module Pacts
|
9
|
+
class ListLatestVersions
|
10
|
+
|
11
|
+
include HalClientMethods
|
12
|
+
|
13
|
+
def self.call(pact_broker_base_url, output, pact_broker_client_options)
|
14
|
+
new(pact_broker_base_url, output, pact_broker_client_options).call
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(pact_broker_base_url, output, pact_broker_client_options)
|
18
|
+
@index_entry_point = create_index_entry_point(pact_broker_base_url, pact_broker_client_options)
|
19
|
+
@output = output
|
20
|
+
end
|
21
|
+
|
22
|
+
def call
|
23
|
+
message = if output == 'json'
|
24
|
+
versions_resource.response.raw_body
|
25
|
+
else
|
26
|
+
to_text(versions)
|
27
|
+
end
|
28
|
+
PactBroker::Client::CommandResult.new(true, message)
|
29
|
+
|
30
|
+
rescue StandardError => e
|
31
|
+
PactBroker::Client::CommandResult.new(false, e.message)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
attr_reader :index_entry_point, :output
|
37
|
+
|
38
|
+
def versions
|
39
|
+
versions_resource.pacts.collect do | pact |
|
40
|
+
OpenStruct.new(
|
41
|
+
consumer_name: pact['_embedded']['consumer']['name'],
|
42
|
+
provider_name: pact['_embedded']['provider']['name'],
|
43
|
+
consumer_version_number: pact['_embedded']['consumer']['_embedded']['version']['number'],
|
44
|
+
created_at: pact['createdAt']
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def versions_resource
|
50
|
+
index_entry_point.get!._link('pb:latest-pact-versions').get!
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_text(pacts)
|
54
|
+
require 'table_print'
|
55
|
+
options = [
|
56
|
+
{ consumer_name: {display_name: 'consumer'} },
|
57
|
+
{ consumer_version_number: {display_name: 'consumer_version'} },
|
58
|
+
{ provider_name: {display_name: 'provider'} },
|
59
|
+
{ created_at: {} }
|
60
|
+
]
|
61
|
+
TablePrint::Printer.new(pacts, options).table_print
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'pact_broker/client/hal'
|
2
|
+
require 'pact_broker/client/command_result'
|
3
|
+
|
4
|
+
module PactBroker
|
5
|
+
module Client
|
6
|
+
module Webhooks
|
7
|
+
class Test
|
8
|
+
def self.call(options, pact_broker_client_options)
|
9
|
+
http_client = PactBroker::Client::Hal::HttpClient.new(pact_broker_client_options.merge(pact_broker_client_options[:basic_auth] || {}))
|
10
|
+
execution_result = PactBroker::Client::Hal::EntryPoint.new(options.broker_base_url, http_client).get!._link!('pb:webhook').expand('uuid' => options.uuid).get!.post('pb:execute')
|
11
|
+
PactBroker::Client::CommandResult.new(true, execution_result.response.body['logs'])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
# -*- encoding: utf-8 -*-
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'pact_broker/client/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |gem|
|
8
|
+
gem.name = "pact_broker-client"
|
9
|
+
gem.version = PactBroker::Client::VERSION
|
10
|
+
gem.authors = ["Beth Skurrie"]
|
11
|
+
gem.email = ["beth@bethesque.com"]
|
12
|
+
gem.description = %q{Client for the Pact Broker. Publish, retrieve and query pacts and verification results. Manage webhooks and environments.}
|
13
|
+
gem.summary = %q{See description}
|
14
|
+
gem.homepage = "https://github.com/pact-foundation/pact_broker-client.git"
|
15
|
+
gem.files = `git ls-files`.split($/).reject { |file| file.match(/(test\/|spec\/|.github\/)/) }
|
16
|
+
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
gem.license = 'MIT'
|
20
|
+
|
21
|
+
gem.add_runtime_dependency 'httparty', ">= 0.21.0", "< 1.0.0"
|
22
|
+
gem.add_runtime_dependency 'term-ansicolor', '~> 1.7'
|
23
|
+
gem.add_runtime_dependency 'table_print', '~> 1.5'
|
24
|
+
gem.add_runtime_dependency 'thor', '>= 0.20', '< 2.0'
|
25
|
+
gem.add_runtime_dependency 'rake', '~> 13.0' #For FileList
|
26
|
+
gem.add_runtime_dependency 'dig_rb', '~> 1.0'
|
27
|
+
gem.add_runtime_dependency 'base64', '~> 0.2'
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.76.
|
4
|
+
version: 1.76.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -130,13 +130,8 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
- ".github/dependabot.yml"
|
134
|
-
- ".github/workflows/delete_branch_in_pactflow.yml"
|
135
|
-
- ".github/workflows/release_gem.yml"
|
136
|
-
- ".github/workflows/smartbear-issue-label-added.yml"
|
137
|
-
- ".github/workflows/triage.yml"
|
138
|
-
- ".github/workflows/trigger_pact_docs_update.yml"
|
139
133
|
- ".gitignore"
|
134
|
+
- ".rspec"
|
140
135
|
- ".ruby-version"
|
141
136
|
- CHANGELOG.md
|
142
137
|
- DEVELOPING.md
|
@@ -232,6 +227,7 @@ files:
|
|
232
227
|
- lib/pact_broker/client/pacticipants/list.rb
|
233
228
|
- lib/pact_broker/client/pacticipants/text_formatter.rb
|
234
229
|
- lib/pact_broker/client/pacts.rb
|
230
|
+
- lib/pact_broker/client/pacts/list_latest_versions.rb
|
235
231
|
- lib/pact_broker/client/publish_pacts.rb
|
236
232
|
- lib/pact_broker/client/publish_pacts_the_old_way.rb
|
237
233
|
- lib/pact_broker/client/retry.rb
|
@@ -247,11 +243,13 @@ files:
|
|
247
243
|
- lib/pact_broker/client/versions/json_formatter.rb
|
248
244
|
- lib/pact_broker/client/versions/text_formatter.rb
|
249
245
|
- lib/pact_broker/client/webhooks/create.rb
|
246
|
+
- lib/pact_broker/client/webhooks/test.rb
|
250
247
|
- lib/pact_broker_client.rb
|
251
248
|
- lib/pactflow/client/cli/pactflow.rb
|
252
249
|
- lib/pactflow/client/cli/provider_contract_commands.rb
|
253
250
|
- lib/pactflow/client/provider_contracts/publish.rb
|
254
251
|
- lib/pactflow/client/provider_contracts/publish_the_old_way.rb
|
252
|
+
- pact-broker-client.gemspec
|
255
253
|
- script/approve-all.sh
|
256
254
|
- script/can-i-deploy.sh
|
257
255
|
- script/ci/delete-branch-in-pactflow.sh
|
data/.github/dependabot.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
name: Delete application branch in Pactflow
|
2
|
-
|
3
|
-
on:
|
4
|
-
delete:
|
5
|
-
branches:
|
6
|
-
- "*"
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
delete-branch-in-pactflow:
|
10
|
-
name: delete
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
|
13
|
-
steps:
|
14
|
-
- uses: actions/checkout@v4
|
15
|
-
# Requires Ruby to encode the URL path correctly - could use any other scripting language here
|
16
|
-
- uses: ruby/setup-ruby@v1
|
17
|
-
|
18
|
-
- name: Delete branch in Pactflow
|
19
|
-
run: script/ci/delete-branch-in-pactflow.sh
|
20
|
-
env:
|
21
|
-
GIT_BRANCH: ${{ github.event.ref }}
|
22
|
-
PACTICIPANT: "Pact Broker Client"
|
23
|
-
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }}
|
24
|
-
PACT_BROKER_BASE_URL: "https://pact-foundation.pactflow.io"
|
@@ -1,74 +0,0 @@
|
|
1
|
-
name: Release gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
repository_dispatch:
|
5
|
-
types:
|
6
|
-
- release-triggered
|
7
|
-
workflow_dispatch:
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
test:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v4
|
14
|
-
- uses: ruby/setup-ruby@v1
|
15
|
-
- run: |
|
16
|
-
gem install bundler -v 2.4
|
17
|
-
bundle install
|
18
|
-
- name: Test
|
19
|
-
run: bundle exec rake
|
20
|
-
|
21
|
-
release:
|
22
|
-
needs: test
|
23
|
-
runs-on: ubuntu-latest
|
24
|
-
outputs:
|
25
|
-
gem_name: ${{ steps.release.outputs.gem_name }}
|
26
|
-
version: ${{ steps.release.outputs.version }}
|
27
|
-
increment: ${{ steps.release.outputs.increment }}
|
28
|
-
steps:
|
29
|
-
- uses: actions/checkout@v4
|
30
|
-
with:
|
31
|
-
fetch-depth: 0
|
32
|
-
- uses: pact-foundation/release-gem@v1
|
33
|
-
id: release
|
34
|
-
env:
|
35
|
-
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
|
36
|
-
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
37
|
-
INCREMENT: '${{ github.event.client_payload.increment }}'
|
38
|
-
|
39
|
-
record-release:
|
40
|
-
needs: release
|
41
|
-
runs-on: ubuntu-latest
|
42
|
-
steps:
|
43
|
-
- uses: actions/checkout@v4
|
44
|
-
- uses: ruby/setup-ruby@v1
|
45
|
-
- name: Bundle install
|
46
|
-
run: |
|
47
|
-
gem install bundler -v 2.4
|
48
|
-
bundle config set --local without development test
|
49
|
-
bundle install
|
50
|
-
- name: Record release
|
51
|
-
run: script/ci/record-release.sh
|
52
|
-
env:
|
53
|
-
PACT_BROKER_BASE_URL: https://pact-foundation.pactflow.io
|
54
|
-
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }}
|
55
|
-
|
56
|
-
notify-gem-released:
|
57
|
-
needs: release
|
58
|
-
strategy:
|
59
|
-
matrix:
|
60
|
-
repository: [pact-foundation/pact-ruby-cli, pact-foundation/pact-ruby-standalone, pact-foundation/pact_broker-client]
|
61
|
-
runs-on: ubuntu-latest
|
62
|
-
steps:
|
63
|
-
- name: Notify ${{ matrix.repository }} of gem release
|
64
|
-
uses: peter-evans/repository-dispatch@v3
|
65
|
-
with:
|
66
|
-
token: ${{ secrets.GHTOKENFORPACTCLIRELEASE }}
|
67
|
-
repository: ${{ matrix.repository }}
|
68
|
-
event-type: gem-released
|
69
|
-
client-payload: |
|
70
|
-
{
|
71
|
-
"name": "${{ needs.release.outputs.gem_name }}",
|
72
|
-
"version": "${{ needs.release.outputs.version }}",
|
73
|
-
"increment": "${{ needs.release.outputs.increment }}"
|
74
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
name: Trigger update to docs.pact.io
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- master
|
7
|
-
paths:
|
8
|
-
- '**.md'
|
9
|
-
repository_dispatch:
|
10
|
-
types:
|
11
|
-
- gem-released
|
12
|
-
workflow_dispatch:
|
13
|
-
|
14
|
-
jobs:
|
15
|
-
build:
|
16
|
-
runs-on: ubuntu-latest
|
17
|
-
steps:
|
18
|
-
- name: Trigger docs.pact.io update workflow
|
19
|
-
uses: peter-evans/repository-dispatch@v3
|
20
|
-
with:
|
21
|
-
token: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
|
22
|
-
repository: pact-foundation/docs.pact.io
|
23
|
-
event-type: pact-broker-client-docs-updated
|