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
4b7da284
Commit
4b7da284
authored
Aug 21, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
da835529
b0af3979
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
121 additions
and
88 deletions
+121
-88
app/assets/javascripts/registry/components/app.vue
app/assets/javascripts/registry/components/app.vue
+52
-49
app/assets/javascripts/registry/components/svg_message.vue
app/assets/javascripts/registry/components/svg_message.vue
+0
-26
app/assets/stylesheets/pages/container_registry.scss
app/assets/stylesheets/pages/container_registry.scss
+0
-4
changelogs/unreleased/64383-pattern-matching-with-variables-causes-gitlabs-ci-lint-to-throw-500.yml
...ng-with-variables-causes-gitlabs-ci-lint-to-throw-500.yml
+5
-0
lib/gitlab/ci/pipeline/expression/lexeme/matches.rb
lib/gitlab/ci/pipeline/expression/lexeme/matches.rb
+2
-1
lib/gitlab/ci/pipeline/expression/lexeme/not_matches.rb
lib/gitlab/ci/pipeline/expression/lexeme/not_matches.rb
+2
-1
spec/javascripts/registry/components/app_spec.js
spec/javascripts/registry/components/app_spec.js
+4
-7
spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
.../lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
+28
-0
spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
.../gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
+28
-0
No files found.
app/assets/javascripts/registry/components/app.vue
View file @
4b7da284
<
script
>
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
store
from
'
../stores
'
;
import
clipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
import
CollapsibleContainer
from
'
./collapsible_container.vue
'
;
import
SvgMessage
from
'
./svg_message.vue
'
;
import
{
s__
,
sprintf
}
from
'
../../locale
'
;
export
default
{
...
...
@@ -12,8 +11,8 @@ export default {
components
:
{
clipboardButton
,
CollapsibleContainer
,
GlEmptyState
,
GlLoadingIcon
,
SvgMessage
,
},
props
:
{
endpoint
:
{
...
...
@@ -93,7 +92,9 @@ export default {
this
.
setMainEndpoint
(
this
.
endpoint
);
},
mounted
()
{
if
(
!
this
.
characterError
)
{
this
.
fetchRepos
();
}
},
methods
:
{
...
mapActions
([
'
setMainEndpoint
'
,
'
fetchRepos
'
]),
...
...
@@ -102,31 +103,32 @@ export default {
</
script
>
<
template
>
<div>
<svg-message
v-if=
"characterError"
id=
"invalid-characters"
:svg-path=
"containersErrorImage"
>
<h4>
{{
s__
(
'
ContainerRegistry|Docker connection error
'
)
}}
</h4>
<gl-empty-state
v-if=
"characterError"
:title=
"s__('ContainerRegistry|Docker connection error')"
:svg-path=
"containersErrorImage"
>
<template
#description
>
<p
v-html=
"dockerConnectionErrorText"
></p>
</svg-message>
</
template
>
</gl-empty-state>
<gl-loading-icon
v-else-if=
"isLoading
&& !characterError
"
size=
"md"
class=
"prepend-top-16"
/>
<gl-loading-icon
v-else-if=
"isLoading"
size=
"md"
class=
"prepend-top-16"
/>
<div
v-else-if=
"!isLoading &&
!characterError &&
repos.length"
>
<div
v-else-if=
"!isLoading && repos.length"
>
<h4>
{{ s__('ContainerRegistry|Container Registry') }}
</h4>
<p
v-html=
"introText"
></p>
<collapsible-container
v-for=
"item in repos"
:key=
"item.id"
:repo=
"item"
/>
</div>
<
svg-messag
e
v-else
-if=
"!isLoading && !characterError && !repos.length"
id=
"no-container-images
"
<
gl-empty-stat
e
v-else
:title=
"s__('ContainerRegistry|There are no container images stored for this project')
"
:svg-path=
"noContainersImage"
class=
"container-message"
>
<h4>
{{
s__
(
'
ContainerRegistry|There are no container images stored for this project
'
)
}}
</h4>
<p
v-html=
"noContainerImagesText"
></p>
<
template
#description
>
<p
class=
"js-no-container-images-text"
v-html=
"noContainerImagesText"
></p>
<h5>
{{
s__
(
'
ContainerRegistry|Quick Start
'
)
}}
</h5>
<p>
{{
...
...
@@ -157,6 +159,7 @@ export default {
/>
</span>
</div>
</svg-message>
</
template
>
</gl-empty-state>
</div>
</template>
app/assets/javascripts/registry/components/svg_message.vue
deleted
100644 → 0
View file @
da835529
<
script
>
export
default
{
name
:
'
RegistrySvgMessage
'
,
props
:
{
id
:
{
type
:
String
,
required
:
true
,
},
svgPath
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
:id=
"id"
class=
"empty-state container-message"
>
<div
class=
"svg-content"
>
<img
:src=
"svgPath"
class=
"flex-align-self-center"
/>
</div>
<div
class=
"text-content"
>
<slot></slot>
</div>
</div>
</
template
>
app/assets/stylesheets/pages/container_registry.scss
View file @
4b7da284
...
...
@@ -3,10 +3,6 @@
*/
.container-message
{
pre
{
white-space
:
pre-line
;
}
span
.btn
{
margin
:
0
;
}
...
...
changelogs/unreleased/64383-pattern-matching-with-variables-causes-gitlabs-ci-lint-to-throw-500.yml
0 → 100644
View file @
4b7da284
---
title
:
Fix 500 errors caused by pattern matching with variables in CI Lint
merge_request
:
31719
author
:
type
:
fixed
lib/gitlab/ci/pipeline/expression/lexeme/matches.rb
View file @
4b7da284
...
...
@@ -11,8 +11,9 @@ module Gitlab
def
evaluate
(
variables
=
{})
text
=
@left
.
evaluate
(
variables
)
regexp
=
@right
.
evaluate
(
variables
)
return
false
unless
regexp
regexp
.
scan
(
text
.
to_s
).
any
?
regexp
.
scan
(
text
.
to_s
).
present
?
end
def
self
.
build
(
_value
,
behind
,
ahead
)
...
...
lib/gitlab/ci/pipeline/expression/lexeme/not_matches.rb
View file @
4b7da284
...
...
@@ -11,8 +11,9 @@ module Gitlab
def
evaluate
(
variables
=
{})
text
=
@left
.
evaluate
(
variables
)
regexp
=
@right
.
evaluate
(
variables
)
return
true
unless
regexp
regexp
.
scan
(
text
.
to_s
).
none
?
regexp
.
scan
(
text
.
to_s
).
empty
?
end
def
self
.
build
(
_value
,
behind
,
ahead
)
...
...
spec/javascripts/registry/components/app_spec.js
View file @
4b7da284
...
...
@@ -84,12 +84,7 @@ describe('Registry List', () => {
it
(
'
should render empty message
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
p
'
)
.
textContent
.
trim
()
.
replace
(
/
[\r\n]
+/g
,
'
'
),
).
toEqual
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-no-container-images-text
'
).
textContent
).
toEqual
(
'
With the Container Registry, every project can have its own space to store its Docker images. More Information
'
,
);
done
();
...
...
@@ -124,7 +119,9 @@ describe('Registry List', () => {
it
(
'
should render invalid characters error message
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.container-message
'
)).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
p
'
)).
not
.
toContain
(
'
We are having trouble connecting to Docker, which could be due to an issue with your project name or path. More information
'
,
);
done
();
});
});
...
...
spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
View file @
4b7da284
...
...
@@ -69,6 +69,34 @@ describe Gitlab::Ci::Pipeline::Expression::Lexeme::Matches do
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when right is nil'
do
let
(
:left_value
)
{
'my-awesome-string'
}
let
(
:right_value
)
{
nil
}
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when left and right are nil'
do
let
(
:left_value
)
{
nil
}
let
(
:right_value
)
{
nil
}
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when left is an empty string'
do
let
(
:left_value
)
{
''
}
let
(
:right_value
)
{
Gitlab
::
UntrustedRegexp
.
new
(
'pattern'
)
}
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when left and right are empty strings'
do
let
(
:left_value
)
{
''
}
let
(
:right_value
)
{
Gitlab
::
UntrustedRegexp
.
new
(
''
)
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when left is a multiline string and matches right'
do
let
(
:left_value
)
do
<<~
TEXT
...
...
spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
View file @
4b7da284
...
...
@@ -69,6 +69,34 @@ describe Gitlab::Ci::Pipeline::Expression::Lexeme::NotMatches do
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when right is nil'
do
let
(
:left_value
)
{
'my-awesome-string'
}
let
(
:right_value
)
{
nil
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when left and right are nil'
do
let
(
:left_value
)
{
nil
}
let
(
:right_value
)
{
nil
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when left is an empty string'
do
let
(
:left_value
)
{
''
}
let
(
:right_value
)
{
Gitlab
::
UntrustedRegexp
.
new
(
'pattern'
)
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when left and right are empty strings'
do
let
(
:left_value
)
{
''
}
let
(
:right_value
)
{
Gitlab
::
UntrustedRegexp
.
new
(
''
)
}
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when left is a multiline string and matches right'
do
let
(
:left_value
)
do
<<~
TEXT
...
...
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