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 +4 -4
- data/bin/maze-runner +1 -0
- data/lib/maze/configuration.rb +3 -0
- data/lib/maze/option/parser.rb +6 -0
- data/lib/maze/option/processor.rb +3 -1
- data/lib/maze/option/validator.rb +12 -0
- data/lib/maze/option.rb +1 -0
- data/lib/maze/repeaters/hub_repeater.rb +35 -0
- data/lib/maze/servlets/servlet.rb +2 -0
- data/lib/maze.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c47e4bcb6049cc58f27466372e75f51d511a71b5745cd62d4ccc2d7f3d6b4cfd
|
4
|
+
data.tar.gz: 45bf0ff4127855054bcf380aa7d34bd4b67c0362acbe2884d5b1886e134575ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/maze/configuration.rb
CHANGED
@@ -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
|
|
data/lib/maze/option/parser.rb
CHANGED
@@ -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
@@ -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.
|
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.
|
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-
|
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
|