rails_error_dashboard 0.1.1 → 0.1.3
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/README.md +66 -21
- data/app/assets/stylesheets/rails_error_dashboard/_catppuccin_mocha.scss +107 -0
- data/app/assets/stylesheets/rails_error_dashboard/_components.scss +625 -0
- data/app/assets/stylesheets/rails_error_dashboard/_layout.scss +257 -0
- data/app/assets/stylesheets/rails_error_dashboard/_theme_variables.scss +203 -0
- data/app/assets/stylesheets/rails_error_dashboard/application.css +926 -15
- data/app/assets/stylesheets/rails_error_dashboard/application.css.map +7 -0
- data/app/assets/stylesheets/rails_error_dashboard/application.scss +61 -0
- data/app/controllers/rails_error_dashboard/errors_controller.rb +94 -1
- data/app/helpers/rails_error_dashboard/application_helper.rb +42 -4
- data/app/helpers/rails_error_dashboard/backtrace_helper.rb +91 -0
- data/app/helpers/rails_error_dashboard/overview_helper.rb +78 -0
- data/app/helpers/rails_error_dashboard/user_agent_helper.rb +118 -0
- data/app/models/rails_error_dashboard/error_comment.rb +27 -0
- data/app/models/rails_error_dashboard/error_log.rb +145 -0
- data/app/views/layouts/rails_error_dashboard.html.erb +796 -299
- data/app/views/layouts/rails_error_dashboard_old_backup.html.erb +383 -0
- data/app/views/rails_error_dashboard/errors/_error_row.html.erb +2 -0
- data/app/views/rails_error_dashboard/errors/_pattern_insights.html.erb +4 -4
- data/app/views/rails_error_dashboard/errors/_timeline.html.erb +167 -0
- data/app/views/rails_error_dashboard/errors/analytics.html.erb +138 -22
- data/app/views/rails_error_dashboard/errors/index.html.erb +83 -4
- data/app/views/rails_error_dashboard/errors/overview.html.erb +253 -0
- data/app/views/rails_error_dashboard/errors/platform_comparison.html.erb +29 -18
- data/app/views/rails_error_dashboard/errors/show.html.erb +353 -54
- data/config/routes.rb +7 -0
- data/db/migrate/20251226020000_add_workflow_fields_to_error_logs.rb +27 -0
- data/db/migrate/20251226020100_create_error_comments.rb +18 -0
- data/lib/generators/rails_error_dashboard/install/install_generator.rb +8 -2
- data/lib/generators/rails_error_dashboard/install/templates/initializer.rb +21 -0
- data/lib/rails_error_dashboard/commands/batch_delete_errors.rb +1 -1
- data/lib/rails_error_dashboard/commands/batch_resolve_errors.rb +2 -2
- data/lib/rails_error_dashboard/commands/log_error.rb +47 -9
- data/lib/rails_error_dashboard/commands/resolve_error.rb +1 -1
- data/lib/rails_error_dashboard/configuration.rb +8 -0
- data/lib/rails_error_dashboard/error_reporter.rb +4 -4
- data/lib/rails_error_dashboard/logger.rb +105 -0
- data/lib/rails_error_dashboard/middleware/error_catcher.rb +2 -2
- data/lib/rails_error_dashboard/plugin.rb +3 -3
- data/lib/rails_error_dashboard/plugin_registry.rb +2 -2
- data/lib/rails_error_dashboard/plugins/jira_integration_plugin.rb +1 -1
- data/lib/rails_error_dashboard/plugins/metrics_plugin.rb +1 -1
- data/lib/rails_error_dashboard/queries/dashboard_stats.rb +109 -1
- data/lib/rails_error_dashboard/queries/errors_list.rb +61 -6
- data/lib/rails_error_dashboard/services/backtrace_parser.rb +113 -0
- data/lib/rails_error_dashboard/version.rb +1 -1
- data/lib/rails_error_dashboard.rb +2 -0
- metadata +18 -2
- data/lib/tasks/rails_error_dashboard_tasks.rake +0 -4
|
@@ -15,6 +15,9 @@ module RailsErrorDashboard
|
|
|
15
15
|
# Association for tracking individual error occurrences
|
|
16
16
|
has_many :error_occurrences, class_name: "RailsErrorDashboard::ErrorOccurrence", dependent: :destroy
|
|
17
17
|
|
|
18
|
+
# Association for comment threads (Phase 3: Workflow Integration)
|
|
19
|
+
has_many :comments, class_name: "RailsErrorDashboard::ErrorComment", foreign_key: :error_log_id, dependent: :destroy
|
|
20
|
+
|
|
18
21
|
# Cascade pattern associations
|
|
19
22
|
# parent_cascade_patterns: patterns where this error is the CHILD (errors that cause this error)
|
|
20
23
|
has_many :parent_cascade_patterns, class_name: "RailsErrorDashboard::CascadePattern",
|
|
@@ -38,6 +41,15 @@ module RailsErrorDashboard
|
|
|
38
41
|
scope :last_24_hours, -> { where("occurred_at >= ?", 24.hours.ago) }
|
|
39
42
|
scope :last_week, -> { where("occurred_at >= ?", 1.week.ago) }
|
|
40
43
|
|
|
44
|
+
# Phase 3: Workflow Integration scopes
|
|
45
|
+
scope :active, -> { where("snoozed_until IS NULL OR snoozed_until < ?", Time.current) }
|
|
46
|
+
scope :snoozed, -> { where("snoozed_until IS NOT NULL AND snoozed_until >= ?", Time.current) }
|
|
47
|
+
scope :by_status, ->(status) { where(status: status) }
|
|
48
|
+
scope :assigned, -> { where.not(assigned_to: nil) }
|
|
49
|
+
scope :unassigned, -> { where(assigned_to: nil) }
|
|
50
|
+
scope :by_assignee, ->(name) { where(assigned_to: name) }
|
|
51
|
+
scope :by_priority, ->(level) { where(priority_level: level) }
|
|
52
|
+
|
|
41
53
|
# Set defaults and tracking
|
|
42
54
|
before_validation :set_defaults, on: :create
|
|
43
55
|
before_create :set_tracking_fields
|
|
@@ -179,6 +191,139 @@ module RailsErrorDashboard
|
|
|
179
191
|
Commands::ResolveError.call(id, resolution_data)
|
|
180
192
|
end
|
|
181
193
|
|
|
194
|
+
# Phase 3: Workflow Integration methods
|
|
195
|
+
|
|
196
|
+
# Assignment methods
|
|
197
|
+
def assign_to!(assignee_name)
|
|
198
|
+
update!(
|
|
199
|
+
assigned_to: assignee_name,
|
|
200
|
+
assigned_at: Time.current,
|
|
201
|
+
status: "in_progress" # Auto-transition to in_progress when assigned
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def unassign!
|
|
206
|
+
update!(
|
|
207
|
+
assigned_to: nil,
|
|
208
|
+
assigned_at: nil
|
|
209
|
+
)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def assigned?
|
|
213
|
+
assigned_to.present?
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Snooze methods
|
|
217
|
+
def snooze!(hours, reason: nil)
|
|
218
|
+
snooze_until = hours.hours.from_now
|
|
219
|
+
# Store snooze reason in comments if provided
|
|
220
|
+
if reason.present?
|
|
221
|
+
comments.create!(
|
|
222
|
+
author_name: assigned_to || "System",
|
|
223
|
+
body: "Snoozed for #{hours} hours: #{reason}"
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
update!(snoozed_until: snooze_until)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def unsnooze!
|
|
230
|
+
update!(snoozed_until: nil)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def snoozed?
|
|
234
|
+
snoozed_until.present? && snoozed_until >= Time.current
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Priority methods
|
|
238
|
+
def priority_label
|
|
239
|
+
case priority_level
|
|
240
|
+
when 3 then "Critical"
|
|
241
|
+
when 2 then "High"
|
|
242
|
+
when 1 then "Medium"
|
|
243
|
+
when 0 then "Low"
|
|
244
|
+
else "Unset"
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def priority_color
|
|
249
|
+
case priority_level
|
|
250
|
+
when 3 then "danger" # Critical = red
|
|
251
|
+
when 2 then "warning" # High = orange
|
|
252
|
+
when 1 then "info" # Medium = blue
|
|
253
|
+
when 0 then "secondary" # Low = gray
|
|
254
|
+
else "light"
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def calculate_priority
|
|
259
|
+
# Automatic priority calculation based on severity and frequency
|
|
260
|
+
severity_weight = case severity
|
|
261
|
+
when :critical then 3
|
|
262
|
+
when :high then 2
|
|
263
|
+
when :medium then 1
|
|
264
|
+
else 0
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
frequency_weight = if occurrence_count >= 100
|
|
268
|
+
3
|
|
269
|
+
elsif occurrence_count >= 10
|
|
270
|
+
2
|
|
271
|
+
elsif occurrence_count >= 5
|
|
272
|
+
1
|
|
273
|
+
else
|
|
274
|
+
0
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Take the higher of severity or frequency
|
|
278
|
+
[ severity_weight, frequency_weight ].max
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Status transition methods
|
|
282
|
+
def status_badge_color
|
|
283
|
+
case status
|
|
284
|
+
when "new" then "primary"
|
|
285
|
+
when "in_progress" then "info"
|
|
286
|
+
when "investigating" then "warning"
|
|
287
|
+
when "resolved" then "success"
|
|
288
|
+
when "wont_fix" then "secondary"
|
|
289
|
+
else "light"
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
def can_transition_to?(new_status)
|
|
294
|
+
# Define valid status transitions
|
|
295
|
+
valid_transitions = {
|
|
296
|
+
"new" => [ "in_progress", "investigating", "wont_fix" ],
|
|
297
|
+
"in_progress" => [ "investigating", "resolved", "new" ],
|
|
298
|
+
"investigating" => [ "resolved", "in_progress", "wont_fix" ],
|
|
299
|
+
"resolved" => [ "new" ], # Can reopen if error recurs
|
|
300
|
+
"wont_fix" => [ "new" ] # Can reopen
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
valid_transitions[status]&.include?(new_status) || false
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def update_status!(new_status, comment: nil)
|
|
307
|
+
return false unless can_transition_to?(new_status)
|
|
308
|
+
|
|
309
|
+
transaction do
|
|
310
|
+
update!(status: new_status)
|
|
311
|
+
|
|
312
|
+
# Auto-resolve if status is "resolved"
|
|
313
|
+
update!(resolved: true) if new_status == "resolved"
|
|
314
|
+
|
|
315
|
+
# Add comment about status change
|
|
316
|
+
if comment.present?
|
|
317
|
+
comments.create!(
|
|
318
|
+
author_name: assigned_to || "System",
|
|
319
|
+
body: "Status changed to #{new_status}: #{comment}"
|
|
320
|
+
)
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
true
|
|
325
|
+
end
|
|
326
|
+
|
|
182
327
|
# Get error statistics
|
|
183
328
|
def self.statistics(days = 7)
|
|
184
329
|
start_date = days.days.ago
|