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
2016f367
Commit
2016f367
authored
Jul 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into cs-warn-on-failure
parents
737e5226
79b02e40
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
283 additions
and
105 deletions
+283
-105
CHANGELOG
CHANGELOG
+2
-0
Gemfile.lock
Gemfile.lock
+1
-1
app/assets/stylesheets/framework/buttons.scss
app/assets/stylesheets/framework/buttons.scss
+18
-0
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+4
-0
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+2
-1
app/assets/stylesheets/pages/issues.scss
app/assets/stylesheets/pages/issues.scss
+8
-0
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+13
-1
app/assets/stylesheets/pages/pipelines.scss
app/assets/stylesheets/pages/pipelines.scss
+17
-0
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+16
-0
app/assets/stylesheets/pages/status.scss
app/assets/stylesheets/pages/status.scss
+8
-0
app/assets/stylesheets/pages/tags.scss
app/assets/stylesheets/pages/tags.scss
+7
-0
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+7
-7
app/helpers/time_helper.rb
app/helpers/time_helper.rb
+13
-13
app/models/user.rb
app/models/user.rb
+1
-1
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+5
-5
app/views/projects/builds/_sidebar.html.haml
app/views/projects/builds/_sidebar.html.haml
+1
-1
app/views/projects/buttons/_fork.html.haml
app/views/projects/buttons/_fork.html.haml
+2
-2
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+1
-1
app/views/projects/forks/index.html.haml
app/views/projects/forks/index.html.haml
+2
-2
app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
.../generic_commit_statuses/_generic_commit_status.html.haml
+1
-1
app/views/projects/tags/show.html.haml
app/views/projects/tags/show.html.haml
+35
-32
app/views/shared/icons/_icon_fork.svg
app/views/shared/icons/_icon_fork.svg
+1
-0
app/views/shared/icons/_icon_status_cancel.svg
app/views/shared/icons/_icon_status_cancel.svg
+12
-0
app/views/shared/icons/_icon_status_failed.svg
app/views/shared/icons/_icon_status_failed.svg
+12
-0
app/views/shared/icons/_icon_status_pending.svg
app/views/shared/icons/_icon_status_pending.svg
+13
-0
app/views/shared/icons/_icon_status_running.svg
app/views/shared/icons/_icon_status_running.svg
+12
-0
app/views/shared/icons/_icon_status_success.svg
app/views/shared/icons/_icon_status_success.svg
+15
-0
app/views/shared/icons/_icon_status_warning.svg
app/views/shared/icons/_icon_status_warning.svg
+15
-0
config/initializers/secure_headers.rb
config/initializers/secure_headers.rb
+2
-12
lib/gitlab/checks/force_push.rb
lib/gitlab/checks/force_push.rb
+2
-2
spec/helpers/ci_status_helper_spec.rb
spec/helpers/ci_status_helper_spec.rb
+8
-2
spec/helpers/time_helper_spec.rb
spec/helpers/time_helper_spec.rb
+11
-14
spec/models/user_spec.rb
spec/models/user_spec.rb
+16
-7
No files found.
CHANGELOG
View file @
2016f367
Please view this file on the master branch, on stable branches it's out of date.
v 8.11.0 (unreleased)
- Fix of 'Commits being passed to custom hooks are already reachable when using the UI'
- Limit git rev-list output count to one in forced push check
v 8.10.0 (unreleased)
- Fix profile activity heatmap to show correct day name (eanplatter)
...
...
@@ -35,6 +36,7 @@ v 8.10.0 (unreleased)
- Added day name to contribution calendar tooltips
- Make images fit to the size of the viewport !4810
- Fix check for New Branch button on Issue page !4630 (winniehell)
- Fix GFM autocomplete not working on wiki pages
- Fix MR-auto-close text added to description. !4836
- Support U2F devices in Firefox. !5177
- Fix issue, preventing users w/o push access to sort tags !5105 (redetection)
...
...
Gemfile.lock
View file @
2016f367
...
...
@@ -578,7 +578,7 @@ GEM
railties (>= 4.2.0, < 5.1)
rinku (2.0.0)
rotp (2.1.2)
rouge (2.0.
3
)
rouge (2.0.
5
)
rqrcode (0.7.0)
chunky_png
rqrcode-rails3 (0.1.7)
...
...
app/assets/stylesheets/framework/buttons.scss
View file @
2016f367
...
...
@@ -49,6 +49,17 @@
border-color
:
$border-dark
;
color
:
$color
;
}
svg
{
path
{
fill
:
$color
;
}
use
{
stroke
:
$color
;
}
}
}
@mixin
btn-green
{
...
...
@@ -173,6 +184,13 @@
.caret
{
margin-left
:
5px
;
}
svg
{
height
:
15px
;
width
:
auto
;
position
:
relative
;
top
:
2px
;
}
}
.btn-lg
{
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
2016f367
...
...
@@ -198,6 +198,10 @@ header.header-pinned-nav {
.sidebar-collapsed-icon
{
cursor
:
pointer
;
.btn
{
background-color
:
$gray-light
;
}
}
}
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
2016f367
...
...
@@ -122,7 +122,8 @@
button
{
float
:
right
;
padding
:
3px
5px
;
padding
:
1px
5px
;
background-color
:
$gray-light
;
}
}
...
...
app/assets/stylesheets/pages/issues.scss
View file @
2016f367
...
...
@@ -78,6 +78,14 @@ form.edit-issue {
}
}
.merge-request-ci-status
{
svg
{
margin-right
:
4px
;
position
:
relative
;
top
:
1px
;
}
}
@media
(
max-width
:
$screen-xs-max
)
{
.issue-btn-group
{
width
:
100%
;
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
2016f367
...
...
@@ -60,8 +60,10 @@
.ci_widget
{
border-bottom
:
1px
solid
#eef0f2
;
i
{
svg
{
margin-right
:
4px
;
position
:
relative
;
top
:
1px
;
}
&
.ci-success
{
...
...
@@ -204,6 +206,16 @@
.merge-request-title
{
margin-bottom
:
2px
;
.ci-status-link
{
svg
{
height
:
16px
;
width
:
16px
;
position
:
relative
;
top
:
3px
;
}
}
}
}
...
...
app/assets/stylesheets/pages/pipelines.scss
View file @
2016f367
...
...
@@ -49,6 +49,14 @@
.commit-link
{
.ci-status
{
svg
{
top
:
1px
;
margin-right
:
0
;
}
}
a
:hover
{
text-decoration
:
none
;
}
...
...
@@ -124,6 +132,15 @@
}
}
.stage-cell
{
svg
{
height
:
18px
;
width
:
18px
;
vertical-align
:
middle
;
}
}
.duration
,
.finished-at
{
color
:
$table-text-gray
;
...
...
app/assets/stylesheets/pages/projects.scss
View file @
2016f367
...
...
@@ -129,6 +129,17 @@
color
:
$layout-link-gray
;
}
svg
{
path
{
fill
:
$layout-link-gray
;
}
use
{
stroke
:
$layout-link-gray
;
}
}
.fa-caret-down
{
margin-left
:
3px
;
}
...
...
@@ -486,6 +497,11 @@ pre.light-well {
>
span
{
margin-left
:
10px
;
}
svg
{
position
:
relative
;
top
:
2px
;
}
}
}
...
...
app/assets/stylesheets/pages/status.scss
View file @
2016f367
...
...
@@ -42,6 +42,14 @@
color
:
$blue-normal
;
border-color
:
$blue-normal
;
}
svg
{
height
:
13px
;
width
:
13px
;
position
:
relative
;
top
:
1px
;
margin
:
0
3px
;
}
}
.ci-status-icon-success
{
...
...
app/assets/stylesheets/pages/tags.scss
0 → 100644
View file @
2016f367
.tag-buttons
{
line-height
:
40px
;
.btn
:not
(
.dropdown-toggle
)
{
margin-left
:
10px
;
}
}
app/helpers/ci_status_helper.rb
View file @
2016f367
...
...
@@ -29,20 +29,20 @@ module CiStatusHelper
icon_name
=
case
status
when
'success'
'
check
'
'
icon_status_success
'
when
'success_with_warnings'
'
exclamation-triangle
'
'
icon_status_warning
'
when
'failed'
'
close
'
'
icon_status_failed
'
when
'pending'
'
clock-o
'
'
icon_status_pending
'
when
'running'
'
spinner
'
'
icon_status_running
'
else
'
circle
'
'
icon_status_cancel
'
end
icon
(
icon_name
+
' fw'
)
custom_icon
(
icon_name
)
end
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
,
cssclass:
''
)
...
...
app/helpers/time_helper.rb
View file @
2016f367
module
TimeHelper
def
duration_in_words
(
finished_at
,
started_at
)
if
finished_at
&&
started_at
interval_in_seconds
=
finished_at
.
to_i
-
started_at
.
to_i
elsif
started_at
interval_in_seconds
=
Time
.
now
.
to_i
-
started_at
.
to_i
end
time_interval_in_words
(
interval_in_seconds
)
end
def
time_interval_in_words
(
interval_in_seconds
)
minutes
=
interval_in_seconds
/
60
seconds
=
interval_in_seconds
-
minutes
*
60
...
...
@@ -25,9 +15,19 @@ module TimeHelper
end
def
duration_in_numbers
(
finished_at
,
started_at
)
diff_in_seconds
=
finished_at
.
to_i
-
started_at
.
to_i
time_format
=
diff_in_seconds
<
1
.
hour
?
"%M:%S"
:
"%H:%M:%S"
interval
=
interval_in_seconds
(
started_at
,
finished_at
)
time_format
=
interval
<
1
.
hour
?
"%M:%S"
:
"%H:%M:%S"
Time
.
at
(
diff_in_seconds
).
utc
.
strftime
(
time_format
)
Time
.
at
(
interval
).
utc
.
strftime
(
time_format
)
end
private
def
interval_in_seconds
(
started_at
,
finished_at
=
nil
)
if
started_at
&&
finished_at
finished_at
.
to_i
-
started_at
.
to_i
elsif
started_at
Time
.
now
.
to_i
-
started_at
.
to_i
end
end
end
app/models/user.rb
View file @
2016f367
...
...
@@ -854,7 +854,7 @@ class User < ActiveRecord::Base
groups
.
joins
(
:shared_projects
).
select
(
:project_id
)]
if
min_access_level
scope
=
{
access_level:
Gitlab
::
Access
.
values
.
select
{
|
access
|
access
>=
min_access_level
}
}
scope
=
{
access_level:
Gitlab
::
Access
.
all_
values
.
select
{
|
access
|
access
>=
min_access_level
}
}
relations
=
[
relations
.
shift
]
+
relations
.
map
{
|
relation
|
relation
.
where
(
members:
scope
)
}
end
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
2016f367
-
project
=
@target_project
||
@project
-
noteable_class
=
@noteable
.
class
if
@noteable
.
present?
-
if
@noteable
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
@noteable
.
class
,
type_id:
params
[
:id
])
}
"
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
noteable_class
,
type_id:
params
[
:id
])
}
"
GitLab
.
GfmAutoComplete
.
cachedData
=
undefined
;
GitLab
.
GfmAutoComplete
.
setup
();
app/views/projects/builds/_sidebar.html.haml
View file @
2016f367
...
...
@@ -49,7 +49,7 @@
-
if
@build
.
duration
%p
.build-detail-row
%span
.build-light-text
Duration:
#{
duration_in_words
(
@build
.
finished_at
,
@build
.
started_at
)
}
=
time_interval_in_words
(
@build
.
duration
)
-
if
@build
.
finished_at
%p
.build-detail-row
%span
.build-light-text
Finished:
...
...
app/views/projects/buttons/_fork.html.haml
View file @
2016f367
...
...
@@ -2,7 +2,7 @@
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'btn has-tooltip'
do
=
icon
(
'code-fork fw
'
)
=
custom_icon
(
'icon_fork
'
)
Fork
%div
.count-with-arrow
%span
.arrow
...
...
@@ -10,7 +10,7 @@
=
@project
.
forks_count
-
else
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn has-tooltip'
do
=
icon
(
'code-fork fw
'
)
=
custom_icon
(
'icon_fork
'
)
Fork
%div
.count-with-arrow
%span
.arrow
...
...
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
2016f367
...
...
@@ -35,7 +35,7 @@
-
stages_status
=
pipeline
.
statuses
.
latest
.
stages_status
-
stages
.
each
do
|
stage
|
%td
%td
.stage-cell
-
status
=
stages_status
[
stage
]
-
tooltip
=
"
#{
stage
.
titleize
}
:
#{
status
||
'not found'
}
"
-
if
status
...
...
app/views/projects/forks/index.html.haml
View file @
2016f367
...
...
@@ -31,11 +31,11 @@
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'btn btn-new'
do
=
icon
(
'code-fork fw
'
)
=
custom_icon
(
'icon_fork
'
)
Fork
-
else
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn btn-new'
do
=
icon
(
'code-fork fw
'
)
=
custom_icon
(
'icon_fork
'
)
Fork
...
...
app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
View file @
2016f367
...
...
@@ -51,7 +51,7 @@
%td
.duration
-
if
generic_commit_status
.
duration
=
icon
(
"clock-o"
)
#{
duration_in_words
(
generic_commit_status
.
finished_at
,
generic_commit_status
.
started_at
)
}
=
time_interval_in_words
(
generic_commit_status
.
duration
)
%td
.timestamp
-
if
generic_commit_status
.
finished_at
...
...
app/views/projects/tags/show.html.haml
View file @
2016f367
-
@no_container
=
true
-
page_title
@tag
.
name
,
"Tags"
=
render
"projects/commits/head"
.row-content-block
.pull-right
%div
{
class:
container_class
}
.sub-header-block
.pull-right.tag-buttons
-
if
can?
(
current_user
,
:push_code
,
@project
)
=
link_to
edit_namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn-grouped
btn has-tooltip'
,
title:
'Edit release notes'
do
=
link_to
edit_namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'
btn has-tooltip'
,
title:
'Edit release notes'
do
=
icon
(
"pencil"
)
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped
has-tooltip'
,
title:
'Browse files'
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn
has-tooltip'
,
title:
'Browse files'
do
=
icon
(
'files-o'
)
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped
has-tooltip'
,
title:
'Browse commits'
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn
has-tooltip'
,
title:
'Browse commits'
do
=
icon
(
'history'
)
-
if
can?
current_user
,
:download_code
,
@project
=
render
'projects/tags/download'
,
ref:
@tag
.
name
,
project:
@project
...
...
@@ -16,6 +18,7 @@
.pull-right
=
link_to
namespace_project_tag_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-remove remove-row grouped has-tooltip'
,
title:
"Delete tag"
,
method: :delete
,
data:
{
confirm:
"Deleting the '
#{
@tag
.
name
}
' tag cannot be undone. Are you sure?"
}
do
%i
.fa.fa-trash-o
.tag-info.append-bottom-10
.title
%span
.item-title
=
@tag
.
name
-
if
@commit
...
...
@@ -26,7 +29,7 @@
%pre
.body
=
strip_gpg_signature
(
@tag
.
message
)
.append-bottom-default.prepend-top-default
.append-bottom-default.prepend-top-default
-
if
@release
.
description
.
present?
.description
.wiki
...
...
app/views/shared/icons/_icon_fork.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"40"
height=
"40"
viewBox=
"0 0 40 40"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
><defs><circle
id=
"a"
cx=
"4"
cy=
"4"
r=
"4"
/><mask
id=
"d"
width=
"8"
height=
"8"
x=
"0"
y=
"0"
fill=
"#fff"
><use
xlink:href=
"#a"
/></mask><circle
id=
"b"
cx=
"20"
cy=
"4"
r=
"4"
/><mask
id=
"e"
width=
"8"
height=
"8"
x=
"0"
y=
"0"
fill=
"#fff"
><use
xlink:href=
"#b"
/></mask><circle
id=
"c"
cx=
"12"
cy=
"30"
r=
"4"
/><mask
id=
"f"
width=
"8"
height=
"8"
x=
"0"
y=
"0"
fill=
"#fff"
><use
xlink:href=
"#c"
/></mask></defs><g
fill=
"none"
fill-rule=
"evenodd"
transform=
"translate(8 3)"
><path
fill=
"#7E7E7E"
d=
"M10 19.667c-4.14-1.29-7.389-5.878-7.389-5.878C2.274 13.353 2 12.545 2 12.01V6h4v5.509c0 .276.166.65.367.831 0 0 1.136 1.028 1.746 1.574C9.617 15.261 11.048 16 12.09 16c1.028 0 2.41-.723 3.858-2.048.588-.54 1.84-1.742 1.84-1.742a.784.784 0 0 0 .211-.502V6h4v6.008c0 .548-.259 1.349-.601 1.795 0 0-3.21 4.707-7.399 5.916V27h-4v-7.333z"
/><use
stroke=
"#7E7E7E"
stroke-width=
"4"
mask=
"url(#d)"
xlink:href=
"#a"
/><use
stroke=
"#7E7E7E"
stroke-width=
"4"
mask=
"url(#e)"
xlink:href=
"#b"
/><use
stroke=
"#7E7E7E"
stroke-width=
"4"
mask=
"url(#f)"
xlink:href=
"#c"
/></g></svg>
\ No newline at end of file
app/views/shared/icons/_icon_status_cancel.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<use
stroke=
"#5C5C5C"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
<rect
width=
"10"
height=
"1"
x=
"2"
y=
"6.5"
fill=
"#5C5C5C"
transform=
"rotate(45 7 7)"
rx=
".3"
/>
</g>
</svg>
app/views/shared/icons/_icon_status_failed.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<use
stroke=
"#D22852"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
<path
fill=
"#D22852"
d=
"M7.5,6.5 L7.5,4.30578971 C7.5,4.12531853 7.36809219,4 7.20537567,4 L6.79462433,4 C6.63904572,4 6.5,4.13690672 6.5,4.30578971 L6.5,6.5 L4.30578971,6.5 C4.12531853,6.5 4,6.63190781 4,6.79462433 L4,7.20537567 C4,7.36095428 4.13690672,7.5 4.30578971,7.5 L6.5,7.5 L6.5,9.69421029 C6.5,9.87468147 6.63190781,10 6.79462433,10 L7.20537567,10 C7.36095428,10 7.5,9.86309328 7.5,9.69421029 L7.5,7.5 L9.69421029,7.5 C9.87468147,7.5 10,7.36809219 10,7.20537567 L10,6.79462433 C10,6.63904572 9.86309328,6.5 9.69421029,6.5 L7.5,6.5 Z"
transform=
"rotate(45 7 7)"
/>
</g>
</svg>
app/views/shared/icons/_icon_status_pending.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<use
stroke=
"#E75E40"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
<rect
width=
"1"
height=
"4"
x=
"5"
y=
"5"
fill=
"#E75E40"
rx=
".3"
/>
<rect
width=
"1"
height=
"4"
x=
"8"
y=
"5"
fill=
"#E75E40"
rx=
".3"
/>
</g>
</svg>
app/views/shared/icons/_icon_status_running.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<use
stroke=
"#2D9FD8"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
<path
fill=
"#2D9FD8"
d=
"M7,3.00800862 C9.09023405,3.13960661 10.7448145,4.87657932 10.7448145,7 C10.7448145,9.209139 8.95395346,11 6.74481446,11 C5.4560962,11 4.30972054,10.3905589 3.57817301,9.44416214 L7,7 L7,3.00800862 Z"
/>
</g>
</svg>
app/views/shared/icons/_icon_status_success.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<use
stroke=
"#31AF64"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
<g
fill=
"#31AF64"
transform=
"rotate(45 -.13 10.953)"
>
<rect
width=
"1"
height=
"5"
x=
"2"
rx=
".3"
/>
<rect
width=
"3"
height=
"1"
y=
"4"
rx=
".3"
/>
</g>
</g>
</svg>
app/views/shared/icons/_icon_status_warning.svg
0 → 100644
View file @
2016f367
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<circle
id=
"a"
cx=
"7"
cy=
"7"
r=
"7"
/>
<mask
id=
"b"
width=
"14"
height=
"14"
x=
"0"
y=
"0"
fill=
"white"
>
<use
xlink:href=
"#a"
/>
</mask>
</defs>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<g
fill=
"#FF8A24"
transform=
"translate(6 3)"
>
<rect
width=
"2"
height=
"5"
rx=
".5"
/>
<rect
width=
"2"
height=
"2"
y=
"6"
rx=
".5"
/>
</g>
<use
stroke=
"#FF8A24"
stroke-width=
"2"
mask=
"url(#b)"
xlink:href=
"#a"
/>
</g>
</svg>
config/initializers/secure_headers.rb
View file @
2016f367
...
...
@@ -4,14 +4,7 @@
require
'gitlab/current_settings'
include
Gitlab
::
CurrentSettings
# If Sentry is enabled and the Rails app is running in production mode,
# this will construct the Report URI for Sentry.
if
Rails
.
env
.
production?
&&
current_application_settings
.
sentry_enabled
uri
=
URI
.
parse
(
current_application_settings
.
sentry_dsn
)
CSP_REPORT_URI
=
"
#{
uri
.
scheme
}
://
#{
uri
.
host
}
/api
#{
uri
.
path
}
/csp-report/?sentry_key=
#{
uri
.
user
}
"
else
CSP_REPORT_URI
=
''
end
CSP_REPORT_URI
=
''
# Content Security Policy Headers
# For more information on CSP see:
...
...
@@ -71,10 +64,7 @@ SecureHeaders::Configuration.default do |config|
upgrade_insecure_requests:
true
}
# Reports are sent to Sentry if it's enabled.
if
current_application_settings
.
sentry_enabled
config
.
csp
[
:report_uri
]
=
%W(
#{
CSP_REPORT_URI
}
)
end
# Allow Bootstrap Linter in development mode.
if
Rails
.
env
.
development?
...
...
lib/gitlab/checks/force_push.rb
View file @
2016f367
...
...
@@ -8,8 +8,8 @@ module Gitlab
if
Gitlab
::
Git
.
blank_ref?
(
oldrev
)
||
Gitlab
::
Git
.
blank_ref?
(
newrev
)
false
else
missed_ref
s
,
_
=
Gitlab
::
Popen
.
popen
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
project
.
repository
.
path_to_repo
}
rev-list
#{
oldrev
}
^
#{
newrev
}
)
)
missed_ref
s
.
split
(
"
\n
"
).
size
>
0
missed_ref
,
_
=
Gitlab
::
Popen
.
popen
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
project
.
repository
.
path_to_repo
}
rev-list --max-count=1
#{
oldrev
}
^
#{
newrev
}
)
)
missed_ref
.
present?
end
end
end
...
...
spec/helpers/ci_status_helper_spec.rb
View file @
2016f367
...
...
@@ -7,7 +7,13 @@ describe CiStatusHelper do
let
(
:failed_commit
)
{
double
(
"Ci::Pipeline"
,
status:
'failed'
)
}
describe
'ci_icon_for_status'
do
it
{
expect
(
helper
.
ci_icon_for_status
(
success_commit
.
status
)).
to
include
(
'fa-check'
)
}
it
{
expect
(
helper
.
ci_icon_for_status
(
failed_commit
.
status
)).
to
include
(
'fa-close'
)
}
it
'renders to correct svg on success'
do
expect
(
helper
).
to
receive
(
:render
).
with
(
'shared/icons/icon_status_success.svg'
,
anything
)
helper
.
ci_icon_for_status
(
success_commit
.
status
)
end
it
'renders the correct svg on failure'
do
expect
(
helper
).
to
receive
(
:render
).
with
(
'shared/icons/icon_status_failed.svg'
,
anything
)
helper
.
ci_icon_for_status
(
failed_commit
.
status
)
end
end
end
spec/helpers/time_helper_spec.rb
View file @
2016f367
require
'spec_helper'
describe
TimeHelper
do
describe
"#
duration
_in_words"
do
describe
"#
time_interval
_in_words"
do
it
"returns minutes and seconds"
do
intervals_in_words
=
{
100
=>
"1 minute 40 seconds"
,
...
...
@@ -11,26 +11,23 @@ describe TimeHelper do
}
intervals_in_words
.
each
do
|
interval
,
expectation
|
expect
(
duration_in_words
(
Time
.
now
+
interval
,
Time
.
now
)).
to
eq
(
expectation
)
end
expect
(
time_interval_in_words
(
interval
)).
to
eq
(
expectation
)
end
it
"calculates interval from now if there is no finished_at"
do
expect
(
duration_in_words
(
nil
,
Time
.
now
-
5
)).
to
eq
(
"5 seconds"
)
end
end
describe
"#
time_interval_in_word
s"
do
describe
"#
duration_in_number
s"
do
it
"returns minutes and seconds"
do
intervals_in_words
=
{
100
=>
"1 minute 40 seconds"
,
121
=>
"2 minutes 1 second"
,
3721
=>
"62 minutes 1 second"
,
0
=>
"0 seconds"
duration_in_numbers
=
{
[
100
,
0
]
=>
"01:40"
,
[
121
,
0
]
=>
"02:01"
,
[
3721
,
0
]
=>
"01:02:01"
,
[
0
,
0
]
=>
"00:00"
,
[
nil
,
Time
.
now
.
to_i
-
42
]
=>
"00:42"
}
intervals_in_word
s
.
each
do
|
interval
,
expectation
|
expect
(
time_interval_in_words
(
interval
)).
to
eq
(
expectation
)
duration_in_number
s
.
each
do
|
interval
,
expectation
|
expect
(
duration_in_numbers
(
*
interval
)).
to
eq
(
expectation
)
end
end
end
...
...
spec/models/user_spec.rb
View file @
2016f367
...
...
@@ -887,16 +887,25 @@ describe User, models: true do
end
describe
'#authorized_projects'
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:private_project
)
{
create
(
:project
,
:private
)
}
context
'with a minimum access level'
do
it
'includes projects for which the user is an owner'
do
user
=
create
(
:user
)
project
=
create
(
:empty_project
,
:private
,
namespace:
user
.
namespace
)
before
do
private_project
.
team
<<
[
user
,
Gitlab
::
Access
::
MASTER
]
expect
(
user
.
authorized_projects
(
Gitlab
::
Access
::
REPORTER
))
.
to
contain_exactly
(
project
)
end
subject
{
user
.
authorized_projects
}
it
'includes projects for which the user is a master'
do
user
=
create
(
:user
)
project
=
create
(
:empty_project
,
:private
)
it
{
is_expected
.
to
eq
([
private_project
])
}
project
.
team
<<
[
user
,
Gitlab
::
Access
::
MASTER
]
expect
(
user
.
authorized_projects
(
Gitlab
::
Access
::
REPORTER
))
.
to
contain_exactly
(
project
)
end
end
end
describe
'#ci_authorized_runners'
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