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
d58d3098
Commit
d58d3098
authored
Mar 06, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename used_timeout to timeout
parent
f5e602ee
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
app/assets/javascripts/jobs/components/sidebar_details_block.vue
...ets/javascripts/jobs/components/sidebar_details_block.vue
+2
-2
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/ci/build_metadata.rb
app/models/ci/build_metadata.rb
+2
-2
app/serializers/build_metadata_entity.rb
app/serializers/build_metadata_entity.rb
+2
-2
db/migrate/20180301010859_create_ci_builds_metadata_table.rb
db/migrate/20180301010859_create_ci_builds_metadata_table.rb
+1
-1
db/schema.rb
db/schema.rb
+2
-2
spec/javascripts/jobs/mock_data.js
spec/javascripts/jobs/mock_data.js
+1
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+2
-2
spec/models/concerns/chronic_duration_attribute_spec.rb
spec/models/concerns/chronic_duration_attribute_spec.rb
+2
-2
No files found.
app/assets/javascripts/jobs/components/sidebar_details_block.vue
View file @
d58d3098
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
return
`#
${
this
.
job
.
runner
.
id
}
`
;
return
`#
${
this
.
job
.
runner
.
id
}
`
;
},
},
timeout
()
{
timeout
()
{
let
t
=
`
${
this
.
job
.
metadata
.
used_
timeout_human_readable
}
`
;
let
t
=
`
${
this
.
job
.
metadata
.
timeout_human_readable
}
`
;
if
(
this
.
job
.
metadata
.
timeout_source
!=
null
)
{
if
(
this
.
job
.
metadata
.
timeout_source
!=
null
)
{
t
+=
` (from
${
this
.
job
.
metadata
.
timeout_source
}
)`
;
t
+=
` (from
${
this
.
job
.
metadata
.
timeout_source
}
)`
;
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
/>
/>
<detail-row
<detail-row
class=
"js-job-timeout"
class=
"js-job-timeout"
v-if=
"job.metadata.
used_
timeout_human_readable"
v-if=
"job.metadata.timeout_human_readable"
title=
"Timeout"
title=
"Timeout"
:help-url=
"runnerHelpUrl"
:help-url=
"runnerHelpUrl"
:value=
"timeout"
:value=
"timeout"
...
...
app/models/ci/build.rb
View file @
d58d3098
...
@@ -242,7 +242,7 @@ module Ci
...
@@ -242,7 +242,7 @@ module Ci
end
end
def
timeout
def
timeout
metadata
.
used_
timeout
metadata
.
timeout
end
end
def
triggered_by?
(
current_user
)
def
triggered_by?
(
current_user
)
...
...
app/models/ci/build_metadata.rb
View file @
d58d3098
...
@@ -10,7 +10,7 @@ module Ci
...
@@ -10,7 +10,7 @@ module Ci
belongs_to
:build
,
class_name:
'Ci::Build'
belongs_to
:build
,
class_name:
'Ci::Build'
chronic_duration_attr_reader
:
used_timeout_human_readable
,
:used_
timeout
chronic_duration_attr_reader
:
timeout_human_readable
,
:
timeout
enum
timeout_source:
{
enum
timeout_source:
{
unknown_timeout_source:
1
,
unknown_timeout_source:
1
,
...
@@ -22,7 +22,7 @@ module Ci
...
@@ -22,7 +22,7 @@ module Ci
project_timeout
=
build
.
project
&
.
build_timeout
project_timeout
=
build
.
project
&
.
build_timeout
timeout
=
[
project_timeout
,
build
.
runner
&
.
maximum_timeout
].
compact
.
min
timeout
=
[
project_timeout
,
build
.
runner
&
.
maximum_timeout
].
compact
.
min
self
.
used_
timeout
=
timeout
self
.
timeout
=
timeout
self
.
timeout_source
=
timeout
<
project_timeout
?
:runner_timeout_source
:
:project_timeout_source
self
.
timeout_source
=
timeout
<
project_timeout
?
:runner_timeout_source
:
:project_timeout_source
save!
save!
...
...
app/serializers/build_metadata_entity.rb
View file @
d58d3098
class
BuildMetadataEntity
<
Grape
::
Entity
class
BuildMetadataEntity
<
Grape
::
Entity
expose
:
used_
timeout_human_readable
do
|
metadata
|
expose
:timeout_human_readable
do
|
metadata
|
metadata
.
used_timeout_human_readable
unless
metadata
.
used_
timeout
.
nil?
metadata
.
timeout_human_readable
unless
metadata
.
timeout
.
nil?
end
end
expose
:timeout_source
do
|
metadata
|
expose
:timeout_source
do
|
metadata
|
...
...
db/migrate/20180301010859_create_ci_builds_metadata_table.rb
View file @
d58d3098
...
@@ -6,7 +6,7 @@ class CreateCiBuildsMetadataTable < ActiveRecord::Migration
...
@@ -6,7 +6,7 @@ class CreateCiBuildsMetadataTable < ActiveRecord::Migration
def
change
def
change
create_table
:ci_builds_metadata
,
id:
false
do
|
t
|
create_table
:ci_builds_metadata
,
id:
false
do
|
t
|
t
.
integer
:build_id
,
null:
false
t
.
integer
:build_id
,
null:
false
t
.
integer
:
used_
timeout
t
.
integer
:timeout
t
.
integer
:timeout_source
,
null:
false
,
default:
1
t
.
integer
:timeout_source
,
null:
false
,
default:
1
t
.
primary_key
:build_id
t
.
primary_key
:build_id
...
...
db/schema.rb
View file @
d58d3098
...
@@ -330,7 +330,7 @@ ActiveRecord::Schema.define(version: 20180327101207) do
...
@@ -330,7 +330,7 @@ ActiveRecord::Schema.define(version: 20180327101207) do
add_index
"ci_builds"
,
[
"user_id"
],
name:
"index_ci_builds_on_user_id"
,
using: :btree
add_index
"ci_builds"
,
[
"user_id"
],
name:
"index_ci_builds_on_user_id"
,
using: :btree
create_table
"ci_builds_metadata"
,
primary_key:
"build_id"
,
force: :cascade
do
|
t
|
create_table
"ci_builds_metadata"
,
primary_key:
"build_id"
,
force: :cascade
do
|
t
|
t
.
integer
"
used_
timeout"
t
.
integer
"timeout"
t
.
integer
"timeout_source"
,
default:
1
,
null:
false
t
.
integer
"timeout_source"
,
default:
1
,
null:
false
end
end
...
@@ -463,8 +463,8 @@ ActiveRecord::Schema.define(version: 20180327101207) do
...
@@ -463,8 +463,8 @@ ActiveRecord::Schema.define(version: 20180327101207) do
t
.
boolean
"run_untagged"
,
default:
true
,
null:
false
t
.
boolean
"run_untagged"
,
default:
true
,
null:
false
t
.
boolean
"locked"
,
default:
false
,
null:
false
t
.
boolean
"locked"
,
default:
false
,
null:
false
t
.
integer
"access_level"
,
default:
0
,
null:
false
t
.
integer
"access_level"
,
default:
0
,
null:
false
t
.
integer
"maximum_timeout"
t
.
string
"ip_address"
t
.
string
"ip_address"
t
.
integer
"maximum_timeout"
end
end
add_index
"ci_runners"
,
[
"contacted_at"
],
name:
"index_ci_runners_on_contacted_at"
,
using: :btree
add_index
"ci_runners"
,
[
"contacted_at"
],
name:
"index_ci_runners_on_contacted_at"
,
using: :btree
...
...
spec/javascripts/jobs/mock_data.js
View file @
d58d3098
...
@@ -116,7 +116,7 @@ export default {
...
@@ -116,7 +116,7 @@ export default {
},
},
},
},
metadata
:
{
metadata
:
{
used_
timeout_human_readable
:
'
1m 40s
'
,
timeout_human_readable
:
'
1m 40s
'
,
timeout_source
:
'
runner
'
,
timeout_source
:
'
runner
'
,
},
},
merge_request
:
{
merge_request
:
{
...
...
spec/models/ci/build_spec.rb
View file @
d58d3098
...
@@ -2050,8 +2050,8 @@ describe Ci::Build do
...
@@ -2050,8 +2050,8 @@ describe Ci::Build do
end
end
shared_examples
'saves data on transition'
do
shared_examples
'saves data on transition'
do
it
'saves
used_
timeout'
do
it
'saves timeout'
do
expect
{
job
.
run!
}.
to
change
{
job
.
reload
.
metadata
.
used_
timeout
}.
from
(
nil
).
to
(
expected_timeout
)
expect
{
job
.
run!
}.
to
change
{
job
.
reload
.
metadata
.
timeout
}.
from
(
nil
).
to
(
expected_timeout
)
end
end
it
'saves timeout_source'
do
it
'saves timeout_source'
do
...
...
spec/models/concerns/chronic_duration_attribute_spec.rb
View file @
d58d3098
...
@@ -65,8 +65,8 @@ describe 'ChronicDurationAttribute' do
...
@@ -65,8 +65,8 @@ describe 'ChronicDurationAttribute' do
end
end
describe
'ChronicDurationAttribute - reader'
do
describe
'ChronicDurationAttribute - reader'
do
let
(
:source_field
)
{
:
used_
timeout
}
let
(
:source_field
)
{
:timeout
}
let
(
:virtual_field
)
{
:
used_
timeout_human_readable
}
let
(
:virtual_field
)
{
:timeout_human_readable
}
subject
{
Ci
::
BuildMetadata
.
new
}
subject
{
Ci
::
BuildMetadata
.
new
}
it
"doesn't contain dynamically created writer method"
do
it
"doesn't contain dynamically created writer method"
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