Commit fce5547da0a685295b0ea0d563c16dc93da2a8d5

Authored by Nathan Broadbent
1 parent 74e12968
Exists in master and in 1 other branch production

Pass current_user to issue tracker's #create_issue method, for setting 'reported_by' fields

app/controllers/errs_controller.rb
... ... @@ -39,7 +39,7 @@ class ErrsController < ApplicationController
39 39 set_tracker_params
40 40  
41 41 if @app.issue_tracker
42   - @app.issue_tracker.create_issue @problem
  42 + @app.issue_tracker.create_issue @problem, current_user
43 43 else
44 44 flash[:error] = "This app has no issue tracker setup."
45 45 end
... ...
app/models/issue_trackers/fogbugz_tracker.rb
... ... @@ -22,7 +22,7 @@ class IssueTrackers::FogbugzTracker < IssueTracker
22 22 end
23 23 end
24 24  
25   - def create_issue(problem)
  25 + def create_issue(problem, reported_by)
26 26 fogbugz = Fogbugz::Interface.new(:email => username, :password => password, :uri => "https://#{account}.fogbugz.com")
27 27 fogbugz.authenticate
28 28  
... ...
app/models/issue_trackers/github_issues_tracker.rb
... ... @@ -19,10 +19,10 @@ class IssueTrackers::GithubIssuesTracker < IssueTracker
19 19 end
20 20 end
21 21  
22   - def create_issue(err)
  22 + def create_issue(problem, reported_by)
23 23 client = Octokit::Client.new(:login => username, :token => api_token)
24   - issue = client.create_issue(project_id, issue_title(err), body_template.result(binding).unpack('C*').pack('U*'), options = {})
25   - err.update_attribute :issue_link, issue.html_url
  24 + issue = client.create_issue(project_id, issue_title(problem), body_template.result(binding).unpack('C*').pack('U*'), options = {})
  25 + problem.update_attribute :issue_link, issue.html_url
26 26 end
27 27  
28 28 def body_template
... ...
app/models/issue_trackers/lighthouse_tracker.rb
... ... @@ -18,7 +18,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker
18 18 end
19 19 end
20 20  
21   - def create_issue(problem)
  21 + def create_issue(problem, reported_by)
22 22 Lighthouse.account = account
23 23 Lighthouse.token = api_token
24 24 # updating lighthouse account
... ...
app/models/issue_trackers/mingle_tracker.rb
... ... @@ -27,7 +27,7 @@ class IssueTrackers::MingleTracker < IssueTracker
27 27 end
28 28 end
29 29  
30   - def create_issue(problem)
  30 + def create_issue(problem, reported_by)
31 31 properties = ticket_properties_hash
32 32 basic_auth = account.gsub(/https?:\/\//, "https://#{username}:#{password}@")
33 33 Mingle.set_site "#{basic_auth}/api/v1/projects/#{project_id}/"
... ...
app/models/issue_trackers/pivotal_labs_tracker.rb
... ... @@ -13,7 +13,7 @@ class IssueTrackers::PivotalLabsTracker < IssueTracker
13 13 end
14 14 end
15 15  
16   - def create_issue(problem)
  16 + def create_issue(problem, reported_by)
17 17 PivotalTracker::Client.token = api_token
18 18 PivotalTracker::Client.use_ssl = true
19 19 project = PivotalTracker::Project.find project_id.to_i
... ...
app/models/issue_trackers/redmine_tracker.rb
... ... @@ -25,7 +25,7 @@ class IssueTrackers::RedmineTracker < IssueTracker
25 25 end
26 26 end
27 27  
28   - def create_issue(problem)
  28 + def create_issue(problem, reported_by)
29 29 token = api_token
30 30 acc = account
31 31 RedmineClient::Base.configure do
... ...
app/views/issue_trackers/github_issues_body.txt.erb
1   -[See this exception on Errbit](<%= app_err_url err.app, err %> "See this exception on Errbit")
2   -<% if notice = err.notices.first %>
  1 +[See this exception on Errbit](<%= app_err_url problem.app, problem %> "See this exception on Errbit")
  2 +<% if notice = problem.notices.first %>
3 3 # <%= notice.message %> #
4 4 ## Summary ##
5 5 <% if notice.request['url'].present? %>
... ...