Merge branch 'rep_quality' of https://git.trustie.net/jacknudt/trustieforge into rep_quality
This commit is contained in:
commit
d58167f4bc
|
@ -300,8 +300,6 @@ class ProjectsController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
logger.debug "111111111"*100
|
|
||||||
# over
|
|
||||||
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
|
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
|
||||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||||
# 根据私密性,取出符合条件的所有数据
|
# 根据私密性,取出符合条件的所有数据
|
||||||
|
@ -321,7 +319,7 @@ class ProjectsController < ApplicationController
|
||||||
else
|
else
|
||||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
|
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
|
||||||
end
|
end
|
||||||
logger.debug "2"*100
|
|
||||||
# g = Gitlab.client
|
# g = Gitlab.client
|
||||||
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
|
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
|
||||||
# rep_statics_commit = @project.rep_statics.order("commits_num desc")
|
# rep_statics_commit = @project.rep_statics.order("commits_num desc")
|
||||||
|
@ -335,20 +333,14 @@ class ProjectsController < ApplicationController
|
||||||
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
|
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
|
||||||
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
|
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
logger.debug "3"*100
|
|
||||||
begin
|
begin
|
||||||
gid = @project.gpid
|
gid = @project.gpid
|
||||||
logger.debug "31"*100
|
g_project = g.project(gid)
|
||||||
g_branch = g.project(gid)
|
g_branch = g_project.default_branch.to_s
|
||||||
logger.debug "4"*100
|
|
||||||
g_branch = g_branch.default_branch.to_s
|
|
||||||
logger.debug "5"*100
|
|
||||||
rescue =>e
|
rescue =>e
|
||||||
logger.error("get gitlab project failed: " + e)
|
logger.error("get default branch failed: " + e)
|
||||||
end
|
end
|
||||||
logger.debug "6"*100
|
|
||||||
@rev = g_branch.nil? ? "master" : g_branch
|
@rev = g_branch.nil? ? "master" : g_branch
|
||||||
logger.debug "7"*100
|
|
||||||
end
|
end
|
||||||
# 根据对应的请求,返回对应的数据
|
# 根据对应的请求,返回对应的数据
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -165,7 +165,7 @@ class QualityAnalysisController < ApplicationController
|
||||||
logger.info("result: delete job ###################==>#{d_job}")
|
logger.info("result: delete job ###################==>#{d_job}")
|
||||||
qa.delete
|
qa.delete
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)}
|
format.html{redirect_to :controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
puts e
|
puts e
|
||||||
|
@ -199,9 +199,6 @@ class QualityAnalysisController < ApplicationController
|
||||||
|
|
||||||
# update成功则返回 ‘200’
|
# update成功则返回 ‘200’
|
||||||
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
|
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
|
||||||
get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280")
|
|
||||||
logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200'
|
|
||||||
|
|
||||||
# 数据更新到Trustie数据
|
# 数据更新到Trustie数据
|
||||||
if jenkins_job == '200'
|
if jenkins_job == '200'
|
||||||
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
|
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<p class="fontGrey3">代码重复度</p>
|
<p class="fontGrey3">代码重复度</p>
|
||||||
<p class="fontBlue2 pr"><%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %>
|
<p class="fontBlue2 pr"><%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %>
|
||||||
<span class="f10 c_white analysis-genral-icon <%= duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[1] %> borderRadius">
|
<span class="f10 c_white analysis-genral-icon <%= duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[1] %> borderRadius">
|
||||||
<%= @ha["duplicated_lines_density"].nil? ? 0 : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>
|
<%= @ha["duplicated_lines_density"].nil? ? "良好" : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<p class="fontGrey3">注释率</p>
|
<p class="fontGrey3">注释率</p>
|
||||||
<p class="fontBlue2 pr"><%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %>
|
<p class="fontBlue2 pr"><%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %>
|
||||||
<span class="f10 c_white analysis-genral-icon <%= comment_lines_density_status(@ha["comment_lines_density"].to_i)[1] %> borderRadius">
|
<span class="f10 c_white analysis-genral-icon <%= comment_lines_density_status(@ha["comment_lines_density"].to_i)[1] %> borderRadius">
|
||||||
<%= @ha["comment_lines_density"].nil? ? 0 : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>
|
<%= @ha["comment_lines_density"].nil? ? "较低" : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue