BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e16fba67
Commit
e16fba67
authored
Mar 13, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve how we handle persistent runner variables
parent
937e7f9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
19 deletions
+3
-19
variable.rb
app/models/ci/variable.rb
+0
-4
has_variable.rb
app/models/concerns/has_variable.rb
+1
-5
item.rb
lib/gitlab/ci/variables/collection/item.rb
+2
-10
No files found.
app/models/ci/variable.rb
View file @
e16fba67
...
...
@@ -12,9 +12,5 @@ module Ci
}
scope
:unprotected
,
->
{
where
(
protected:
false
)
}
def
to_hash
{
key:
key
,
value:
value
,
public:
false
}
end
end
end
app/models/concerns/has_variable.rb
View file @
e16fba67
...
...
@@ -20,12 +20,8 @@ module HasVariable
super
(
new_key
.
to_s
.
strip
)
end
def
to_hash
{
key:
key
,
value:
value
,
public:
false
}
end
def
to_runner_variable
to_hash
{
key:
key
,
value:
value
,
public:
false
}
end
end
end
lib/gitlab/ci/variables/collection/item.rb
View file @
e16fba67
...
...
@@ -3,8 +3,6 @@ module Gitlab
module
Variables
class
Collection
class
Item
# TODO, public by default?
#
def
initialize
(
**
options
)
@variable
=
{
key:
options
.
fetch
(
:key
),
...
...
@@ -34,17 +32,11 @@ module Gitlab
end
def
self
.
fabricate
(
resource
)
# TODO, to_runner_variable by default for class < ActiveRecord::Base
#
case
resource
when
Hash
self
.
new
(
resource
)
when
::
Ci
::
Variable
self
.
new
(
resource
.
to_hash
)
when
::
Ci
::
PipelineVariable
self
.
new
(
resource
.
to_hash
)
when
::
Ci
::
GroupVariable
self
.
new
(
resource
.
to_hash
)
when
::
HasVariable
self
.
new
(
resource
.
to_runner_variable
)
when
self
resource
.
dup
else
...
...
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