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
417296ca
Commit
417296ca
authored
Nov 03, 2020
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip disabled features when importing a project from Gitea
parent
b470952a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
changelogs/unreleased/skip-importing-features-disabled-in-gitea.yml
.../unreleased/skip-importing-features-disabled-in-gitea.yml
+5
-0
lib/gitlab/legacy_github_import/importer.rb
lib/gitlab/legacy_github_import/importer.rb
+2
-0
spec/lib/gitlab/legacy_github_import/importer_spec.rb
spec/lib/gitlab/legacy_github_import/importer_spec.rb
+2
-1
No files found.
changelogs/unreleased/skip-importing-features-disabled-in-gitea.yml
0 → 100644
View file @
417296ca
---
title
:
Skip disabled features when importing a project from Gitea
merge_request
:
46800
author
:
John Kristensen (@jerrykan)
type
:
fixed
lib/gitlab/legacy_github_import/importer.rb
View file @
417296ca
...
...
@@ -303,6 +303,8 @@ module Gitlab
end
imported!
(
resource_type
)
rescue
::
Octokit
::
NotFound
=>
e
errors
<<
{
type:
resource_type
,
errors:
e
.
message
}
end
def
imported?
(
resource_type
)
...
...
spec/lib/gitlab/legacy_github_import/importer_spec.rb
View file @
417296ca
...
...
@@ -52,7 +52,7 @@ RSpec.describe Gitlab::LegacyGithubImport::Importer do
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:milestones
).
and_return
([
milestone
,
milestone
])
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:issues
).
and_return
([
issue1
,
issue2
])
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:pull_requests
).
and_return
([
pull_request
,
pull_request
])
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:issues_comments
).
and_r
eturn
([]
)
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:issues_comments
).
and_r
aise
(
Octokit
::
NotFound
)
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:pull_requests_comments
).
and_return
([])
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:last_response
).
and_return
(
double
(
rels:
{
next:
nil
}))
allow_any_instance_of
(
Octokit
::
Client
).
to
receive
(
:releases
).
and_return
([
release1
,
release2
])
...
...
@@ -169,6 +169,7 @@ RSpec.describe Gitlab::LegacyGithubImport::Importer do
errors:
[
{
type: :label
,
url:
"
#{
api_root
}
/repos/octocat/Hello-World/labels/bug"
,
errors:
"Validation failed: Title can't be blank, Title is invalid"
},
{
type: :issue
,
url:
"
#{
api_root
}
/repos/octocat/Hello-World/issues/1348"
,
errors:
"Validation failed: Title can't be blank"
},
{
type: :issues_comments
,
errors:
'Octokit::NotFound'
},
{
type: :wiki
,
errors:
"Gitlab::Git::CommandError"
}
]
}
...
...
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