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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
2742fe6f
Commit
2742fe6f
authored
Feb 11, 2017
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling Build#trace_with_state for performance
parent
6902f950
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
+7
-10
app/helpers/builds_helper.rb
app/helpers/builds_helper.rb
+1
-1
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+0
-1
changelogs/unreleased/28019-make-builds-show-faster.yml
changelogs/unreleased/28019-make-builds-show-faster.yml
+4
-0
spec/javascripts/build_spec.js
spec/javascripts/build_spec.js
+2
-8
No files found.
app/helpers/builds_helper.rb
View file @
2742fe6f
...
...
@@ -12,7 +12,7 @@ module BuildsHelper
build_url:
namespace_project_build_url
(
@project
.
namespace
,
@project
,
@build
,
:json
),
build_status:
@build
.
status
,
build_stage:
@build
.
stage
,
log_state:
@build
.
trace_with_state
[
:state
].
to_s
log_state:
''
}
end
...
...
app/views/projects/builds/show.html.haml
View file @
2742fe6f
-
@no_container
=
true
-
page_title
"
#{
@build
.
name
}
(#
#{
@build
.
id
}
)"
,
"Jobs"
-
trace_with_state
=
@build
.
trace_with_state
=
render
"projects/pipelines/head"
,
build_subnav:
true
%div
{
class:
container_class
}
...
...
changelogs/unreleased/28019-make-builds-show-faster.yml
0 → 100644
View file @
2742fe6f
---
title
:
Avoid calling Build#trace_with_state for performance
merge_request
:
9149
author
:
Takuya Noguchi
spec/javascripts/build_spec.js
View file @
2742fe6f
...
...
@@ -9,12 +9,6 @@ require('vendor/jquery.nicescroll');
describe
(
'
Build
'
,
()
=>
{
const
BUILD_URL
=
`
${
gl
.
TEST_HOST
}
/frontend-fixtures/builds-project/builds/1`
;
// see spec/factories/ci/builds.rb
const
BUILD_TRACE
=
'
BUILD TRACE
'
;
// see lib/ci/ansi2html.rb
const
INITIAL_BUILD_TRACE_STATE
=
window
.
btoa
(
JSON
.
stringify
({
offset
:
BUILD_TRACE
.
length
,
n_open_tags
:
0
,
fg_color
:
null
,
bg_color
:
null
,
style_mask
:
0
,
}));
preloadFixtures
(
'
builds/build-with-artifacts.html.raw
'
);
...
...
@@ -42,7 +36,7 @@ describe('Build', () => {
expect
(
this
.
build
.
buildUrl
).
toBe
(
`
${
BUILD_URL
}
.json`
);
expect
(
this
.
build
.
buildStatus
).
toBe
(
'
success
'
);
expect
(
this
.
build
.
buildStage
).
toBe
(
'
test
'
);
expect
(
this
.
build
.
state
).
toBe
(
INITIAL_BUILD_TRACE_STATE
);
expect
(
this
.
build
.
state
).
toBe
(
''
);
});
it
(
'
only shows the jobs matching the current stage
'
,
()
=>
{
...
...
@@ -108,7 +102,7 @@ describe('Build', () => {
expect
(
$
.
ajax
.
calls
.
count
()).
toBe
(
2
);
let
[{
url
,
dataType
,
success
,
context
}]
=
$
.
ajax
.
calls
.
argsFor
(
1
);
expect
(
url
).
toBe
(
`
${
BUILD_URL
}
/trace.json?state=
${
encodeURIComponent
(
INITIAL_BUILD_TRACE_STATE
)}
`
,
`
${
BUILD_URL
}
/trace.json?state=`
,
);
expect
(
dataType
).
toBe
(
'
json
'
);
expect
(
success
).
toEqual
(
jasmine
.
any
(
Function
));
...
...
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