bugsnag-maze-runner 9.31.4 → 9.32.0

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: 283f60a46b3e965afb1bb66b3c41809781b00d04b71eb9773eb3e2d9c3273601
4
- data.tar.gz: 5731223c5f117c5f50d8bfce733be72dafea7017d27a0e56b00436deebecf385
3
+ metadata.gz: c47e4bcb6049cc58f27466372e75f51d511a71b5745cd62d4ccc2d7f3d6b4cfd
4
+ data.tar.gz: 45bf0ff4127855054bcf380aa7d34bd4b67c0362acbe2884d5b1886e134575ab
5
5
  SHA512:
6
- metadata.gz: f2a37bdf08bd9637c1fd0265e722328000b4f5c61eaddac3ce4abf343c3bf2ec60d86548beee14915acc45032490263f9c6ef2b12fe16194c122b42a1a28c5e2
7
- data.tar.gz: a767a95059d2692781f20889e4b9b27c9ede5f49637b314739f2a5820386824ecb24404a68b796db027d0c0119ab2dcc85b54d64c69e91d15715d72b5abc9a85
6
+ metadata.gz: 4b13a0242584d0754fcdd1ae6d0266b69fe34dacc4b6d749d0589f7371f640719b8c888ea1e4823940d94c542fdb68f3a8cea97bf33dd593ad0d770d4369b9a0
7
+ data.tar.gz: 176189a7a96f7d52d2faee8989b5b00d2249bd400b337f4113f1248563064b4d823dc667964b26a0b89fcdd0424ce04a9d0a64a4e65adfe53e1ff38f7d00fb99
data/bin/maze-runner CHANGED
@@ -55,6 +55,7 @@ require_relative '../lib/maze/proxy'
55
55
  require_relative '../lib/maze/retry_handler'
56
56
  require_relative '../lib/maze/repeaters/request_repeater'
57
57
  require_relative '../lib/maze/repeaters/bugsnag_repeater'
58
+ require_relative '../lib/maze/repeaters/hub_repeater'
58
59
  require_relative '../lib/maze/runner'
59
60
  require_relative '../lib/maze/terminating_server'
60
61
 
@@ -75,6 +75,9 @@ module Maze
75
75
  # API key to use when repeating requests to Bugsnag
76
76
  attr_accessor :bugsnag_repeater_api_key
77
77
 
78
+ # API key to use when repeating requests to InsightHub
79
+ attr_accessor :hub_repeater_api_key
80
+
78
81
  # Enables awareness of a public IP address on Buildkite with the Elastic CI Stack for AWS.
79
82
  attr_accessor :aws_public_ip
80
83
 
@@ -52,6 +52,11 @@ module Maze
52
52
  short: :none,
53
53
  type: :string
54
54
 
55
+ opt Option::HUB_REPEATER_API_KEY,
56
+ 'Enables forwarding of all received POST requests to InsightHub, using the API key provided. MAZE_HUB_REPEATER_API_KEY may also be set.',
57
+ short: :none,
58
+ type: :string
59
+
55
60
  text ''
56
61
  text 'Server options:'
57
62
 
@@ -277,6 +282,7 @@ module Maze
277
282
  end
278
283
 
279
284
  options[Option::BUGSNAG_REPEATER_API_KEY] ||= ENV['MAZE_REPEATER_API_KEY']
285
+ options[Option::HUB_REPEATER_API_KEY] ||= ENV['MAZE_HUB_REPEATER_API_KEY']
280
286
  options[Option::SB_LOCAL] ||= ENV['MAZE_SB_LOCAL'] || '/SBSecureTunnel'
281
287
  options[Option::BS_LOCAL] ||= ENV['MAZE_BS_LOCAL'] || '/BrowserStackLocal'
282
288
  options[Option::PORT] ||= ENV['MAZE_PORT'] || 9339
@@ -23,7 +23,9 @@ module Maze
23
23
  config.enable_retries = options[Maze::Option::RETRIES]
24
24
  config.enable_bugsnag = options[Maze::Option::BUGSNAG]
25
25
  bugsnag_repeater_api_key = options[Maze::Option::BUGSNAG_REPEATER_API_KEY]
26
- config.bugsnag_repeater_api_key = bugsnag_repeater_api_key unless bugsnag_repeater_api_key&.empty?
26
+ config.bugsnag_repeater_api_key = bugsnag_repeater_api_key unless bugsnag_repeater_api_key&.empty?
27
+ hub_repeater_api_key = options[Maze::Option::HUB_REPEATER_API_KEY]
28
+ config.hub_repeater_api_key = hub_repeater_api_key unless hub_repeater_api_key&.empty?
27
29
 
28
30
  # Document server options
29
31
  config.document_server_root = options[Maze::Option::DS_ROOT]
@@ -41,6 +41,18 @@ module Maze
41
41
  errors << "--#{Option::BUGSNAG_REPEATER_API_KEY} must be set to a 32-character hex value"
42
42
  end
43
43
 
44
+ # --hub-repeater-api-key
45
+ key = options[Option::HUB_REPEATER_API_KEY]
46
+ if key&.empty?
47
+ $logger.warn "A hub-repeater-api-key option was provided with an empty string. This won't be used during this test run"
48
+ key = nil
49
+ end
50
+ key_regex = /^[0-9a-fA-F]{32}$/
51
+
52
+ if key && !key_regex.match?(key)
53
+ errors << "--#{Option::HUB_REPEATER_API_KEY} must be set to a 32-character hex value"
54
+ end
55
+
44
56
  # Farm specific options
45
57
  validate_bs options, errors if farm == 'bs'
46
58
  validate_bitbar options, errors if farm == 'bb'
data/lib/maze/option.rb CHANGED
@@ -57,6 +57,7 @@ module Maze
57
57
  # General options
58
58
  AWS_PUBLIC_IP = 'aws-public-ip'
59
59
  BUGSNAG_REPEATER_API_KEY = 'repeater-api-key'
60
+ HUB_REPEATER_API_KEY = 'hub-repeater-api-key'
60
61
  BUGSNAG = 'bugsnag'
61
62
  RETRIES = 'retries'
62
63
  end
@@ -0,0 +1,35 @@
1
+ module Maze
2
+ module Repeaters
3
+ # Repeats Bugsnag requests
4
+ class HubRepeater < RequestRepeater
5
+
6
+ private
7
+
8
+ def set_headers(request)
9
+ # TODO Also overwrite apiKey in the payload, if present, recalculate the integrity header (handling
10
+ # compressed payloads if the content-encoding header is set accordingly)
11
+ request['bugsnag-api-key'] = Maze.config.hub_repeater_api_key
12
+ end
13
+
14
+ def enabled?
15
+ # enabled if the config option is on and this request type should be repeated
16
+ Maze.config.hub_repeater_api_key && url_for_request_type
17
+ end
18
+
19
+ def url_for_request_type
20
+ url = case @request_type
21
+ when :errors then 'https://notify.insighthub.smartbear.com/'
22
+ when :sessions then 'https://sessions.insighthub.smartbear.com/'
23
+ when :traces then "https://#{Maze.config.hub_repeater_api_key}.otlp.insighthub.smartbear.com/v1/traces"
24
+ else return nil
25
+ end
26
+ URI.parse(url)
27
+ end
28
+
29
+ def include_header?(key, value)
30
+ # Include all headers apart from the API key, which is set separately
31
+ key != 'bugsnag-api-key'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -40,6 +40,7 @@ module Maze
40
40
  @request_type = request_type
41
41
  @schema = JSONSchemer.schema(schema) unless schema.nil?
42
42
  @bugsnag_repeater = Maze::Repeaters::BugsnagRepeater.new(@request_type)
43
+ @hub_repeater = Maze::Repeaters::HubRepeater.new(@request_type)
43
44
  end
44
45
 
45
46
  # Logs an incoming GET WEBrick request.
@@ -59,6 +60,7 @@ module Maze
59
60
  def do_POST(request, response)
60
61
 
61
62
  @bugsnag_repeater.repeat request
63
+ @hub_repeater.repeat request
62
64
 
63
65
  # Turn the WEBrick HttpRequest into our internal HttpRequest delegate
64
66
  request = Maze::HttpRequest.new(request)
data/lib/maze.rb CHANGED
@@ -8,7 +8,7 @@ require_relative 'maze/timers'
8
8
  # providing an alternative to the proliferation of global variables or singletons.
9
9
  module Maze
10
10
 
11
- VERSION = '9.31.4'
11
+ VERSION = '9.32.0'
12
12
 
13
13
  class << self
14
14
  attr_accessor :check, :driver, :internal_hooks, :mode, :start_time, :dynamic_retry, :public_address,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-maze-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.31.4
4
+ version: 9.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Kirkland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-09 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -496,6 +496,7 @@ files:
496
496
  - lib/maze/plugins/logging_scenarios_plugin.rb
497
497
  - lib/maze/proxy.rb
498
498
  - lib/maze/repeaters/bugsnag_repeater.rb
499
+ - lib/maze/repeaters/hub_repeater.rb
499
500
  - lib/maze/repeaters/request_repeater.rb
500
501
  - lib/maze/request_list.rb
501
502
  - lib/maze/retry_handler.rb