summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-06-03 15:46:37 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-06-03 15:53:30 +0200
commit32783c7f15cf03c13ed81afc5fb5a2b63f761c52 (patch)
treed44b56e35cae41832a1988be44ff88d79311fd22 /sonar-server
parent96a2e77ad59364031ec7689b2c1f0ed036ec6ef7 (diff)
downloadsonarqube-32783c7f15cf03c13ed81afc5fb5a2b63f761c52.tar.gz
sonarqube-32783c7f15cf03c13ed81afc5fb5a2b63f761c52.zip
SONAR-4305 fix migration of manual issues
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/401_migrate_violations_to_issues.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/401_migrate_violations_to_issues.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/401_migrate_violations_to_issues.rb
index af86d722c43..e13ca9b25b0 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/401_migrate_violations_to_issues.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/401_migrate_violations_to_issues.rb
@@ -89,12 +89,13 @@ class MigrateViolationsToIssues < ActiveRecord::Migration
if review_id.present?
# has review
status = violation[11]
+ manual_violation = ActiveRecord::ConnectionAdapters::Column.value_to_boolean(violation[18])
issue.status=(status=='OPEN' ? 'CONFIRMED' : status)
issue.issue_update_date=violation[16] || one_year_ago
issue.updated_at=violation[16] || one_year_ago
issue.severity=violation[12] || 'MAJOR'
issue.manual_severity=violation[14]
- issue.reporter=logins_by_id[violation[9].to_i] if violation[9].present?
+ issue.reporter=logins_by_id[violation[9].to_i] if (violation[9].present? && manual_violation)
issue.assignee=logins_by_id[violation[10].to_i] if violation[10].present?
plan_id = select_plan_id(review_id)
@@ -146,7 +147,7 @@ class MigrateViolationsToIssues < ActiveRecord::Migration
"select rev.id, s.project_id, rf.rule_id, rf.failure_level, rf.message, rf.line, rf.cost, rf.created_at,
rf.checksum,
rev.user_id, rev.assignee_id, rev.status, rev.severity, rev.resolution, rev.manual_severity, rev.data,
- rev.updated_at, s.root_project_id
+ rev.updated_at, s.root_project_id, rev.manual_violation
from rule_failures rf
inner join snapshots s on s.id=rf.snapshot_id
left join reviews rev on rev.rule_failure_permanent_id=rf.permanent_id