pact_broker-client 1.75.0 → 1.75.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5089c183a535af491e824cdb9d198cb06150cb44d77014b09957564b9a47be7
4
- data.tar.gz: 4d86ae219d734f0d4266214d1adca636f4557691104e75a720e8860d4103f831
3
+ metadata.gz: d1182bbb55b2f96fd7be7619d813cd4d144b5f3ed2d0b39c96bf26f50ebe3f49
4
+ data.tar.gz: 6f191eb22fa4764e41d59f5be90310637162fc7ac769b00820ab2703e24069a1
5
5
  SHA512:
6
- metadata.gz: 4f7e075d702ae824e91835cfbf14068c8c2938877cc0a156f7d99e8f9a577bd41d4b4507f06f714897c8f911e7c85f647f94898d4eb0ebf1ea938b270d004708
7
- data.tar.gz: e7f787f092e10fec2166328a1bca16c7517a5a1c65179f92e4b9b71f6a97caaf0633a0ecc71f03cc0b9baaf303a86d26567a11399ff8fcd9a00d1de54685f856
6
+ metadata.gz: 57e26c965b62b16ec547f0892efed4006e78c22f4b26ad64b0968953d4d03a3c01c5fac4f9dfd806438df623d1992a8bea575ed85b222b767b8cad43ef487611
7
+ data.tar.gz: 1564437e9b96f362b82f0e12cbf7c2ec90f26ca73f0a7792c11b5b622e8e4e50a7121dd2c94544a14c359311f03eb69b3b68d17affd4f5a2c95e4e561f9f9aee
@@ -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@v2
64
+ uses: peter-evans/repository-dispatch@v3
65
65
  with:
66
66
  token: ${{ secrets.GHTOKENFORPACTCLIRELEASE }}
67
67
  repository: ${{ matrix.repository }}
@@ -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
- - run: |
37
+ - name: Generate and publish pacts
38
+ run: |
38
39
  rm -rf spec/pacts/*
39
40
  bundle exec rspec spec/service_providers/
40
- VERBOSE=true bundle exec rake pact:publish:pactflow_oss
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@v2
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
@@ -1,3 +1,17 @@
1
+ <a name="v1.75.2"></a>
2
+ ### v1.75.2 (2024-05-13)
3
+
4
+ #### Bug Fixes
5
+
6
+ * explicitly require openstruct ([fdb70cf](/../../commit/fdb70cf))
7
+
8
+ <a name="v1.75.1"></a>
9
+ ### v1.75.1 (2023-11-23)
10
+
11
+ #### Bug Fixes
12
+
13
+ * verification-required command invalid arg number ([fa3b1ca](/../../commit/fa3b1ca))
14
+
1
15
  <a name="v1.75.0"></a>
2
16
  ### v1.75.0 (2023-11-11)
3
17
 
@@ -90,7 +90,7 @@
90
90
 
91
91
  * [A request to list the latest pacts](#a_request_to_list_the_latest_pacts_given_a_pact_between_Condor_and_the_Pricing_Service_exists) given a pact between Condor and the Pricing Service exists
92
92
 
93
- * [A request to list the versions deployed to an environment for a pacticipant name and target](#a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_target_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1) given an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1
93
+ * [A request to list the versions deployed to an environment for a pacticipant name and application instance](#a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_application_instance_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1) given an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1
94
94
 
95
95
  * [A request to mark a deployed version as not currently deploye](#a_request_to_mark_a_deployed_version_as_not_currently_deploye_given_a_currently_deployed_version_exists) given a currently deployed version exists
96
96
 
@@ -2052,8 +2052,8 @@ Pact Broker will respond with:
2052
2052
  }
2053
2053
  }
2054
2054
  ```
2055
- <a name="a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_target_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1"></a>
2056
- Given **an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1**, upon receiving **a request to list the versions deployed to an environment for a pacticipant name and target** from Pact Broker Client, with
2055
+ <a name="a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_application_instance_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1"></a>
2056
+ Given **an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1**, upon receiving **a request to list the versions deployed to an environment for a pacticipant name and application instance** from Pact Broker Client, with
2057
2057
  ```json
2058
2058
  {
2059
2059
  "method": "GET",
@@ -2075,7 +2075,7 @@ Pact Broker will respond with:
2075
2075
  "_embedded": {
2076
2076
  "deployedVersions": [
2077
2077
  {
2078
- "target": "customer-1",
2078
+ "applicationInstance": "customer-1",
2079
2079
  "_links": {
2080
2080
  "self": {
2081
2081
  "href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0"
@@ -88,7 +88,7 @@ module PactBroker
88
88
  selectors = VersionSelectorOptionsParser.call(ARGV)
89
89
  validate_can_i_deploy_selectors(selectors)
90
90
  verification_required_options = { output: options.output, verbose: options.verbose, retry_while_unknown: 0 }
91
- result = VerificationRequired.call(options.broker_base_url, selectors, { to_tag: options.to, to_environment: options.in_environment, ignore_selectors: [] }, verification_required_options, pact_broker_client_options)
91
+ result = VerificationRequired.call(selectors, { to_tag: options.to, to_environment: options.in_environment, ignore_selectors: [] }, verification_required_options, pact_broker_client_options)
92
92
  $stdout.puts result.message
93
93
  $stdout.flush
94
94
  exit(1) unless result.success
@@ -1,6 +1,7 @@
1
1
  require 'pact_broker/client/hal'
2
2
  require 'pact_broker/client/command_result'
3
3
  require 'pact_broker/client/hal_client_methods'
4
+ require 'ostruct'
4
5
 
5
6
  module PactBroker
6
7
  module Client
@@ -4,6 +4,7 @@ require 'base64'
4
4
  require 'pact_broker/client/publish_pacts_the_old_way'
5
5
  require 'pact_broker/client/colorize_notices'
6
6
  require 'pact_broker/client/hash_refinements'
7
+ require 'ostruct'
7
8
 
8
9
  module PactBroker
9
10
  module Client
@@ -1,5 +1,5 @@
1
1
  module PactBroker
2
2
  module Client
3
- VERSION = '1.75.0'
3
+ VERSION = '1.75.2'
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ require 'json'
5
5
  require 'pact_broker/client/command_result'
6
6
  require "pact_broker/client/backports"
7
7
  require "pact_broker/client/hash_refinements"
8
+ require 'ostruct'
8
9
 
9
10
  module PactBroker
10
11
  module Client
@@ -2,6 +2,7 @@ require "base64"
2
2
  require "pact_broker/client/base_command"
3
3
  require "pact_broker/client/colorize_notices"
4
4
  require "pactflow/client/provider_contracts/publish_the_old_way"
5
+ require 'ostruct'
5
6
 
6
7
  module Pactflow
7
8
  module Client
@@ -2,6 +2,7 @@ require "pact_broker/client/base_command"
2
2
  require "pact_broker/client/versions/create"
3
3
  require 'pact_broker/client/colorize_notices'
4
4
  require "base64"
5
+ require 'ostruct'
5
6
 
6
7
  module Pactflow
7
8
  module Client
@@ -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
@@ -1,4 +1,5 @@
1
1
  require "pact_broker/client/cli/broker"
2
+ require 'ostruct'
2
3
 
3
4
  module PactBroker
4
5
  module Client
@@ -1,6 +1,7 @@
1
1
  require 'pact_broker/client/cli/broker'
2
2
  require 'pact_broker/client/cli/version_selector_options_parser'
3
3
  require 'pact_broker/client/can_i_deploy'
4
+ require 'ostruct'
4
5
 
5
6
  module PactBroker
6
7
  module Client
@@ -1,6 +1,7 @@
1
1
  require 'pact_broker/client/cli/broker'
2
2
  require 'pact_broker/client/publish_pacts'
3
3
  require 'pact_broker/client/git'
4
+ require 'ostruct'
4
5
 
5
6
  module PactBroker::Client::CLI
6
7
  describe Broker do
@@ -1,5 +1,6 @@
1
1
  require 'pact_broker/client/cli/broker'
2
2
  require 'pact_broker/client/webhooks/create'
3
+ require 'ostruct'
3
4
 
4
5
  module PactBroker
5
6
  module Client
@@ -1,4 +1,5 @@
1
1
  require "pactflow/client/provider_contracts/publish"
2
+ require 'ostruct'
2
3
 
3
4
  module Pactflow
4
5
  module Client
@@ -1928,7 +1928,7 @@
1928
1928
  }
1929
1929
  },
1930
1930
  {
1931
- "description": "a request to list the versions deployed to an environment for a pacticipant name and target",
1931
+ "description": "a request to list the versions deployed to an environment for a pacticipant name and application instance",
1932
1932
  "providerState": "an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1",
1933
1933
  "request": {
1934
1934
  "method": "GET",
@@ -1947,7 +1947,7 @@
1947
1947
  "_embedded": {
1948
1948
  "deployedVersions": [
1949
1949
  {
1950
- "target": "customer-1",
1950
+ "applicationInstance": "customer-1",
1951
1951
  "_links": {
1952
1952
  "self": {
1953
1953
  "href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0"
@@ -86,7 +86,7 @@ RSpec.describe "recording an undeployment", pact: true do
86
86
  def mock_deployed_versions_search_results
87
87
  pact_broker
88
88
  .given("an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1")
89
- .upon_receiving("a request to list the versions deployed to an environment for a pacticipant name and target")
89
+ .upon_receiving("a request to list the versions deployed to an environment for a pacticipant name and application instance")
90
90
  .with(
91
91
  method: "GET",
92
92
  path: currently_deployed_versions_placeholder_path,
@@ -100,7 +100,7 @@ RSpec.describe "recording an undeployment", pact: true do
100
100
  _embedded: {
101
101
  deployedVersions: [
102
102
  {
103
- target: application_instance,
103
+ applicationInstance: application_instance,
104
104
  _links: {
105
105
  self: {
106
106
  href: Pact.term(pact_broker.mock_service_base_url + deployed_version_placeholder_path, /^http/)
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 = nil
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.0
4
+ version: 1.75.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beth Skurrie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -117,6 +117,7 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".github/dependabot.yml"
120
+ - ".github/workflows/delete_branch_in_pactflow.yml"
120
121
  - ".github/workflows/release_gem.yml"
121
122
  - ".github/workflows/smartbear-issue-label-added.yml"
122
123
  - ".github/workflows/test.yml"
@@ -244,6 +245,7 @@ files:
244
245
  - pact-broker-client.gemspec
245
246
  - script/approve-all.sh
246
247
  - script/can-i-deploy.sh
248
+ - script/ci/delete-branch-in-pactflow.sh
247
249
  - script/ci/record-release.sh
248
250
  - script/create-pacticipant.sh
249
251
  - script/foo-bar.json
@@ -381,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
383
  - !ruby/object:Gem::Version
382
384
  version: '0'
383
385
  requirements: []
384
- rubygems_version: 3.4.22
386
+ rubygems_version: 3.5.10
385
387
  signing_key:
386
388
  specification_version: 4
387
389
  summary: See description