pact_broker-client 1.75.1 → 1.75.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/delete_branch_in_pactflow.yml +24 -0
- data/.github/workflows/release_gem.yml +1 -1
- data/.github/workflows/test.yml +4 -5
- data/.github/workflows/trigger_pact_docs_update.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/lib/pact_broker/client/pacts/list_latest_versions.rb +1 -0
- data/lib/pact_broker/client/publish_pacts.rb +1 -0
- data/lib/pact_broker/client/version.rb +1 -1
- data/lib/pact_broker/client/webhooks/create.rb +1 -0
- data/lib/pactflow/client/provider_contracts/publish.rb +1 -0
- data/lib/pactflow/client/provider_contracts/publish_the_old_way.rb +1 -0
- data/pact-broker-client.gemspec +1 -0
- data/script/ci/delete-branch-in-pactflow.sh +22 -0
- data/spec/integration/can_i_merge_spec.rb +1 -0
- data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +1 -0
- data/spec/lib/pact_broker/client/cli/broker_publish_spec.rb +1 -0
- data/spec/lib/pact_broker/client/cli/broker_run_webhook_commands_spec.rb +1 -0
- data/spec/lib/pactflow/client/provider_contracts/publish_spec.rb +1 -0
- data/spec/support/ssl_server.rb +1 -1
- data/tasks/pact.rake +1 -21
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d85daa10328b3c815584473aca64d42fb2f2139098782e39249956a14239f9f
|
4
|
+
data.tar.gz: 92e4204165393e3c6de26a8dad87bd199e199b1bc0bcf1f6323cde11d8b2e523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be3514dcba91fb1153e227be1bc2f0e419ec40799b1a81426db87a28c2c7610634c84f312c3c58142088ef098c0059ceaa9d23f19dae698618b8c41358e30643
|
7
|
+
data.tar.gz: 18d34ff71ee33a0d16b72726ad9d2e95a778d3b997447b122665f50a2afef725c7f42d47c6bf39e6bafec481a8abd762b1621aa5fd36b2f581f1cd014b78f915
|
@@ -0,0 +1,24 @@
|
|
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"
|
@@ -61,7 +61,7 @@ jobs:
|
|
61
61
|
runs-on: ubuntu-latest
|
62
62
|
steps:
|
63
63
|
- name: Notify ${{ matrix.repository }} of gem release
|
64
|
-
uses: peter-evans/repository-dispatch@
|
64
|
+
uses: peter-evans/repository-dispatch@v3
|
65
65
|
with:
|
66
66
|
token: ${{ secrets.GHTOKENFORPACTCLIRELEASE }}
|
67
67
|
repository: ${{ matrix.repository }}
|
data/.github/workflows/test.yml
CHANGED
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
strategy:
|
12
12
|
fail-fast: false
|
13
13
|
matrix:
|
14
|
-
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
|
14
|
+
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
|
15
15
|
os: ["ubuntu-latest","windows-latest","macos-latest"]
|
16
16
|
steps:
|
17
17
|
- uses: actions/checkout@v4
|
@@ -34,13 +34,12 @@ jobs:
|
|
34
34
|
ruby-version: "3.2"
|
35
35
|
- run: "bundle install"
|
36
36
|
# Publish to old and new account until we can disable the old account
|
37
|
-
-
|
37
|
+
- name: Generate and publish pacts
|
38
|
+
run: |
|
38
39
|
rm -rf spec/pacts/*
|
39
40
|
bundle exec rspec spec/service_providers/
|
40
|
-
|
41
|
-
VERBOSE=true bundle exec rake pact:publish:pactflow_pact_foundation
|
41
|
+
bundle exec rake pact:publish:pactflow_pact_foundation
|
42
42
|
env:
|
43
|
-
PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_PACT_OSS_TOKEN }}
|
44
43
|
PACT_BROKER_TOKEN_PACT_FOUNDATION: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }}
|
45
44
|
PACT_BROKER_FEATURES: ${{ matrix.feature }}
|
46
45
|
TEST_FEATURE: ${{ matrix.feature }}
|
@@ -16,7 +16,7 @@ jobs:
|
|
16
16
|
runs-on: ubuntu-latest
|
17
17
|
steps:
|
18
18
|
- name: Trigger docs.pact.io update workflow
|
19
|
-
uses: peter-evans/repository-dispatch@
|
19
|
+
uses: peter-evans/repository-dispatch@v3
|
20
20
|
with:
|
21
21
|
token: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
|
22
22
|
repository: pact-foundation/docs.pact.io
|
data/CHANGELOG.md
CHANGED
data/pact-broker-client.gemspec
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -Eeuo pipefail
|
4
|
+
|
5
|
+
echo "Deleting branch ${GIT_BRANCH} for ${PACTICIPANT} in Pactflow..."
|
6
|
+
ENCODED_GIT_BRANCH=$(echo "$GIT_BRANCH" | ruby -e "require 'erb'; puts ERB::Util.url_encode(ARGF.read.chomp)")
|
7
|
+
ENCODED_PACTICIPANT=$(echo "$PACTICIPANT" | ruby -e "require 'erb'; puts ERB::Util.url_encode(ARGF.read.chomp)")
|
8
|
+
BRANCH_URL="${PACT_BROKER_BASE_URL}/pacticipants/${ENCODED_PACTICIPANT}/branches/${ENCODED_GIT_BRANCH}"
|
9
|
+
|
10
|
+
output_file=$(mktemp)
|
11
|
+
|
12
|
+
status=$(curl -v -X DELETE "${BRANCH_URL}" -H "Authorization: Bearer ${PACT_BROKER_TOKEN}" 2>&1 | tee "${output_file}" | awk '/^< HTTP/{print $3}')
|
13
|
+
|
14
|
+
if [ "$status" = "404" ]; then
|
15
|
+
echo "Branch ${GIT_BRANCH} for ${PACTICIPANT} does not exist in Pactflow"
|
16
|
+
elif [ $status -ge 400 ]; then
|
17
|
+
cat "${output_file}"
|
18
|
+
echo "Error deleting branch in Pactflow"
|
19
|
+
exit 1
|
20
|
+
else
|
21
|
+
echo "Deleted branch ${GIT_BRANCH} for ${PACTICIPANT} in Pactflow"
|
22
|
+
fi
|
data/spec/support/ssl_server.rb
CHANGED
data/tasks/pact.rake
CHANGED
@@ -18,26 +18,6 @@ PactBroker::Client::PublicationTask.new(:remote) do | task |
|
|
18
18
|
task.pact_broker_basic_auth = { username: ENV.fetch("PACT_BROKER_USERNAME"), password: ENV.fetch("PACT_BROKER_PASSWORD") }
|
19
19
|
end
|
20
20
|
|
21
|
-
PactBroker::Client::PublicationTask.new(:pactflow_oss) do | task |
|
22
|
-
version = ENV.fetch("GITHUB_SHA")
|
23
|
-
branch = ENV.fetch("GITHUB_REF").gsub("refs/heads/", "")
|
24
|
-
feature = ENV.fetch("TEST_FEATURE", "")
|
25
|
-
tag = branch
|
26
|
-
|
27
|
-
if feature != ''
|
28
|
-
version = "#{version}+#{feature}"
|
29
|
-
tag = "#{tag}+#{feature}"
|
30
|
-
end
|
31
|
-
|
32
|
-
require "pact_broker/client/version"
|
33
|
-
task.auto_detect_version_properties = false
|
34
|
-
task.tags = [tag]
|
35
|
-
task.branch = nil
|
36
|
-
task.consumer_version = version
|
37
|
-
task.pact_broker_base_url = "https://pact-oss.pactflow.io"
|
38
|
-
task.pact_broker_token = ENV['PACT_BROKER_TOKEN']
|
39
|
-
task.build_url = PactBroker::Client::Git.build_url
|
40
|
-
end
|
41
21
|
|
42
22
|
PactBroker::Client::PublicationTask.new(:pactflow_pact_foundation) do | task |
|
43
23
|
version = ENV.fetch("GITHUB_SHA")
|
@@ -53,7 +33,7 @@ PactBroker::Client::PublicationTask.new(:pactflow_pact_foundation) do | task |
|
|
53
33
|
require "pact_broker/client/version"
|
54
34
|
task.auto_detect_version_properties = false
|
55
35
|
task.tags = [tag]
|
56
|
-
task.branch =
|
36
|
+
task.branch = branch
|
57
37
|
task.consumer_version = version
|
58
38
|
task.pact_broker_base_url = "https://pact-foundation.pactflow.io"
|
59
39
|
task.pact_broker_token = ENV["PACT_BROKER_TOKEN_PACT_FOUNDATION"]
|
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.75.
|
4
|
+
version: 1.75.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -106,6 +106,20 @@ dependencies:
|
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '1.0'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: base64
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - "~>"
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0.2'
|
116
|
+
type: :runtime
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0.2'
|
109
123
|
description: Client for the Pact Broker. Publish, retrieve and query pacts and verification
|
110
124
|
results. Manage webhooks and environments.
|
111
125
|
email:
|
@@ -117,6 +131,7 @@ extensions: []
|
|
117
131
|
extra_rdoc_files: []
|
118
132
|
files:
|
119
133
|
- ".github/dependabot.yml"
|
134
|
+
- ".github/workflows/delete_branch_in_pactflow.yml"
|
120
135
|
- ".github/workflows/release_gem.yml"
|
121
136
|
- ".github/workflows/smartbear-issue-label-added.yml"
|
122
137
|
- ".github/workflows/test.yml"
|
@@ -244,6 +259,7 @@ files:
|
|
244
259
|
- pact-broker-client.gemspec
|
245
260
|
- script/approve-all.sh
|
246
261
|
- script/can-i-deploy.sh
|
262
|
+
- script/ci/delete-branch-in-pactflow.sh
|
247
263
|
- script/ci/record-release.sh
|
248
264
|
- script/create-pacticipant.sh
|
249
265
|
- script/foo-bar.json
|
@@ -381,7 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
381
397
|
- !ruby/object:Gem::Version
|
382
398
|
version: '0'
|
383
399
|
requirements: []
|
384
|
-
rubygems_version: 3.
|
400
|
+
rubygems_version: 3.5.13
|
385
401
|
signing_key:
|
386
402
|
specification_version: 4
|
387
403
|
summary: See description
|