Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
cff104ec
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cff104ec
编写于
8月 28, 2017
作者:
S
Shinya Maeda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix spec
上级
acc74978
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
13 addition
and
13 deletion
+13
-13
app/models/ci/trigger_request.rb
app/models/ci/trigger_request.rb
+1
-1
lib/api/v3/triggers.rb
lib/api/v3/triggers.rb
+3
-2
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+1
-1
spec/factories/ci/trigger_requests.rb
spec/factories/ci/trigger_requests.rb
+4
-5
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-1
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+1
-1
spec/views/projects/jobs/show.html.haml_spec.rb
spec/views/projects/jobs/show.html.haml_spec.rb
+1
-1
未找到文件。
app/models/ci/trigger_request.rb
浏览文件 @
cff104ec
...
...
@@ -6,7 +6,7 @@ module Ci
belongs_to
:pipeline
,
foreign_key: :commit_id
has_many
:builds
# W
s swti
ched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# W
e swit
ched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# Ci::TriggerRequest doesn't save variables anymore.
validates
:variables
,
absence:
true
...
...
lib/api/v3/triggers.rb
浏览文件 @
cff104ec
...
...
@@ -34,9 +34,10 @@ module API
pipeline
=
result
[
:pipeline
]
trigger_request
=
pipeline
.
trigger_request
# W
s swti
ched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# W
e swit
ched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# Ci::TriggerRequest doesn't save variables anymore.
# Although, to prevent braking compatibility, copying variables and present it as Ci::TriggerRequest.
# Here is copying Ci::PipelineVariable to Ci::TriggerRequest.variables for presenting the variables.
# The same endpoint in v4 API pressents Pipeline instead of TriggerRequest, so it doesn't need such a process.
pipeline
.
variables
.
each
do
|
variable
|
trigger_request
.
variables
<<
{
key:
variable
.
key
,
value:
variable
.
value
}
end
...
...
spec/factories/ci/builds.rb
浏览文件 @
cff104ec
...
...
@@ -107,7 +107,7 @@ FactoryGirl.define do
end
trait
:triggered
do
trigger_request
factory: :ci_trigger_request_with_variables
# TODO:
trigger_request
factory: :ci_trigger_request_with_variables
end
after
(
:build
)
do
|
build
,
evaluator
|
...
...
spec/factories/ci/trigger_requests.rb
浏览文件 @
cff104ec
...
...
@@ -2,12 +2,11 @@ FactoryGirl.define do
factory
:ci_trigger_request
,
class:
Ci
::
TriggerRequest
do
trigger
factory: :ci_trigger
# We switched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# Ci::TriggerRequest doesn't save variables anymore, whereas old trigger requests still persist variables.
factory
:ci_trigger_request_with_variables
do
variables
do
{
TRIGGER_KEY_1
:
'TRIGGER_VALUE_1'
,
TRIGGER_KEY_2
:
'TRIGGER_VALUE_2'
}
after
(
:create
)
do
|
trigger_request
,
evaluator
|
trigger_request
.
update_attribute
(
:variables
,
{
TRIGGER_KEY_1
:
'TRIGGER_VALUE_1'
,
TRIGGER_KEY_2
:
'TRIGGER_VALUE_2'
}
)
end
end
end
...
...
spec/features/projects/jobs_spec.rb
浏览文件 @
cff104ec
...
...
@@ -292,7 +292,7 @@ feature 'Jobs' do
end
feature
'Variables'
do
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
)
}
# TODO:
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
)
}
let
(
:job
)
do
create
:ci_build
,
pipeline:
pipeline
,
trigger_request:
trigger_request
...
...
spec/models/ci/build_spec.rb
浏览文件 @
cff104ec
...
...
@@ -1492,7 +1492,7 @@ describe Ci::Build do
context
'when build is for triggers'
do
let
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
)
}
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
,
trigger:
trigger
)
}
# TODO:
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
,
trigger:
trigger
)
}
let
(
:user_trigger_variable
)
do
{
key: :TRIGGER_KEY_1
,
value:
'TRIGGER_VALUE_1'
,
public:
false
}
end
...
...
spec/requests/api/runner_spec.rb
浏览文件 @
cff104ec
...
...
@@ -559,7 +559,7 @@ describe API::Runner do
before
do
trigger
=
create
(
:ci_trigger
,
project:
project
)
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
,
builds:
[
job
],
trigger:
trigger
)
# TODO:
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
,
builds:
[
job
],
trigger:
trigger
)
project
.
variables
<<
Ci
::
Variable
.
new
(
key:
'SECRET_KEY'
,
value:
'secret_value'
)
end
...
...
spec/views/projects/jobs/show.html.haml_spec.rb
浏览文件 @
cff104ec
...
...
@@ -197,7 +197,7 @@ describe 'projects/jobs/show' do
end
describe
'shows trigger variables in sidebar'
do
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
)
}
# TODO:
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline:
pipeline
)
}
before
do
build
.
trigger_request
=
trigger_request
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录