activerabbit-ai 0.4.7 → 0.4.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 954a33d564508a6af9e73defded58f6b4ea9f0b359da045d7566a91f7bfc846d
|
|
4
|
+
data.tar.gz: 4123b66a3933827a2bca1a78e2a235aa3a76abac2db5e209d60e6626edbdbc2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a4d4f10428dc2e7bf4b96606b1d0ddf809244f046bf5c4ec880a043d9a9436777851146b03e1882c8e306f512e9e83bef09148377e237348ee43246f35399a0
|
|
7
|
+
data.tar.gz: ca02b6426b33d2117455ae68d99fd20e47bb9ba792f8b18bd02b55caf09de6227a5442da53b4baa29221d81f3148dc19d34c67a578eced741f6f1c75629dc7af
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.4.8] - 2025-11-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Deploy notification API**: Added `ActiveRabbit::Client.notify_deploy` for reporting deploys to ActiveRabbit
|
|
9
|
+
- Sends deploy metadata (revision, environment, project slug, version, status, user, timestamps) to `/api/v1/deploys`
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **Test suite stability**: RSpec tests and CI config updated to keep 0.4.x series green
|
|
13
|
+
|
|
5
14
|
## [0.4.7] - 2025-11-06
|
|
6
15
|
|
|
7
16
|
### Fixed
|
|
@@ -15,6 +15,7 @@ module ActiveRabbit
|
|
|
15
15
|
attr_accessor :release, :server_name, :logger
|
|
16
16
|
attr_accessor :before_send_event, :before_send_exception
|
|
17
17
|
attr_accessor :dedupe_window # Time window in seconds for error deduplication (0 = disabled)
|
|
18
|
+
attr_accessor :revision
|
|
18
19
|
|
|
19
20
|
def initialize
|
|
20
21
|
@api_url = ENV.fetch("active_rabbit_API_URL", "https://api.activerabbit.ai")
|
|
@@ -44,7 +44,7 @@ module ActiveRabbit
|
|
|
44
44
|
begin
|
|
45
45
|
# Primary endpoint attempt
|
|
46
46
|
configuration.logger&.info("[ActiveRabbit] Making request to primary endpoint: POST #{path}")
|
|
47
|
-
response =
|
|
47
|
+
response = enqueue_request(:post, path, exception_data_with_type)
|
|
48
48
|
configuration.logger&.info("[ActiveRabbit] Exception sent successfully (errors endpoint)")
|
|
49
49
|
return response
|
|
50
50
|
rescue => e
|
|
@@ -57,7 +57,7 @@ module ActiveRabbit
|
|
|
57
57
|
fallback_path = "/api/v1/events"
|
|
58
58
|
fallback_body = { type: "error", data: exception_data_with_type }
|
|
59
59
|
configuration.logger&.info("[ActiveRabbit] Making request to fallback endpoint: POST #{fallback_path}")
|
|
60
|
-
response =
|
|
60
|
+
response = enqueue_request(:post, fallback_path, fallback_body)
|
|
61
61
|
configuration.logger&.info("[ActiveRabbit] Exception sent via fallback endpoint")
|
|
62
62
|
return response
|
|
63
63
|
rescue => e2
|
|
@@ -92,6 +92,27 @@ module ActiveRabbit
|
|
|
92
92
|
response
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
+
def post(path, payload)
|
|
96
|
+
uri = URI.join(@base_uri.to_s, path)
|
|
97
|
+
req = Net::HTTP::Post.new(uri)
|
|
98
|
+
req['Content-Type'] = 'application/json'
|
|
99
|
+
req["X-Project-Token"] = configuration.api_key
|
|
100
|
+
req.body = payload.to_json
|
|
101
|
+
|
|
102
|
+
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
|
103
|
+
http.request(req)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
unless res.is_a?(Net::HTTPSuccess)
|
|
107
|
+
raise APIError, "ActiveRabbit API request failed: #{res.code} #{res.body}"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
JSON.parse(res.body)
|
|
111
|
+
rescue => e
|
|
112
|
+
@configuration.logger&.error("[ActiveRabbit] HTTP POST failed: #{e.class}: #{e.message}")
|
|
113
|
+
nil
|
|
114
|
+
end
|
|
115
|
+
|
|
95
116
|
def test_connection
|
|
96
117
|
response = make_request(:post, "/api/v1/test/connection", {
|
|
97
118
|
gem_version: ActiveRabbit::Client::VERSION,
|
data/lib/active_rabbit/client.rb
CHANGED
|
@@ -127,6 +127,21 @@ module ActiveRabbit
|
|
|
127
127
|
track_exception(exception, context: context, user_id: user_id, tags: tags)
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
+
def notify_deploy(project_slug:, status:, user:, version:, started_at: nil, finished_at: nil)
|
|
131
|
+
payload = {
|
|
132
|
+
revision: Client.configuration.revision,
|
|
133
|
+
environment: Client.configuration.environment,
|
|
134
|
+
project_slug: project_slug,
|
|
135
|
+
version: version,
|
|
136
|
+
status: status,
|
|
137
|
+
user: user,
|
|
138
|
+
started_at: started_at,
|
|
139
|
+
finished_at: finished_at
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
http_client.post("/api/v1/deploys", payload)
|
|
143
|
+
end
|
|
144
|
+
|
|
130
145
|
private
|
|
131
146
|
|
|
132
147
|
def event_processor
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerabbit-ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Shapalov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|