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
Boxiang Sun
gitlab-ce
Commits
f87eb250
Commit
f87eb250
authored
Aug 03, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Import/Export error checking versions
parent
e63729d9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
CHANGELOG
CHANGELOG
+3
-0
lib/gitlab/import_export/version_checker.rb
lib/gitlab/import_export/version_checker.rb
+1
-1
spec/lib/gitlab/import_export/version_checker_spec.rb
spec/lib/gitlab/import_export/version_checker_spec.rb
+30
-0
No files found.
CHANGELOG
View file @
f87eb250
...
...
@@ -56,6 +56,9 @@ v 8.11.0 (unreleased)
- Fix RequestProfiler::Middleware error when code is reloaded in development
- Catch what warden might throw when profiling requests to re-throw it
v 8.10.4 (unreleased)
- Fix Import/Export error checking versions
v 8.10.3
- Fix Import/Export issue importing milestones and labels not associated properly. !5426
- Fix timing problems running imports on production. !5523
...
...
lib/gitlab/import_export/version_checker.rb
View file @
f87eb250
...
...
@@ -25,7 +25,7 @@ module Gitlab
def
verify_version!
(
version
)
if
Gem
::
Version
.
new
(
version
)
>
Gem
::
Version
.
new
(
Gitlab
::
ImportExport
.
version
)
raise
Gitlab
::
ImportExport
::
Error
(
"Import version mismatch: Required <=
#{
Gitlab
::
ImportExport
.
version
}
but was
#{
version
}
"
)
raise
Gitlab
::
ImportExport
::
Error
.
new
(
"Import version mismatch: Required <=
#{
Gitlab
::
ImportExport
.
version
}
but was
#{
version
}
"
)
else
true
end
...
...
spec/lib/gitlab/import_export/version_checker_spec.rb
0 → 100644
View file @
f87eb250
require
'spec_helper'
describe
Gitlab
::
ImportExport
::
VersionChecker
,
services:
true
do
describe
'bundle a project Git repo'
do
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
''
)
}
let
(
:version
)
{
Gitlab
::
ImportExport
.
version
}
before
do
allow
(
File
).
to
receive
(
:open
).
and_return
(
version
)
end
it
'returns true if Import/Export have the same version'
do
expect
(
described_class
.
check!
(
shared:
shared
)).
to
be
true
end
context
'newer version'
do
let
(
:version
)
{
'900.0'
}
it
'returns false if export version is newer'
do
expect
(
described_class
.
check!
(
shared:
shared
)).
to
be
false
end
it
'shows the correct error message'
do
described_class
.
check!
(
shared:
shared
)
expect
(
shared
.
errors
.
first
).
to
eq
(
"Import version mismatch: Required <=
#{
Gitlab
::
ImportExport
.
version
}
but was
#{
version
}
"
)
end
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