pact_broker-client 1.37.0 → 1.37.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 780fdf6ce281a9e3d94de58bb68705d0aa4b9b9fb7262ae1331c246c8dda5d6a
4
- data.tar.gz: f15abe101f78db4245f654f2f2717d8b78be861146769c83e32a655e43c3ecc8
3
+ metadata.gz: 5ee5df1eb310d1b9e093c4221ac3761f24cf7038dc923311cef87bc2d51fffcf
4
+ data.tar.gz: 0332f399dd793f3ab9a2e37446bee976770ba4e37ddbed83ebe2ef00074a20ad
5
5
  SHA512:
6
- metadata.gz: 27c3f50858c65ea0fc07a0b88c8eee758cfeb09f37c81d01d767a040ad51b377b43dd6fc080e9ae4f08dae4d10c379a9cda9b9d1dc456f680e06f2fc87860543
7
- data.tar.gz: 6ce9d5caf203b2b41d5fd665f84b43109bf0ebec81019bb2747de2723de6f0b60cc38ecadd6e6cad7a4cd43e625ea96c595475a9c8f48f8b75c3c1180ff960db
6
+ metadata.gz: 6c3ba1e4b3303fe74c5227fdbd24c919cf6ce63bac1a85ec98e04b75618f6f75074b7cbba5933f5140ba80da903fc5c43b381c240639a0795d4cc4e835ec6244
7
+ data.tar.gz: 64104a222d139eb496ebe1c4a0850c755e96e1437ab337aafe480b549bea89da49684b67108b4314fbd0fa66bd03a6ef346f04848b0340f13a0bbe1b796f22cc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ <a name="v1.37.1"></a>
2
+ ### v1.37.1 (2021-03-11)
3
+
4
+ #### Bug Fixes
5
+
6
+ * set username from PACT_BROKER_USERNAME environment variable correctly when -u specified for create-or-update-webhook and create-webhook ([2411396](/../../commit/2411396))
7
+
1
8
  <a name="v1.37.0"></a>
2
9
  ### v1.37.0 (2021-03-01)
3
10
 
@@ -287,15 +287,15 @@ module PactBroker
287
287
 
288
288
  def pact_broker_client_options
289
289
  client_options = { verbose: options.verbose }
290
- client_options[:token] = options.broker_token if options.broker_token
291
- if options.broker_username
290
+ client_options[:token] = options.broker_token || ENV['PACT_BROKER_TOKEN']
291
+ if options.broker_username || ENV['PACT_BROKER_USERNAME']
292
292
  client_options[:basic_auth] = {
293
- username: options.broker_username,
294
- password: options.broker_password
295
- }
293
+ username: options.broker_username || ENV['PACT_BROKER_USERNAME'],
294
+ password: options.broker_password || ENV['PACT_BROKER_PASSWORD']
295
+ }.compact
296
296
  end
297
297
 
298
- client_options
298
+ client_options.compact
299
299
  end
300
300
 
301
301
  def parse_webhook_events
@@ -1 +1,3 @@
1
- Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-or-update-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-or-update-webhook and a uuid must also be provided. You can generate a valid UUID by using the `generate-uuid` command.
1
+ Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-or-update-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-or-update-webhook and a uuid must also be provided. You can generate a valid UUID by using the `generate-uuid` command.
2
+
3
+ Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.
@@ -1 +1,3 @@
1
1
  Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-webhook.
2
+
3
+ Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.
@@ -22,10 +22,7 @@ module PactBroker
22
22
  def self.add_broker_config_from_environment_variables argv
23
23
  return argv if argv[0] == 'help' || argv.empty?
24
24
 
25
- new_argv = add_option_from_environment_variable(argv, 'broker-base-url', 'b', 'PACT_BROKER_BASE_URL')
26
- new_argv = add_option_from_environment_variable(new_argv, 'broker-username', 'u', 'PACT_BROKER_USERNAME')
27
- new_argv = add_option_from_environment_variable(new_argv, 'broker-token', 'k', 'PACT_BROKER_TOKEN')
28
- add_option_from_environment_variable(new_argv, 'broker-password', 'p', 'PACT_BROKER_PASSWORD')
25
+ add_option_from_environment_variable(argv, 'broker-base-url', 'b', 'PACT_BROKER_BASE_URL')
29
26
  end
30
27
 
31
28
  def self.add_option_from_environment_variable argv, long_name, short_name, environment_variable_name
@@ -117,4 +114,4 @@ module PactBroker
117
114
  end
118
115
  end
119
116
  end
120
- end
117
+ end
@@ -1,5 +1,5 @@
1
1
  module PactBroker
2
2
  module Client
3
- VERSION = '1.37.0'
3
+ VERSION = '1.37.1'
4
4
  end
5
5
  end
@@ -1,4 +1,6 @@
1
1
  require 'pact_broker/client/cli/broker'
2
+ require 'pact_broker/client/cli/version_selector_options_parser'
3
+ require 'pact_broker/client/can_i_deploy'
2
4
 
3
5
  module PactBroker
4
6
  module Client
@@ -28,7 +28,7 @@ module PactBroker::Client::CLI
28
28
  "http://pact-broker",
29
29
  ["spec/support/cli_test_pacts/foo.json"],
30
30
  { number: "1.2.3", tags: [], version_required: false },
31
- { verbose: nil }
31
+ { }
32
32
  )
33
33
  invoke_broker
34
34
  end
@@ -52,12 +52,9 @@ module PactBroker::Client::CLI
52
52
  ENV['PACT_BROKER_TOKEN'] = 'token'
53
53
  end
54
54
 
55
- it "populates the options from the environment variables" do
55
+ it "populates the base URL from the environment variables" do
56
56
  expect(Delegate).to receive(:call) do | options |
57
57
  expect(options.broker_base_url).to eq 'http://foo'
58
- expect(options.broker_username).to eq 'username'
59
- expect(options.broker_password).to eq 'password'
60
- expect(options.broker_token).to eq 'token'
61
58
  end
62
59
  TestThor.start(%w{test_using_env_vars})
63
60
  end
@@ -65,9 +62,6 @@ module PactBroker::Client::CLI
65
62
  it "does not override a value specifed on the command line" do
66
63
  expect(Delegate).to receive(:call) do | options |
67
64
  expect(options.broker_base_url).to eq 'http://bar'
68
- expect(options.broker_username).to eq 'username'
69
- expect(options.broker_password).to eq 'password'
70
- expect(options.broker_token).to eq 'token'
71
65
  end
72
66
  TestThor.start(%w{test_using_env_vars --broker-base-url http://bar})
73
67
  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.37.0
4
+ version: 1.37.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: 2021-02-28 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -337,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
337
  - !ruby/object:Gem::Version
338
338
  version: '0'
339
339
  requirements: []
340
- rubygems_version: 3.2.11
340
+ rubygems_version: 3.2.14
341
341
  signing_key:
342
342
  specification_version: 4
343
343
  summary: See description