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
8344d215
Commit
8344d215
authored
Apr 04, 2022
by
wortschi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove import_project_from_remote_file ff
Changelog: other
parent
bc8a1f1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
60 deletions
+36
-60
config/feature_flags/development/import_project_from_remote_file.yml
...ure_flags/development/import_project_from_remote_file.yml
+0
-8
lib/api/project_import.rb
lib/api/project_import.rb
+0
-2
spec/requests/api/project_import_spec.rb
spec/requests/api/project_import_spec.rb
+36
-50
No files found.
config/feature_flags/development/import_project_from_remote_file.yml
deleted
100644 → 0
View file @
bc8a1f1f
---
name
:
import_project_from_remote_file
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59033
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/330039
milestone
:
'
13.12'
type
:
development
group
:
group::import
default_enabled
:
true
lib/api/project_import.rb
View file @
8344d215
...
...
@@ -135,8 +135,6 @@ module API
success
Entities
::
ProjectImportStatus
end
post
'remote-import'
do
not_found!
unless
::
Feature
.
enabled?
(
:import_project_from_remote_file
,
default_enabled: :yaml
)
check_rate_limit!
:project_import
,
scope:
[
current_user
,
:project_import
]
response
=
::
Import
::
GitlabProjects
::
CreateProjectService
.
new
(
...
...
spec/requests/api/project_import_spec.rb
View file @
8344d215
...
...
@@ -306,63 +306,49 @@ RSpec.describe API::ProjectImport, :aggregate_failures do
it_behaves_like
'requires authentication'
it
'returns NOT FOUND when the feature is disabled'
do
stub_feature_flags
(
import_project_from_remote_file:
false
)
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
context
'when the feature flag is enabled'
do
before
do
stub_feature_flags
(
import_project_from_remote_file:
true
)
end
context
'when the response is successful'
do
it
'schedules the import successfully'
do
project
=
create
(
:project
,
namespace:
user
.
namespace
,
name:
'test-import'
,
path:
'test-import'
)
context
'when the response is successful'
do
it
'schedules the import successfully'
do
project
=
create
(
:project
,
namespace:
user
.
namespace
,
name:
'test-import'
,
path:
'test-import'
)
service_response
=
ServiceResponse
.
success
(
payload:
project
)
expect_next
(
::
Import
::
GitlabProjects
::
CreateProjectService
)
.
to
receive
(
:execute
)
.
and_return
(
service_response
)
service_response
=
ServiceResponse
.
success
(
payload:
project
)
expect_next
(
::
Import
::
GitlabProjects
::
CreateProjectService
)
.
to
receive
(
:execute
)
.
and_return
(
service_response
)
subject
subject
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
json_response
).
to
include
({
'id'
=>
project
.
id
,
'name'
=>
'test-import'
,
'name_with_namespace'
=>
"
#{
user
.
namespace
.
name
}
/ test-import"
,
'path'
=>
'test-import'
,
'path_with_namespace'
=>
"
#{
user
.
namespace
.
path
}
/test-import"
})
end
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
json_response
).
to
include
({
'id'
=>
project
.
id
,
'name'
=>
'test-import'
,
'name_with_namespace'
=>
"
#{
user
.
namespace
.
name
}
/ test-import"
,
'path'
=>
'test-import'
,
'path_with_namespace'
=>
"
#{
user
.
namespace
.
path
}
/test-import"
})
end
end
context
'when the service returns an error'
do
it
'fails to schedule the import'
do
service_response
=
ServiceResponse
.
error
(
message:
'Failed to import'
,
http_status: :bad_request
)
expect_next
(
::
Import
::
GitlabProjects
::
CreateProjectService
)
.
to
receive
(
:execute
)
.
and_return
(
service_response
)
context
'when the service returns an error'
do
it
'fails to schedule the import'
do
service_response
=
ServiceResponse
.
error
(
message:
'Failed to import'
,
http_status: :bad_request
)
expect_next
(
::
Import
::
GitlabProjects
::
CreateProjectService
)
.
to
receive
(
:execute
)
.
and_return
(
service_response
)
subject
subject
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
json_response
).
to
eq
({
'message'
=>
'Failed to import'
})
end
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
json_response
).
to
eq
({
'message'
=>
'Failed to import'
})
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