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
6b8e1a07
Commit
6b8e1a07
authored
Jul 21, 2020
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove previously exported project on new export request
parent
4505a64e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
changelogs/unreleased/georgekoltsov-add-regenerate-new-export-to-project-export.yml
...gekoltsov-add-regenerate-new-export-to-project-export.yml
+5
-0
lib/api/project_export.rb
lib/api/project_export.rb
+2
-0
spec/requests/api/project_export_spec.rb
spec/requests/api/project_export_spec.rb
+16
-0
No files found.
changelogs/unreleased/georgekoltsov-add-regenerate-new-export-to-project-export.yml
0 → 100644
View file @
6b8e1a07
---
title
:
Remove old export file when requesting new project export using API
merge_request
:
37427
author
:
type
:
fixed
lib/api/project_export.rb
View file @
6b8e1a07
...
...
@@ -47,6 +47,8 @@ module API
post
':id/export'
do
check_rate_limit!
:project_export
,
[
current_user
]
user_project
.
remove_exports
project_export_params
=
declared_params
(
include_missing:
false
)
after_export_params
=
project_export_params
.
delete
(
:upload
)
||
{}
...
...
spec/requests/api/project_export_spec.rb
View file @
6b8e1a07
...
...
@@ -338,6 +338,16 @@ RSpec.describe API::ProjectExport, :clean_gitlab_redis_cache do
end
context
'with download strategy'
do
before
do
Grape
::
Endpoint
.
before_each
do
|
endpoint
|
allow
(
endpoint
).
to
receive
(
:user_project
).
and_return
(
project
)
end
end
after
do
Grape
::
Endpoint
.
before_each
nil
end
it
'starts'
do
expect_any_instance_of
(
Gitlab
::
ImportExport
::
AfterExportStrategies
::
WebUploadStrategy
).
not_to
receive
(
:send_file
)
...
...
@@ -345,6 +355,12 @@ RSpec.describe API::ProjectExport, :clean_gitlab_redis_cache do
expect
(
response
).
to
have_gitlab_http_status
(
:accepted
)
end
it
'removes previously exported archive file'
do
expect
(
project
).
to
receive
(
:remove_exports
).
once
post
api
(
path
,
user
)
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