redmine_airbrake_backend 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/airbrake_controller.rb +17 -10
- data/app/controllers/airbrake_project_settings_controller.rb +5 -7
- data/app/controllers/airbrake_report_controller.rb +0 -1
- data/app/helpers/airbrake_helper.rb +5 -1
- data/app/views/airbrake/issue_description/_section.erb +3 -0
- data/app/views/airbrake/issue_description/default.erb +4 -20
- data/lib/redmine_airbrake_backend/backtrace_element.rb +0 -1
- data/lib/redmine_airbrake_backend/error.rb +0 -1
- data/lib/redmine_airbrake_backend/ios_report.rb +0 -1
- data/lib/redmine_airbrake_backend/notice.rb +0 -1
- data/lib/redmine_airbrake_backend/patches/issue_category.rb +1 -1
- data/lib/redmine_airbrake_backend/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6852a17538390388bc5c1520c1b3c2eabf0b89
|
4
|
+
data.tar.gz: bd290d4558c8b9e30ef701345bc19c6d146b4637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53fe81a2ff23a5d751e0877b3289667a26120574e23c7f128af98b3c1ab609d7ddc7eff83227bdb412b36251c58bf5d91b840704f9c5808968d124fee249fdf6
|
7
|
+
data.tar.gz: 21143a051e41b0da6f87ee20f14ffa5dad949c7cefa7a60e304a89183e651f6f771d0fcc37866516813a1ff95d291480a97d22d89ce7eb37d86f7e33be79c4ae
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
require 'redmine_airbrake_backend/notice'
|
3
3
|
|
4
|
-
|
5
4
|
# Controller with airbrake related stuff
|
6
5
|
class AirbrakeController < ::ApplicationController
|
7
6
|
class InvalidRequest < StandardError; end
|
8
7
|
|
9
8
|
skip_before_action :verify_authenticity_token
|
10
9
|
|
11
|
-
prepend_before_action :load_records
|
12
10
|
prepend_before_action :parse_key
|
13
11
|
prepend_before_action :find_project
|
12
|
+
|
14
13
|
before_action :authorize
|
14
|
+
before_action :find_tracker
|
15
|
+
before_action :find_category
|
16
|
+
before_action :find_priority
|
17
|
+
before_action :find_assignee
|
18
|
+
before_action :find_repository
|
15
19
|
|
16
20
|
after_action :cleanup_tempfiles
|
17
21
|
|
@@ -24,31 +28,34 @@ class AirbrakeController < ::ApplicationController
|
|
24
28
|
end
|
25
29
|
|
26
30
|
def parse_key
|
27
|
-
@key = JSON.parse(params[:key]).
|
31
|
+
@key = JSON.parse(params[:key]).with_indifferent_access rescue nil
|
28
32
|
|
29
33
|
# API key
|
30
34
|
invalid_request!('No or invalid API key') if @key.blank? || @key[:key].blank?
|
31
35
|
params[:key] = @key[:key]
|
32
36
|
end
|
33
37
|
|
34
|
-
def
|
35
|
-
# Tracker
|
38
|
+
def find_tracker
|
36
39
|
@tracker = record_for(@project.trackers, :tracker)
|
37
40
|
invalid_request!('No or invalid tracker') if @tracker.blank?
|
38
41
|
|
39
|
-
#
|
42
|
+
# Check notice ID field
|
40
43
|
invalid_request!('Custom field for notice hash not available on selected tracker') if @tracker.custom_fields.find_by(id: notice_hash_field.id).blank?
|
44
|
+
end
|
41
45
|
|
42
|
-
|
46
|
+
def find_category
|
43
47
|
@category = record_for(@project.issue_categories, :category)
|
48
|
+
end
|
44
49
|
|
45
|
-
|
50
|
+
def find_priority
|
46
51
|
@priority = record_for(IssuePriority, :priority) || IssuePriority.default
|
52
|
+
end
|
47
53
|
|
48
|
-
|
54
|
+
def find_assignee
|
49
55
|
@assignee = record_for(@project.users, :assignee, [:id, :login])
|
56
|
+
end
|
50
57
|
|
51
|
-
|
58
|
+
def find_repository
|
52
59
|
@repository = @project.repositories.find_by(identifier: (@key[:repository] || ''))
|
53
60
|
end
|
54
61
|
|
@@ -6,13 +6,7 @@ class AirbrakeProjectSettingsController < ::ApplicationController
|
|
6
6
|
menu_item :settings
|
7
7
|
|
8
8
|
def update
|
9
|
-
@airbrake_project_setting.
|
10
|
-
@airbrake_project_setting.category_id = params[:airbrake_project_setting][:category_id]
|
11
|
-
@airbrake_project_setting.priority_id = params[:airbrake_project_setting][:priority_id]
|
12
|
-
@airbrake_project_setting.reopen_regexp = params[:airbrake_project_setting][:reopen_regexp]
|
13
|
-
@airbrake_project_setting.reopen_repeat_description = params[:airbrake_project_setting][:reopen_repeat_description]
|
14
|
-
|
15
|
-
if @airbrake_project_setting.save
|
9
|
+
if @airbrake_project_setting.update(airbrake_project_setting_params)
|
16
10
|
flash[:notice] = l(:notice_successful_update)
|
17
11
|
end
|
18
12
|
|
@@ -29,4 +23,8 @@ class AirbrakeProjectSettingsController < ::ApplicationController
|
|
29
23
|
@airbrake_project_setting = @project.airbrake_settings || AirbrakeProjectSetting.new
|
30
24
|
@airbrake_project_setting.project = @project
|
31
25
|
end
|
26
|
+
|
27
|
+
def airbrake_project_setting_params
|
28
|
+
params.require(:airbrake_project_setting).permit(:tracker_id, :category_id, :priority_id, :reopen_regexp, :reopen_repeat_description)
|
29
|
+
end
|
32
30
|
end
|
@@ -18,7 +18,7 @@ module AirbrakeHelper
|
|
18
18
|
if value.is_a?(String)
|
19
19
|
lines << "|@#{key}@|@#{value}@|"
|
20
20
|
elsif value.is_a?(Hash)
|
21
|
-
lines << "|@#{key}@|@#{value.map { |k, v| "#{k}: #{v}"}.join(', ')}@|"
|
21
|
+
lines << "|@#{key}@|@#{value.map { |k, v| "#{k}: #{v}" }.join(', ')}@|"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -55,6 +55,10 @@ module AirbrakeHelper
|
|
55
55
|
markup + " in ??<notextile>#{element.function}</notextile>??"
|
56
56
|
end
|
57
57
|
|
58
|
+
def airbrake_render_section(data, section)
|
59
|
+
render partial: 'airbrake/issue_description/section', locals: { data: data, section: section }
|
60
|
+
end
|
61
|
+
|
58
62
|
private
|
59
63
|
|
60
64
|
def airbrake_repository_for_backtrace_element(element)
|
@@ -17,29 +17,13 @@ h2. Application:
|
|
17
17
|
<% end %>
|
18
18
|
|
19
19
|
|
20
|
-
|
21
|
-
h2. Parameters:
|
22
|
-
|
23
|
-
<%= airbrake_format_table(notice.params) %>
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
|
27
|
-
<% if notice.session.present? %>
|
28
|
-
h2. Session
|
29
|
-
|
30
|
-
<%= airbrake_format_table(notice.session) %>
|
31
|
-
<% end %>
|
20
|
+
<%= airbrake_render_section(notice.params, 'Parameters') %>
|
32
21
|
|
33
22
|
|
34
|
-
|
35
|
-
h2. Context
|
23
|
+
<%= airbrake_render_section(notice.session, 'Session') %>
|
36
24
|
|
37
|
-
<%= airbrake_format_table(notice.context) %>
|
38
|
-
<% end %>
|
39
25
|
|
26
|
+
<%= airbrake_render_section(notice.context, 'Context') %>
|
40
27
|
|
41
|
-
<% if notice.environment.present? %>
|
42
|
-
h2. Environment
|
43
28
|
|
44
|
-
<%=
|
45
|
-
<% end %>
|
29
|
+
<%= airbrake_render_section(notice.environment, 'Environment') %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_airbrake_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- app/controllers/airbrake_report_controller.rb
|
72
72
|
- app/helpers/airbrake_helper.rb
|
73
73
|
- app/models/airbrake_project_setting.rb
|
74
|
+
- app/views/airbrake/issue_description/_section.erb
|
74
75
|
- app/views/airbrake/issue_description/default.erb
|
75
76
|
- app/views/projects/settings/_airbrake.html.erb
|
76
77
|
- app/views/settings/_airbrake.html.erb
|