BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9afabee3
Commit
9afabee3
authored
Mar 29, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not use STI mechanisms when migrating pipeline stages
parent
3577009a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
migrate_build_stage.rb
lib/gitlab/background_migration/migrate_build_stage.rb
+1
-0
migrate_build_stage_spec.rb
...b/gitlab/background_migration/migrate_build_stage_spec.rb
+16
-0
No files found.
lib/gitlab/background_migration/migrate_build_stage.rb
View file @
9afabee3
...
...
@@ -12,6 +12,7 @@ module Gitlab
class
Build
<
ActiveRecord
::
Base
self
.
table_name
=
'ci_builds'
self
.
inheritance_column
=
:_type_disabled
def
ensure_stage!
(
attempts:
2
)
find_stage
||
create_stage!
...
...
spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb
View file @
9afabee3
...
...
@@ -51,4 +51,20 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
expect
{
described_class
.
new
.
perform
(
1
,
6
)
}
.
to
raise_error
ActiveRecord
::
RecordNotUnique
end
context
'when invalid class can be loaded due to single table inheritance'
do
let
(
:commit_status
)
do
jobs
.
create!
(
id:
7
,
commit_id:
1
,
project_id:
123
,
stage_idx:
4
,
stage:
'post-deploy'
,
status: :failed
)
end
before
do
commit_status
.
update_column
(
:type
,
'SomeClass'
)
end
it
'does ignore single table inheritance type'
do
expect
{
described_class
.
new
.
perform
(
1
,
7
)
}.
not_to
raise_error
expect
(
jobs
.
find
(
7
)).
to
have_attributes
(
stage_id:
(
a_value
>
0
))
end
end
end
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