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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fdffdcf1
Commit
fdffdcf1
authored
Nov 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
97b63407
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
133 additions
and
81 deletions
+133
-81
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+30
-5
app/models/commit_status.rb
app/models/commit_status.rb
+1
-5
app/models/concerns/ci/contextable.rb
app/models/concerns/ci/contextable.rb
+9
-34
app/models/concerns/ci/pipeline_delegator.rb
app/models/concerns/ci/pipeline_delegator.rb
+0
-2
app/models/project.rb
app/models/project.rb
+27
-6
changelogs/unreleased/xanf-make-audit-table-responsive.yml
changelogs/unreleased/xanf-make-audit-table-responsive.yml
+5
-0
db/post_migrate/20191105094625_set_report_type_for_vulnerabilities.rb
...ate/20191105094625_set_report_type_for_vulnerabilities.rb
+11
-3
locale/gitlab.pot
locale/gitlab.pot
+12
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+20
-19
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+18
-7
No files found.
app/models/ci/pipeline.rb
View file @
fdffdcf1
...
...
@@ -478,6 +478,10 @@ module Ci
end
end
def
before_sha
super
||
Gitlab
::
Git
::
BLANK_SHA
end
def
short_sha
Ci
::
Pipeline
.
truncate_sha
(
sha
)
end
...
...
@@ -640,12 +644,11 @@ module Ci
def
predefined_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'CI_PIPELINE_IID'
,
value:
iid
.
to_s
)
variables
.
append
(
key:
'CI_CONFIG_PATH'
,
value:
config_path
)
variables
.
append
(
key:
'CI_PIPELINE_SOURCE'
,
value:
source
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_MESSAGE'
,
value:
git_commit_message
.
to_s
)
variables
.
append
(
key:
'CI_CO
MMIT_TITLE'
,
value:
git_commit_full_title
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_DESCRIPTION'
,
value:
git_commit_description
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_REF_PROTECTED'
,
value:
(
!!
protected_ref?
).
to_
s
)
variables
.
append
(
key:
'CI_CO
NFIG_PATH'
,
value:
config_path
)
variables
.
concat
(
predefined_commit_variable
s
)
if
merge_request_event?
&&
merge_request
variables
.
append
(
key:
'CI_MERGE_REQUEST_EVENT_TYPE'
,
value:
merge_request_event_type
.
to_s
)
...
...
@@ -660,6 +663,28 @@ module Ci
end
end
def
predefined_commit_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'CI_COMMIT_SHA'
,
value:
sha
)
variables
.
append
(
key:
'CI_COMMIT_SHORT_SHA'
,
value:
short_sha
)
variables
.
append
(
key:
'CI_COMMIT_BEFORE_SHA'
,
value:
before_sha
)
variables
.
append
(
key:
'CI_COMMIT_REF_NAME'
,
value:
source_ref
)
variables
.
append
(
key:
'CI_COMMIT_REF_SLUG'
,
value:
source_ref_slug
)
variables
.
append
(
key:
'CI_COMMIT_TAG'
,
value:
ref
)
if
tag?
variables
.
append
(
key:
'CI_COMMIT_MESSAGE'
,
value:
git_commit_message
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_TITLE'
,
value:
git_commit_full_title
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_DESCRIPTION'
,
value:
git_commit_description
.
to_s
)
variables
.
append
(
key:
'CI_COMMIT_REF_PROTECTED'
,
value:
(
!!
protected_ref?
).
to_s
)
# legacy variables
variables
.
append
(
key:
'CI_BUILD_REF'
,
value:
sha
)
variables
.
append
(
key:
'CI_BUILD_BEFORE_SHA'
,
value:
before_sha
)
variables
.
append
(
key:
'CI_BUILD_REF_NAME'
,
value:
source_ref
)
variables
.
append
(
key:
'CI_BUILD_REF_SLUG'
,
value:
source_ref_slug
)
variables
.
append
(
key:
'CI_BUILD_TAG'
,
value:
ref
)
if
tag?
end
end
def
queued_duration
return
unless
started_at
...
...
app/models/commit_status.rb
View file @
fdffdcf1
...
...
@@ -17,7 +17,7 @@ class CommitStatus < ApplicationRecord
belongs_to
:auto_canceled_by
,
class_name:
'Ci::Pipeline'
delegate
:commit
,
to: :pipeline
delegate
:sha
,
:short_sha
,
to: :pipeline
delegate
:sha
,
:short_sha
,
:before_sha
,
to: :pipeline
validates
:pipeline
,
presence:
true
,
unless: :importing?
validates
:name
,
presence:
true
,
unless: :importing?
...
...
@@ -176,10 +176,6 @@ class CommitStatus < ApplicationRecord
will_save_change_to_status?
end
def
before_sha
pipeline
.
before_sha
||
Gitlab
::
Git
::
BLANK_SHA
end
def
group_name
name
.
to_s
.
gsub
(
%r{
\d
+[
\s
:/
\\
]+
\d
+
\s
*}
,
''
).
strip
end
...
...
app/models/concerns/ci/contextable.rb
View file @
fdffdcf1
...
...
@@ -54,46 +54,21 @@ module Ci
end
end
def
predefined_variables
# rubocop:disable Metrics/AbcSize
def
predefined_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'CI'
,
value:
'true'
)
variables
.
append
(
key:
'GITLAB_CI'
,
value:
'true'
)
variables
.
append
(
key:
'GITLAB_FEATURES'
,
value:
project
.
licensed_features
.
join
(
','
))
variables
.
append
(
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
)
variables
.
append
(
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
)
variables
.
append
(
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
)
variables
.
append
(
key:
'CI_SERVER_VERSION_MAJOR'
,
value:
Gitlab
.
version_info
.
major
.
to_s
)
variables
.
append
(
key:
'CI_SERVER_VERSION_MINOR'
,
value:
Gitlab
.
version_info
.
minor
.
to_s
)
variables
.
append
(
key:
'CI_SERVER_VERSION_PATCH'
,
value:
Gitlab
.
version_info
.
patch
.
to_s
)
variables
.
append
(
key:
'CI_SERVER_REVISION'
,
value:
Gitlab
.
revision
)
variables
.
append
(
key:
'CI_JOB_NAME'
,
value:
name
)
variables
.
append
(
key:
'CI_JOB_STAGE'
,
value:
stage
)
variables
.
append
(
key:
'CI_COMMIT_SHA'
,
value:
sha
)
variables
.
append
(
key:
'CI_COMMIT_SHORT_SHA'
,
value:
short_sha
)
variables
.
append
(
key:
'CI_COMMIT_BEFORE_SHA'
,
value:
before_sha
)
variables
.
append
(
key:
'CI_COMMIT_REF_NAME'
,
value:
source_ref
)
variables
.
append
(
key:
'CI_COMMIT_REF_SLUG'
,
value:
source_ref_slug
)
variables
.
append
(
key:
"CI_COMMIT_TAG"
,
value:
ref
)
if
tag?
variables
.
append
(
key:
"CI_PIPELINE_TRIGGERED"
,
value:
'true'
)
if
trigger_request
variables
.
append
(
key:
"CI_JOB_MANUAL"
,
value:
'true'
)
if
action?
variables
.
append
(
key:
"CI_NODE_INDEX"
,
value:
self
.
options
[
:instance
].
to_s
)
if
self
.
options
&
.
include?
(
:instance
)
variables
.
append
(
key:
"CI_NODE_TOTAL"
,
value:
(
self
.
options
&
.
dig
(
:parallel
)
||
1
).
to_s
)
variables
.
append
(
key:
"CI_DEFAULT_BRANCH"
,
value:
project
.
default_branch
)
variables
.
concat
(
legacy_variables
)
end
end
variables
.
append
(
key:
'CI_JOB_MANUAL'
,
value:
'true'
)
if
action?
variables
.
append
(
key:
'CI_PIPELINE_TRIGGERED'
,
value:
'true'
)
if
trigger_request
def
legacy_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'CI_BUILD_REF'
,
value:
sha
)
variables
.
append
(
key:
'CI_BUILD_BEFORE_SHA'
,
value:
before_sha
)
variables
.
append
(
key:
'CI_BUILD_REF_NAME'
,
value:
source_ref
)
variables
.
append
(
key:
'CI_BUILD_REF_SLUG'
,
value:
source_ref_slug
)
variables
.
append
(
key:
'CI_NODE_INDEX'
,
value:
self
.
options
[
:instance
].
to_s
)
if
self
.
options
&
.
include?
(
:instance
)
variables
.
append
(
key:
'CI_NODE_TOTAL'
,
value:
(
self
.
options
&
.
dig
(
:parallel
)
||
1
).
to_s
)
# legacy variables
variables
.
append
(
key:
'CI_BUILD_NAME'
,
value:
name
)
variables
.
append
(
key:
'CI_BUILD_STAGE'
,
value:
stage
)
variables
.
append
(
key:
"CI_BUILD_TAG"
,
value:
ref
)
if
tag?
variables
.
append
(
key:
"CI_BUILD_TRIGGERED"
,
value:
'true'
)
if
trigger_request
variables
.
append
(
key:
"CI_BUILD_MANUAL"
,
value:
'true'
)
if
action?
variables
.
append
(
key:
'CI_BUILD_TRIGGERED'
,
value:
'true'
)
if
trigger_request
variables
.
append
(
key:
'CI_BUILD_MANUAL'
,
value:
'true'
)
if
action?
end
end
...
...
app/models/concerns/ci/pipeline_delegator.rb
View file @
fdffdcf1
...
...
@@ -13,8 +13,6 @@ module Ci
included
do
delegate
:merge_request_event?
,
:merge_request_ref?
,
:source_ref
,
:source_ref_slug
,
:legacy_detached_merge_request_pipeline?
,
:merge_train_pipeline?
,
to: :pipeline
end
...
...
app/models/project.rb
View file @
fdffdcf1
...
...
@@ -1868,9 +1868,18 @@ class Project < ApplicationRecord
end
def
predefined_variables
visibility
=
Gitlab
::
VisibilityLevel
.
string_level
(
visibility_level
)
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
concat
(
predefined_ci_server_variables
)
.
concat
(
predefined_project_variables
)
.
concat
(
pages_variables
)
.
concat
(
container_registry_variables
)
.
concat
(
auto_devops_variables
)
.
concat
(
api_variables
)
end
def
predefined_project_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
append
(
key:
'GITLAB_FEATURES'
,
value:
licensed_features
.
join
(
','
))
.
append
(
key:
'CI_PROJECT_ID'
,
value:
id
.
to_s
)
.
append
(
key:
'CI_PROJECT_NAME'
,
value:
path
)
.
append
(
key:
'CI_PROJECT_TITLE'
,
value:
title
)
...
...
@@ -1878,16 +1887,28 @@ class Project < ApplicationRecord
.
append
(
key:
'CI_PROJECT_PATH_SLUG'
,
value:
full_path_slug
)
.
append
(
key:
'CI_PROJECT_NAMESPACE'
,
value:
namespace
.
full_path
)
.
append
(
key:
'CI_PROJECT_URL'
,
value:
web_url
)
.
append
(
key:
'CI_PROJECT_VISIBILITY'
,
value:
visibility
)
.
append
(
key:
'CI_PROJECT_VISIBILITY'
,
value:
Gitlab
::
VisibilityLevel
.
string_level
(
visibility_level
)
)
.
append
(
key:
'CI_PROJECT_REPOSITORY_LANGUAGES'
,
value:
repository_languages
.
map
(
&
:name
).
join
(
','
).
downcase
)
.
concat
(
pages_variables
)
.
concat
(
container_registry_variables
)
.
concat
(
auto_devops_variables
)
.
concat
(
api_variables
)
.
append
(
key:
'CI_DEFAULT_BRANCH'
,
value:
default_branch
)
end
def
predefined_ci_server_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
append
(
key:
'CI'
,
value:
'true'
)
.
append
(
key:
'GITLAB_CI'
,
value:
'true'
)
.
append
(
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
)
.
append
(
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
)
.
append
(
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
)
.
append
(
key:
'CI_SERVER_VERSION_MAJOR'
,
value:
Gitlab
.
version_info
.
major
.
to_s
)
.
append
(
key:
'CI_SERVER_VERSION_MINOR'
,
value:
Gitlab
.
version_info
.
minor
.
to_s
)
.
append
(
key:
'CI_SERVER_VERSION_PATCH'
,
value:
Gitlab
.
version_info
.
patch
.
to_s
)
.
append
(
key:
'CI_SERVER_REVISION'
,
value:
Gitlab
.
revision
)
end
def
pages_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
break
unless
pages_enabled?
variables
.
append
(
key:
'CI_PAGES_DOMAIN'
,
value:
Gitlab
.
config
.
pages
.
host
)
variables
.
append
(
key:
'CI_PAGES_URL'
,
value:
pages_url
)
end
...
...
changelogs/unreleased/xanf-make-audit-table-responsive.yml
0 → 100644
View file @
fdffdcf1
---
title
:
Added responsiveness to audit events table
merge_request
:
18859
author
:
type
:
added
db/post_migrate/20191105094625_set_report_type_for_vulnerabilities.rb
View file @
fdffdcf1
...
...
@@ -4,12 +4,20 @@ class SetReportTypeForVulnerabilities < ActiveRecord::Migration[5.2]
DOWNTIME
=
false
def
up
# set report_type based on associated vulnerability_occurrences
# set report_type based on vulnerability_occurrences from which the vulnerabilities were promoted,
# that is, first vulnerability_occurrences among those having the same vulnerability_id
execute
<<~
SQL
WITH first_findings_for_vulnerabilities AS (
SELECT MIN(id) AS id, vulnerability_id
FROM vulnerability_occurrences
WHERE vulnerability_id IS NOT NULL
GROUP BY vulnerability_id
)
UPDATE vulnerabilities
SET report_type = vulnerability_occurrences.report_type
FROM vulnerability_occurrences
WHERE vulnerabilities.id = vulnerability_occurrences.vulnerability_id
FROM vulnerability_occurrences, first_findings_for_vulnerabilities
WHERE vulnerability_occurrences.id = first_findings_for_vulnerabilities.id
AND vulnerabilities.id = vulnerability_occurrences.vulnerability_id
SQL
# set default report_type for orphan vulnerabilities (there should be none but...)
...
...
locale/gitlab.pot
View file @
fdffdcf1
...
...
@@ -2179,6 +2179,18 @@ msgstr ""
msgid "Audit Events is a way to keep track of important events that happened in GitLab."
msgstr ""
msgid "AuditEvents|(removed)"
msgstr ""
msgid "AuditEvents|Action"
msgstr ""
msgid "AuditEvents|At"
msgstr ""
msgid "AuditEvents|Target"
msgstr ""
msgid "Aug"
msgstr ""
...
...
spec/models/ci/build_spec.rb
View file @
fdffdcf1
...
...
@@ -2183,9 +2183,13 @@ describe Ci::Build do
{
key:
'CI_REGISTRY_USER'
,
value:
'gitlab-ci-token'
,
public:
true
,
masked:
false
},
{
key:
'CI_REGISTRY_PASSWORD'
,
value:
'my-token'
,
public:
false
,
masked:
true
},
{
key:
'CI_REPOSITORY_URL'
,
value:
build
.
repo_url
,
public:
false
,
masked:
false
},
{
key:
'CI_JOB_NAME'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_JOB_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_NODE_TOTAL'
,
value:
'1'
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_NAME'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'GITLAB_CI'
,
value:
'true'
,
public:
true
,
masked:
false
},
{
key:
'GITLAB_FEATURES'
,
value:
project
.
licensed_features
.
join
(
','
),
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_HOST'
,
value:
Gitlab
.
config
.
gitlab
.
host
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
,
public:
true
,
masked:
false
},
...
...
@@ -2193,21 +2197,7 @@ describe Ci::Build do
{
key:
'CI_SERVER_VERSION_MINOR'
,
value:
Gitlab
.
version_info
.
minor
.
to_s
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_VERSION_PATCH'
,
value:
Gitlab
.
version_info
.
patch
.
to_s
,
public:
true
,
masked:
false
},
{
key:
'CI_SERVER_REVISION'
,
value:
Gitlab
.
revision
,
public:
true
,
masked:
false
},
{
key:
'CI_JOB_NAME'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_JOB_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_SHA'
,
value:
build
.
sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_SHORT_SHA'
,
value:
build
.
short_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_BEFORE_SHA'
,
value:
build
.
before_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_REF_NAME'
,
value:
build
.
ref
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_REF_SLUG'
,
value:
build
.
ref_slug
,
public:
true
,
masked:
false
},
{
key:
'CI_NODE_TOTAL'
,
value:
'1'
,
public:
true
,
masked:
false
},
{
key:
'CI_DEFAULT_BRANCH'
,
value:
project
.
default_branch
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF'
,
value:
build
.
sha
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_BEFORE_SHA'
,
value:
build
.
before_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF_NAME'
,
value:
build
.
ref
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF_SLUG'
,
value:
build
.
ref_slug
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_NAME'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_STAGE'
,
value:
'test'
,
public:
true
,
masked:
false
},
{
key:
'GITLAB_FEATURES'
,
value:
project
.
licensed_features
.
join
(
','
),
public:
true
,
masked:
false
},
{
key:
'CI_PROJECT_ID'
,
value:
project
.
id
.
to_s
,
public:
true
,
masked:
false
},
{
key:
'CI_PROJECT_NAME'
,
value:
project
.
path
,
public:
true
,
masked:
false
},
{
key:
'CI_PROJECT_TITLE'
,
value:
project
.
title
,
public:
true
,
masked:
false
},
...
...
@@ -2217,16 +2207,26 @@ describe Ci::Build do
{
key:
'CI_PROJECT_URL'
,
value:
project
.
web_url
,
public:
true
,
masked:
false
},
{
key:
'CI_PROJECT_VISIBILITY'
,
value:
'private'
,
public:
true
,
masked:
false
},
{
key:
'CI_PROJECT_REPOSITORY_LANGUAGES'
,
value:
project
.
repository_languages
.
map
(
&
:name
).
join
(
','
).
downcase
,
public:
true
,
masked:
false
},
{
key:
'CI_DEFAULT_BRANCH'
,
value:
project
.
default_branch
,
public:
true
,
masked:
false
},
{
key:
'CI_PAGES_DOMAIN'
,
value:
Gitlab
.
config
.
pages
.
host
,
public:
true
,
masked:
false
},
{
key:
'CI_PAGES_URL'
,
value:
project
.
pages_url
,
public:
true
,
masked:
false
},
{
key:
'CI_API_V4_URL'
,
value:
'http://localhost/api/v4'
,
public:
true
,
masked:
false
},
{
key:
'CI_PIPELINE_IID'
,
value:
pipeline
.
iid
.
to_s
,
public:
true
,
masked:
false
},
{
key:
'CI_CONFIG_PATH'
,
value:
pipeline
.
config_path
,
public:
true
,
masked:
false
},
{
key:
'CI_PIPELINE_SOURCE'
,
value:
pipeline
.
source
,
public:
true
,
masked:
false
},
{
key:
'CI_CONFIG_PATH'
,
value:
pipeline
.
config_path
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_SHA'
,
value:
build
.
sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_SHORT_SHA'
,
value:
build
.
short_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_BEFORE_SHA'
,
value:
build
.
before_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_REF_NAME'
,
value:
build
.
ref
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_REF_SLUG'
,
value:
build
.
ref_slug
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_MESSAGE'
,
value:
pipeline
.
git_commit_message
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_TITLE'
,
value:
pipeline
.
git_commit_title
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_DESCRIPTION'
,
value:
pipeline
.
git_commit_description
,
public:
true
,
masked:
false
},
{
key:
'CI_COMMIT_REF_PROTECTED'
,
value:
(
!!
pipeline
.
protected_ref?
).
to_s
,
public:
true
,
masked:
false
}
{
key:
'CI_COMMIT_REF_PROTECTED'
,
value:
(
!!
pipeline
.
protected_ref?
).
to_s
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF'
,
value:
build
.
sha
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_BEFORE_SHA'
,
value:
build
.
before_sha
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF_NAME'
,
value:
build
.
ref
,
public:
true
,
masked:
false
},
{
key:
'CI_BUILD_REF_SLUG'
,
value:
build
.
ref_slug
,
public:
true
,
masked:
false
}
]
end
...
...
@@ -2235,7 +2235,7 @@ describe Ci::Build do
build
.
yaml_variables
=
[]
end
it
{
is_expected
.
to
include
(
*
predefined_variables
)
}
it
{
is_expected
.
to
eq
(
predefined_variables
)
}
describe
'variables ordering'
do
context
'when variables hierarchy is stubbed'
do
...
...
@@ -2449,6 +2449,7 @@ describe Ci::Build do
before
do
build
.
update
(
tag:
true
)
pipeline
.
update
(
tag:
true
)
end
it
{
is_expected
.
to
include
(
tag_variable
)
}
...
...
spec/models/ci/pipeline_spec.rb
View file @
fdffdcf1
...
...
@@ -808,13 +808,24 @@ describe Ci::Pipeline, :mailer do
it
'includes all predefined variables in a valid order'
do
keys
=
subject
.
map
{
|
variable
|
variable
[
:key
]
}
expect
(
keys
).
to
eq
%w[CI_PIPELINE_IID
CI_CONFIG_PATH
CI_PIPELINE_SOURCE
CI_COMMIT_MESSAGE
CI_COMMIT_TITLE
CI_COMMIT_DESCRIPTION
CI_COMMIT_REF_PROTECTED]
expect
(
keys
).
to
eq
%w[
CI_PIPELINE_IID
CI_PIPELINE_SOURCE
CI_CONFIG_PATH
CI_COMMIT_SHA
CI_COMMIT_SHORT_SHA
CI_COMMIT_BEFORE_SHA
CI_COMMIT_REF_NAME
CI_COMMIT_REF_SLUG
CI_COMMIT_MESSAGE
CI_COMMIT_TITLE
CI_COMMIT_DESCRIPTION
CI_COMMIT_REF_PROTECTED
CI_BUILD_REF
CI_BUILD_BEFORE_SHA
CI_BUILD_REF_NAME
CI_BUILD_REF_SLUG
]
end
context
'when source is merge request'
do
...
...
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