Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
085d5eae
Commit
085d5eae
authored
Jan 18, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added private methods to initialize variables in the ci_cd_pipelines_controller
parent
d00e00ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
app/controllers/projects/settings/ci_cd_pipelines_controller.rb
...ntrollers/projects/settings/ci_cd_pipelines_controller.rb
+16
-5
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+1
-0
No files found.
app/controllers/projects/settings/ci_cd_pipelines_controller.rb
View file @
085d5eae
...
@@ -4,18 +4,29 @@ module Projects
...
@@ -4,18 +4,29 @@ module Projects
before_action
:authorize_admin_pipeline!
before_action
:authorize_admin_pipeline!
def
show
def
show
# runners
define_runners_variables
# variables
@variable
=
Ci
::
Variable
.
new
define_triggers_variables
define_badges_variables
end
private
def
define_runners_variables
@project_runners
=
@project
.
runners
.
ordered
@project_runners
=
@project
.
runners
.
ordered
@assignable_runners
=
current_user
.
ci_authorized_runners
.
@assignable_runners
=
current_user
.
ci_authorized_runners
.
assignable_for
(
project
).
ordered
.
page
(
params
[
:page
]).
per
(
20
)
assignable_for
(
project
).
ordered
.
page
(
params
[
:page
]).
per
(
20
)
@shared_runners
=
Ci
::
Runner
.
shared
.
active
@shared_runners
=
Ci
::
Runner
.
shared
.
active
@shared_runners_count
=
@shared_runners
.
count
(
:all
)
@shared_runners_count
=
@shared_runners
.
count
(
:all
)
# variables
end
@variable
=
Ci
::
Variable
.
new
# trigger
s
def
define_triggers_variable
s
@triggers
=
@project
.
triggers
@triggers
=
@project
.
triggers
@trigger
=
Ci
::
Trigger
.
new
@trigger
=
Ci
::
Trigger
.
new
# pipelines
end
def
define_badges_variables
@ref
=
params
[
:ref
]
||
@project
.
default_branch
||
'master'
@ref
=
params
[
:ref
]
||
@project
.
default_branch
||
'master'
@badges
=
[
Gitlab
::
Badge
::
Build
::
Status
,
@badges
=
[
Gitlab
::
Badge
::
Build
::
Status
,
...
...
spec/features/runners_spec.rb
View file @
085d5eae
...
@@ -122,6 +122,7 @@ describe "Runners" do
...
@@ -122,6 +122,7 @@ describe "Runners" do
scenario
'user checks default configuration'
do
scenario
'user checks default configuration'
do
visit
namespace_project_runner_path
(
project
.
namespace
,
project
,
runner
)
visit
namespace_project_runner_path
(
project
.
namespace
,
project
,
runner
)
expect
(
page
).
to
have_content
'Can run untagged jobs Yes'
expect
(
page
).
to
have_content
'Can run untagged jobs Yes'
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment