针对某些项目进行测试
This commit is contained in:
parent
edd777aacc
commit
dc41da89c4
|
@ -97,12 +97,13 @@ class PullRequestsController < ApplicationController
|
|||
job_name = Time.now.to_i
|
||||
# 如果分支有改动
|
||||
if compare_pull_request(source_branch, target_project_id, target_branch)
|
||||
# 自动生成配置Jenkinsjob,在merge事件的时候触发jenkins、sonar
|
||||
# merge发送的时候还没有接收,所以分析对象应该源项目
|
||||
exec_jenkins(source_branch, @project.gpid, git_url, job_name)
|
||||
qa = QualityAnalysis.create(:project_id => @project.id, :author_login => User.current.login, :sonar_version => 1, :path => "./",
|
||||
:branch => source_branch, :language => "java", :sonar_name => "#{job_name}")
|
||||
|
||||
if @project.try(:id).to_i == 4665
|
||||
# 自动生成配置Jenkinsjob,在merge事件的时候触发jenkins、sonar
|
||||
# merge发送的时候还没有接收,所以分析对象应该源项目
|
||||
exec_jenkins(source_branch, @project.gpid, git_url, job_name)
|
||||
qa = QualityAnalysis.create(:project_id => @project.id, :author_login => User.current.login, :sonar_version => 1, :path => "./",
|
||||
:branch => source_branch, :language => "java", :sonar_name => "#{job_name}")
|
||||
end
|
||||
|
||||
# 如果传送了目标项目ID即向fork源项目发送请求
|
||||
# if params[:forked_project_id] && params[:source_project] == "forked_project_name"
|
||||
|
@ -125,7 +126,9 @@ class PullRequestsController < ApplicationController
|
|||
format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)}
|
||||
end
|
||||
end
|
||||
qa.update_attribute(:pull_request_id, pr.id)
|
||||
if @project.try(:id).to_i == 4665
|
||||
qa.update_attribute(:pull_request_id, pr.id)
|
||||
end
|
||||
else
|
||||
tip = 1
|
||||
respond_to do |format|
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class QualityAnalysis < ActiveRecord::Base
|
||||
attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language, :sonar_name
|
||||
attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language, :sonar_name, :pull_request_id
|
||||
|
||||
def user_rep_name
|
||||
self.author_login+":"+self.rep_identifier
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddPullRequestIdToQualityAnalyses < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :quality_analyses, :pull_request_id, :integer
|
||||
end
|
||||
end
|
1587
db/schema.rb
1587
db/schema.rb
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue