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
f4f9ee94
Commit
f4f9ee94
authored
Oct 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/sm/35954-create-kubernetes-cluster-on-gke-from-k8s-service
parents
20abcbff
5a23af92
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
120 additions
and
15 deletions
+120
-15
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-0
app/assets/javascripts/locale/sprintf.js
app/assets/javascripts/locale/sprintf.js
+10
-10
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+4
-0
app/assets/stylesheets/framework/new-nav.scss
app/assets/stylesheets/framework/new-nav.scss
+1
-1
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+1
-0
app/assets/stylesheets/pages/note_form.scss
app/assets/stylesheets/pages/note_form.scss
+1
-1
app/models/ci/build.rb
app/models/ci/build.rb
+4
-0
app/views/shared/notes/_comment_button.html.haml
app/views/shared/notes/_comment_button.html.haml
+1
-1
changelogs/unreleased/37970-timestamped-ci.yml
changelogs/unreleased/37970-timestamped-ci.yml
+5
-0
changelogs/unreleased/38187-38315-fix-dropdown-open-top-bottom-spacing.yml
...ased/38187-38315-fix-dropdown-open-top-bottom-spacing.yml
+5
-0
changelogs/unreleased/add-ci-builds-index-for-jobscontroller.yml
...ogs/unreleased/add-ci-builds-index-for-jobscontroller.yml
+5
-0
db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb
.../20170927095921_add_ci_builds_index_for_jobscontroller.rb
+39
-0
db/schema.rb
db/schema.rb
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+12
-1
spec/lib/gitlab/ci/ansi2html_spec.rb
spec/lib/gitlab/ci/ansi2html_spec.rb
+26
-0
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+3
-0
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
f4f9ee94
...
...
@@ -548,6 +548,7 @@ GitLabDropdown = (function() {
GitLabDropdown
.
prototype
.
positionMenuAbove
=
function
()
{
var
$menu
=
this
.
dropdown
.
find
(
'
.dropdown-menu
'
);
$menu
.
addClass
(
'
dropdown-open-top
'
);
$menu
.
css
(
'
top
'
,
'
initial
'
);
$menu
.
css
(
'
bottom
'
,
'
100%
'
);
};
...
...
app/assets/javascripts/locale/sprintf.js
View file @
f4f9ee94
...
...
@@ -12,15 +12,15 @@ import _ from 'underscore';
@see https://gitlab.com/gitlab-org/gitlab-ce/issues/37992
**/
export
default
(
input
,
parameters
,
escapeParameters
=
true
)
=>
{
let
output
=
input
;
let
output
=
input
;
if
(
parameters
)
{
Object
.
keys
(
parameters
).
forEach
((
parameterName
)
=>
{
const
parameterValue
=
parameters
[
parameterName
];
const
escapedParameterValue
=
escapeParameters
?
_
.
escape
(
parameterValue
)
:
parameterValue
;
output
=
output
.
replace
(
new
RegExp
(
`%{
${
parameterName
}
}`
,
'
g
'
),
escapedParameterValue
);
});
}
if
(
parameters
)
{
Object
.
keys
(
parameters
).
forEach
((
parameterName
)
=>
{
const
parameterValue
=
parameters
[
parameterName
];
const
escapedParameterValue
=
escapeParameters
?
_
.
escape
(
parameterValue
)
:
parameterValue
;
output
=
output
.
replace
(
new
RegExp
(
`%{
${
parameterName
}
}`
,
'
g
'
),
escapedParameterValue
);
});
}
return
output
;
}
return
output
;
}
;
app/assets/stylesheets/framework/dropdowns.scss
View file @
f4f9ee94
...
...
@@ -745,6 +745,10 @@
#{
$selector
}
.dropdown-menu-nav
{
margin-bottom
:
24px
;
&
.dropdown-open-top
{
margin-bottom
:
$dropdown-vertical-offset
;
}
li
{
display
:
block
;
padding
:
0
1px
;
...
...
app/assets/stylesheets/framework/new-nav.scss
View file @
f4f9ee94
...
...
@@ -295,7 +295,7 @@ header.navbar-gitlab-new {
.header-user
.dropdown-menu-nav
,
.header-new
.dropdown-menu-nav
{
margin-top
:
4px
;
margin-top
:
$dropdown-vertical-offset
;
}
.breadcrumbs
{
...
...
app/assets/stylesheets/framework/variables.scss
View file @
f4f9ee94
...
...
@@ -327,6 +327,7 @@ $regular_font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-San
* Dropdowns
*/
$dropdown-width
:
300px
;
$dropdown-vertical-offset
:
4px
;
$dropdown-link-color
:
#555
;
$dropdown-link-hover-bg
:
$row-hover
;
$dropdown-empty-row-bg
:
rgba
(
#000
,
.04
);
...
...
app/assets/stylesheets/pages/note_form.scss
View file @
f4f9ee94
...
...
@@ -362,7 +362,7 @@
.dropdown-menu
{
top
:
initial
;
bottom
:
40px
;
bottom
:
100%
;
width
:
298px
;
}
...
...
app/models/ci/build.rb
View file @
f4f9ee94
...
...
@@ -229,6 +229,10 @@ module Ci
variables
end
def
features
{
trace_sections:
true
}
end
def
merge_request
return
@merge_request
if
defined?
(
@merge_request
)
...
...
app/views/shared/notes/_comment_button.html.haml
View file @
f4f9ee94
...
...
@@ -7,7 +7,7 @@
=
button_tag
type:
'button'
,
class:
'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion js-disable-on-submit'
,
data:
{
'dropdown-trigger'
=>
'#resolvable-comment-menu'
},
'aria-label'
=>
'Open comment type dropdown'
do
=
icon
(
'caret-down'
,
class:
'toggle-icon'
)
%ul
#resolvable-comment-menu
.dropdown-menu
{
data:
{
dropdown:
true
}
}
%ul
#resolvable-comment-menu
.dropdown-menu
.dropdown-open-top
{
data:
{
dropdown:
true
}
}
%li
#comment
.droplab-item-selected
{
data:
{
value:
''
,
'submit-text'
=>
'Comment'
,
'close-text'
=>
"Comment & close #{noteable_name}"
,
'reopen-text'
=>
"Comment & reopen #{noteable_name}"
}
}
%button
.btn.btn-transparent
=
icon
(
'check'
,
class:
'icon'
)
...
...
changelogs/unreleased/37970-timestamped-ci.yml
0 → 100644
View file @
f4f9ee94
---
title
:
Strip gitlab-runner section markers in build trace HTML view
merge_request
:
14393
author
:
type
:
added
changelogs/unreleased/38187-38315-fix-dropdown-open-top-bottom-spacing.yml
0 → 100644
View file @
f4f9ee94
---
title
:
Fix bottom spacing for dropdowns that open upwards
merge_request
:
14535
author
:
type
:
fixed
changelogs/unreleased/add-ci-builds-index-for-jobscontroller.yml
0 → 100644
View file @
f4f9ee94
---
title
:
Change index on ci_builds to optimize Jobs Controller
merge_request
:
author
:
type
:
other
db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb
0 → 100644
View file @
f4f9ee94
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddCiBuildsIndexForJobscontroller
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index", "remove_concurrent_index" or
# "add_column_with_default" you must disable the use of transactions
# as these methods can not run in an existing transaction.
# When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
# that either of them is the _only_ method called in the migration,
# any other changes should go in a separate migration.
# This ensures that upon failure _only_ the index creation or removing fails
# and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
disable_ddl_transaction!
def
up
add_concurrent_index
:ci_builds
,
[
:project_id
,
:id
]
unless
index_exists?
:ci_builds
,
[
:project_id
,
:id
]
remove_concurrent_index
:ci_builds
,
:project_id
if
index_exists?
:ci_builds
,
:project_id
end
def
down
add_concurrent_index
:ci_builds
,
:project_id
unless
index_exists?
:ci_builds
,
:project_id
remove_concurrent_index
:ci_builds
,
[
:project_id
,
:id
]
if
index_exists?
:ci_builds
,
[
:project_id
,
:id
]
end
end
db/schema.rb
View file @
f4f9ee94
...
...
@@ -256,7 +256,7 @@ ActiveRecord::Schema.define(version: 20170928100231) do
add_index
"ci_builds"
,
[
"commit_id"
,
"status"
,
"type"
],
name:
"index_ci_builds_on_commit_id_and_status_and_type"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"name"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_name_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"project_id"
],
name:
"index_ci_builds_on_project
_id"
,
using: :btree
add_index
"ci_builds"
,
[
"project_id"
,
"id"
],
name:
"index_ci_builds_on_project_id_and
_id"
,
using: :btree
add_index
"ci_builds"
,
[
"protected"
],
name:
"index_ci_builds_on_protected"
,
using: :btree
add_index
"ci_builds"
,
[
"runner_id"
],
name:
"index_ci_builds_on_runner_id"
,
using: :btree
add_index
"ci_builds"
,
[
"stage_id"
],
name:
"index_ci_builds_on_stage_id"
,
using: :btree
...
...
lib/api/entities.rb
View file @
f4f9ee94
...
...
@@ -1022,6 +1022,7 @@ module API
expose
:cache
,
using:
Cache
expose
:credentials
,
using:
Credentials
expose
:dependencies
,
using:
Dependency
expose
:features
end
end
...
...
lib/gitlab/ci/ansi2html.rb
View file @
f4f9ee94
...
...
@@ -155,7 +155,9 @@ module Gitlab
stream
.
each_line
do
|
line
|
s
=
StringScanner
.
new
(
line
)
until
s
.
eos?
if
s
.
scan
(
/\e([@-_])(.*?)([@-~])/
)
if
s
.
scan
(
/section_((?:start)|(?:end)):(\d+):([^\r]+)\r\033\[0K/
)
handle_section
(
s
)
elsif
s
.
scan
(
/\e([@-_])(.*?)([@-~])/
)
handle_sequence
(
s
)
elsif
s
.
scan
(
/\e(([@-_])(.*?)?)?$/
)
break
...
...
@@ -183,6 +185,15 @@ module Gitlab
)
end
def
handle_section
(
s
)
action
=
s
[
1
]
timestamp
=
s
[
2
]
section
=
s
[
3
]
line
=
s
.
matched
()[
0
...-
5
]
# strips \r\033[0K
@out
<<
%{<div class="hidden" data-action="#{action}" data-timestamp="#{timestamp}" data-section="#{section}">#{line}</div>}
end
def
handle_sequence
(
s
)
indicator
=
s
[
1
]
commands
=
s
[
2
].
split
';'
...
...
spec/lib/gitlab/ci/ansi2html_spec.rb
View file @
f4f9ee94
...
...
@@ -195,6 +195,32 @@ describe Gitlab::Ci::Ansi2html do
end
end
context
"with section markers"
do
let
(
:section_name
)
{
'test_section'
}
let
(
:section_start_time
)
{
Time
.
new
(
2017
,
9
,
20
).
utc
}
let
(
:section_duration
)
{
3
.
seconds
}
let
(
:section_end_time
)
{
section_start_time
+
section_duration
}
let
(
:section_start
)
{
"section_start:
#{
section_start_time
.
to_i
}
:
#{
section_name
}
\r\033
[0K"
}
let
(
:section_end
)
{
"section_end:
#{
section_end_time
.
to_i
}
:
#{
section_name
}
\r\033
[0K"
}
let
(
:section_start_html
)
do
'<div class="hidden" data-action="start"'
\
" data-timestamp=
\"
#{
section_start_time
.
to_i
}
\"
data-section=
\"
#{
section_name
}
\"
>"
\
"
#{
section_start
[
0
...-
5
]
}
</div>"
end
let
(
:section_end_html
)
do
'<div class="hidden" data-action="end"'
\
" data-timestamp=
\"
#{
section_end_time
.
to_i
}
\"
data-section=
\"
#{
section_name
}
\"
>"
\
"
#{
section_end
[
0
...-
5
]
}
</div>"
end
it
"prints light red"
do
text
=
"
#{
section_start
}
\e
[91mHello
\e
[0m
\n
#{
section_end
}
"
html
=
%{#{section_start_html}<span class="term-fg-l-red">Hello</span><br>#{section_end_html}}
expect
(
convert_html
(
text
)).
to
eq
(
html
)
end
end
describe
"truncates"
do
let
(
:text
)
{
"Hello World"
}
let
(
:stream
)
{
StringIO
.
new
(
text
)
}
...
...
spec/requests/api/runner_spec.rb
View file @
f4f9ee94
...
...
@@ -360,6 +360,8 @@ describe API::Runner do
'policy'
=>
'pull-push'
}]
end
let
(
:expected_features
)
{
{
'trace_sections'
=>
true
}
}
it
'picks a job'
do
request_job
info:
{
platform: :darwin
}
...
...
@@ -379,6 +381,7 @@ describe API::Runner do
expect
(
json_response
[
'artifacts'
]).
to
eq
(
expected_artifacts
)
expect
(
json_response
[
'cache'
]).
to
eq
(
expected_cache
)
expect
(
json_response
[
'variables'
]).
to
include
(
*
expected_variables
)
expect
(
json_response
[
'features'
]).
to
eq
(
expected_features
)
end
context
'when job is made for tag'
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