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
964933c9
Commit
964933c9
authored
Apr 03, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create metadata object on build object creation
parent
b15dd5df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
10 deletions
+2
-10
app/models/ci/build.rb
app/models/ci/build.rb
+1
-0
spec/factories/ci/build_metadata.rb
spec/factories/ci/build_metadata.rb
+0
-9
spec/models/ci/build_metadata_spec.rb
spec/models/ci/build_metadata_spec.rb
+1
-1
No files found.
app/models/ci/build.rb
View file @
964933c9
...
@@ -90,6 +90,7 @@ module Ci
...
@@ -90,6 +90,7 @@ module Ci
before_save
:ensure_token
before_save
:ensure_token
before_destroy
{
unscoped_project
}
before_destroy
{
unscoped_project
}
before_create
:ensure_metadata
after_create
unless: :importing?
do
|
build
|
after_create
unless: :importing?
do
|
build
|
run_after_commit
{
BuildHooksWorker
.
perform_async
(
build
.
id
)
}
run_after_commit
{
BuildHooksWorker
.
perform_async
(
build
.
id
)
}
end
end
...
...
spec/factories/ci/build_metadata.rb
deleted
100644 → 0
View file @
b15dd5df
FactoryBot
.
define
do
factory
:ci_build_metadata
,
class:
Ci
::
BuildMetadata
do
build
factory: :ci_build
after
(
:build
)
do
|
build_metadata
,
_
|
build_metadata
.
project
||=
build_metadata
.
build
.
project
end
end
end
spec/models/ci/build_metadata_spec.rb
View file @
964933c9
...
@@ -13,7 +13,7 @@ describe Ci::BuildMetadata do
...
@@ -13,7 +13,7 @@ describe Ci::BuildMetadata do
end
end
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:build_metadata
)
{
create
(
:ci_build_metadata
,
build:
build
)
}
let
(
:build_metadata
)
{
build
.
metadata
}
describe
'#update_timeout_state'
do
describe
'#update_timeout_state'
do
subject
{
build_metadata
}
subject
{
build_metadata
}
...
...
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