rookout 0.1.53 → 0.1.54

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: fc61fe37a93f9e71f499fce1d5edfc2de6b2eb1203b9885c5b4cdbcc0b0af6f2
4
- data.tar.gz: 5d48b072987c67593ecc81a68d3d96dd217aca001a3a49fd581a97ae72ae6903
3
+ metadata.gz: e96a2d7b2fdc74a8731a9c547940f6c03a1bf2ee103ed433a65fdac6bff90e40
4
+ data.tar.gz: 21bdac9616f7b5f7bcbcf781fdb2df81ff8ad7bfb0413ed96dea91565df61652
5
5
  SHA512:
6
- metadata.gz: 6afa9d0c7fa12fba84e4bd679ac752eecf6463bf0bc82fef67f80dbd6fa1df576f7a0095f7f246116ed5bc0d4a5418a7afc078ffcba40fe1fc8804501422e83d
7
- data.tar.gz: 605af10354982b51166cce1382572be5f816d90512a2506ce23acb61ea175b155b1b9b435488cafe47269b5b119e9a7c6e4df4449a7c227b647185c97bbad65d
6
+ metadata.gz: 9886ef4e56f478fa227a5a50281179df07b2dc3aa28573d815969b2a57e0935b8b783ebe2738dee480de5eb559b28f5ab8f51357af3d21a50b3e3a2a95fcb7f6
7
+ data.tar.gz: 65e7aa8a863b61994278f58540b95c27166543141145545f463cf2f0bd9a2cc989de3cdd6449353110659cca7558dd892214901008f862fcf3716d2da1c0af3f
@@ -130,6 +130,11 @@ module Rookout
130
130
  @ready_event.set
131
131
  end
132
132
 
133
+ if e.message.include? "400"
134
+ @connection_error = Exceptions::RookWebSocketError.new 400
135
+ @ready_event.set
136
+ end
137
+
133
138
  Logger.instance.warning "Connection failed; reason = #{e.message}"
134
139
  end
135
140
 
@@ -85,10 +85,40 @@ module Rookout
85
85
  return_value
86
86
  end
87
87
 
88
+ def parse_raw_git_sources
89
+ git_sources_raw = ENV["ROOKOUT_SOURCES"]
90
+ if git_sources_raw.nil?
91
+ return nil
92
+ end
93
+
94
+ git_sources = git_sources_raw.split ";"
95
+ user_git_sources = {}
96
+ git_sources.each do |url|
97
+ url_parts = url.split "#"
98
+ if url_parts.length != 2
99
+ next
100
+ end
101
+
102
+ remote_url = url_parts[0]
103
+ commit = url_parts[1]
104
+ user_git_sources[remote_url] = commit
105
+ end
106
+
107
+ user_git_sources
108
+ end
109
+
88
110
  def create_scm_information
89
111
  user_git_origin = Config.user_git_origin || ENV["ROOKOUT_REMOTE_ORIGIN"]
90
112
  user_git_commit = Config.user_git_commit || ENV["ROOKOUT_COMMIT"]
91
113
 
114
+ user_git_sources = Config.user_git_sources || parse_raw_git_sources
115
+
116
+ if !user_git_sources.nil? && !user_git_sources.empty?
117
+ user_git_sources = user_git_sources.map do |remote_url, commit|
118
+ Com::Rookout::SCMInformation::SourceInfo.new remoteOriginUrl: remote_url, commit: commit
119
+ end
120
+ end
121
+
92
122
  if user_git_origin.nil? && user_git_commit.nil?
93
123
  search_path = File.dirname File.absolute_path($PROGRAM_NAME)
94
124
  git_root = find_root search_path
@@ -98,7 +128,7 @@ module Rookout
98
128
  end
99
129
  end
100
130
 
101
- Com::Rookout::SCMInformation.new origin: user_git_origin, commit: user_git_commit
131
+ Com::Rookout::SCMInformation.new origin: user_git_origin, commit: user_git_commit, sources: user_git_sources
102
132
  end
103
133
 
104
134
  def aws_lambda?
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "24373c28244fc83259758e74b7fd12d5a6964eb5".freeze
2
+ COMMIT = "9db1dfad4593de7df40d98fba0722f8778ef7528".freeze
3
3
  end
@@ -60,9 +60,11 @@ module Rookout
60
60
 
61
61
  attr_accessor :user_git_commit
62
62
  attr_accessor :user_git_origin
63
+ attr_accessor :user_git_sources
63
64
 
64
65
  Rookout::Config.user_git_commit = nil
65
66
  Rookout::Config.user_git_origin = nil
67
+ Rookout::Config.user_git_sources = nil
66
68
 
67
69
  attr_accessor :rookout_version
68
70
  attr_accessor :rookout_commit
@@ -132,6 +132,13 @@ module Rookout
132
132
  end
133
133
  end
134
134
 
135
+ class RookWebSocketError < ToolException
136
+ def initialize http_status
137
+ super "Received HTTP status #{http_status} from the controller," \
138
+ "Please make sure WebSocket is enabled on the load balancer."
139
+ end
140
+ end
141
+
135
142
  class RookSourceFilePathSuggestion < ToolException
136
143
  def initialize wanted_path, matching_path
137
144
  super "Rookout found alternative file path: #{matching_path}",
@@ -39,7 +39,8 @@ module Rookout
39
39
  raise if throw_errors
40
40
  $stderr.puts "[Rookout] Failed to load Rookout. Please make sure to force build native extensions by setting" \
41
41
  "'bundle config force_ruby_platform true'"
42
- rescue RookMissingToken, RookInvalidToken, RookInvalidOptions, RookVersionNotSupported, RookBadProtobuf => e
42
+ rescue RookMissingToken, RookInvalidToken, RookInvalidOptions,
43
+ RookVersionNotSupported, RookBadProtobuf, RookWebSocketError => e
43
44
  raise if throw_errors
44
45
  $stderr.puts "[Rookout] Failed to start Rookout: #{e.message}"
45
46
  rescue RookCommunicationException => e
@@ -92,6 +93,12 @@ module Rookout
92
93
  $stderr.puts error.message
93
94
  end
94
95
 
96
+ def configure_scm options
97
+ Config.user_git_origin = options[:git_origin] if options[:git_origin]
98
+ Config.user_git_commit = options[:git_commit] if options[:git_commit]
99
+ Config.user_git_sources = options[:git_sources] if options[:git_sources] && options[:git_sources].is_a?(Hash)
100
+ end
101
+
95
102
  def configure_globals options
96
103
  if Config.debug
97
104
  log_to_stderr = true
@@ -107,8 +114,7 @@ module Rookout
107
114
  Config.logger_filename = log_file unless log_file.nil?
108
115
  Config.logger_log_level = log_level unless log_level.nil?
109
116
 
110
- Config.user_git_origin = options[:git_origin] if options[:git_origin]
111
- Config.user_git_commit = options[:git_commit] if options[:git_commit]
117
+ configure_scm options
112
118
  end
113
119
 
114
120
  def configure_start_options options
@@ -14,7 +14,7 @@ module Rookout
14
14
  def self.sanitize_properties!
15
15
  ENV.each do |key, val|
16
16
  if key.start_with?("ROOKOUT_") && !@@blacklisted_properties.include?(key.to_s)
17
- ENV[key] = val.strip
17
+ ENV[key] = val.strip.delete_suffix("/")
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.53".freeze
2
+ VERSION = "0.1.54".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rookout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.53
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2023-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby