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
d15aeafe
Commit
d15aeafe
authored
Apr 20, 2020
by
Lee Tickett
Committed by
Nick Thomas
Apr 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `git_archive_path` feature flag
parent
1ccb939f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
77 deletions
+39
-77
app/views/projects/buttons/_download.html.haml
app/views/projects/buttons/_download.html.haml
+7
-8
changelogs/unreleased/remove_git_archive_path_feature_flag.yml
...elogs/unreleased/remove_git_archive_path_feature_flag.yml
+5
-0
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+1
-9
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+26
-60
No files found.
app/views/projects/buttons/_download.html.haml
View file @
d15aeafe
...
@@ -12,14 +12,13 @@
...
@@ -12,14 +12,13 @@
%h5
.m-0.dropdown-bold-header
=
_
(
'Download source code'
)
%h5
.m-0.dropdown-bold-header
=
_
(
'Download source code'
)
.dropdown-menu-content
.dropdown-menu-content
=
render
'projects/buttons/download_links'
,
project:
project
,
ref:
ref
,
archive_prefix:
archive_prefix
,
path:
nil
=
render
'projects/buttons/download_links'
,
project:
project
,
ref:
ref
,
archive_prefix:
archive_prefix
,
path:
nil
-
if
Feature
.
enabled?
(
:git_archive_path
,
default_enabled:
true
)
-
if
vue_file_list_enabled?
-
if
vue_file_list_enabled?
#js-directory-downloads
{
data:
{
links:
directory_download_links
(
project
,
ref
,
archive_prefix
).
to_json
}
}
#js-directory-downloads
{
data:
{
links:
directory_download_links
(
project
,
ref
,
archive_prefix
).
to_json
}
}
-
elsif
directory?
-
elsif
directory?
%section
.border-top.pt-1.mt-1
%section
.border-top.pt-1.mt-1
%h5
.m-0.dropdown-bold-header
=
_
(
'Download this directory'
)
%h5
.m-0.dropdown-bold-header
=
_
(
'Download this directory'
)
.dropdown-menu-content
.dropdown-menu-content
=
render
'projects/buttons/download_links'
,
project:
project
,
ref:
ref
,
archive_prefix:
archive_prefix
,
path:
@path
=
render
'projects/buttons/download_links'
,
project:
project
,
ref:
ref
,
archive_prefix:
archive_prefix
,
path:
@path
-
if
pipeline
&&
pipeline
.
latest_builds_with_artifacts
.
any?
-
if
pipeline
&&
pipeline
.
latest_builds_with_artifacts
.
any?
%section
.border-top.pt-1.mt-1
%section
.border-top.pt-1.mt-1
%h5
.m-0.dropdown-bold-header
=
_
(
'Download artifacts'
)
%h5
.m-0.dropdown-bold-header
=
_
(
'Download artifacts'
)
...
...
changelogs/unreleased/remove_git_archive_path_feature_flag.yml
0 → 100644
View file @
d15aeafe
---
title
:
Remove git_archive_path feature flag
merge_request
:
29369
author
:
Lee Tickett
type
:
other
lib/gitlab/workhorse.rb
View file @
d15aeafe
...
@@ -62,9 +62,6 @@ module Gitlab
...
@@ -62,9 +62,6 @@ module Gitlab
end
end
def
send_git_archive
(
repository
,
ref
:,
format
:,
append_sha
:,
path:
nil
)
def
send_git_archive
(
repository
,
ref
:,
format
:,
append_sha
:,
path:
nil
)
path_enabled
=
Feature
.
enabled?
(
:git_archive_path
,
default_enabled:
true
)
path
=
nil
unless
path_enabled
format
||=
'tar.gz'
format
||=
'tar.gz'
format
=
format
.
downcase
format
=
format
.
downcase
...
@@ -78,12 +75,7 @@ module Gitlab
...
@@ -78,12 +75,7 @@ module Gitlab
raise
"Repository or ref not found"
if
metadata
.
empty?
raise
"Repository or ref not found"
if
metadata
.
empty?
params
=
params
=
send_git_archive_params
(
repository
,
metadata
,
path
,
archive_format
(
format
))
if
path_enabled
send_git_archive_params
(
repository
,
metadata
,
path
,
archive_format
(
format
))
else
metadata
end
# If present, DisableCache must be a Boolean. Otherwise
# If present, DisableCache must be a Boolean. Otherwise
# workhorse ignores it.
# workhorse ignores it.
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
d15aeafe
...
@@ -24,7 +24,7 @@ describe Gitlab::Workhorse do
...
@@ -24,7 +24,7 @@ describe Gitlab::Workhorse do
let
(
:ref
)
{
'master'
}
let
(
:ref
)
{
'master'
}
let
(
:format
)
{
'zip'
}
let
(
:format
)
{
'zip'
}
let
(
:storage_path
)
{
Gitlab
.
config
.
gitlab
.
repository_downloads_path
}
let
(
:storage_path
)
{
Gitlab
.
config
.
gitlab
.
repository_downloads_path
}
let
(
:path
)
{
'some/path'
if
Feature
.
enabled?
(
:git_archive_path
,
default_enabled:
true
)
}
let
(
:path
)
{
'some/path'
}
let
(
:metadata
)
{
repository
.
archive_metadata
(
ref
,
storage_path
,
format
,
append_sha:
nil
,
path:
path
)
}
let
(
:metadata
)
{
repository
.
archive_metadata
(
ref
,
storage_path
,
format
,
append_sha:
nil
,
path:
path
)
}
let
(
:cache_disabled
)
{
false
}
let
(
:cache_disabled
)
{
false
}
...
@@ -36,70 +36,36 @@ describe Gitlab::Workhorse do
...
@@ -36,70 +36,36 @@ describe Gitlab::Workhorse do
allow
(
described_class
).
to
receive
(
:git_archive_cache_disabled?
).
and_return
(
cache_disabled
)
allow
(
described_class
).
to
receive
(
:git_archive_cache_disabled?
).
and_return
(
cache_disabled
)
end
end
context
'feature flag disabled'
do
it
'sets the header correctly'
do
before
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
stub_feature_flags
(
git_archive_path:
false
)
end
it
'sets the header correctly'
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
expected_params
=
metadata
.
merge
(
expect
(
key
).
to
eq
(
'Gitlab-Workhorse-Send-Data'
)
'GitalyRepository'
=>
repository
.
gitaly_repository
.
to_h
,
expect
(
command
).
to
eq
(
'git-archive'
)
'GitalyServer'
=>
{
expect
(
params
).
to
eq
({
features:
{
'gitaly-feature-foobar'
=>
'true'
},
'GitalyServer'
=>
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
features:
{
'gitaly-feature-foobar'
=>
'true'
},
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
}
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
'ArchivePath'
=>
metadata
[
'ArchivePath'
],
'GetArchiveRequest'
=>
Base64
.
encode64
(
Gitaly
::
GetArchiveRequest
.
new
(
repository:
repository
.
gitaly_repository
,
commit_id:
metadata
[
'CommitId'
],
prefix:
metadata
[
'ArchivePrefix'
],
format:
Gitaly
::
GetArchiveRequest
::
Format
::
ZIP
,
path:
path
).
to_proto
)
)
}.
deep_stringify_keys
)
expect
(
key
).
to
eq
(
'Gitlab-Workhorse-Send-Data'
)
expect
(
command
).
to
eq
(
'git-archive'
)
expect
(
params
).
to
eq
(
expected_params
.
deep_stringify_keys
)
end
context
'when archive caching is disabled'
do
let
(
:cache_disabled
)
{
true
}
it
'tells workhorse not to use the cache'
do
_
,
_
,
params
=
decode_workhorse_header
(
subject
)
expect
(
params
).
to
include
({
'DisableCache'
=>
true
})
end
end
end
end
context
'feature flag enabled'
do
context
'when archive caching is disabled'
do
it
'sets the header correctly'
do
let
(
:cache_disabled
)
{
true
}
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
expect
(
key
).
to
eq
(
'Gitlab-Workhorse-Send-Data'
)
expect
(
command
).
to
eq
(
'git-archive'
)
expect
(
params
).
to
eq
({
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
'ArchivePath'
=>
metadata
[
'ArchivePath'
],
'GetArchiveRequest'
=>
Base64
.
encode64
(
Gitaly
::
GetArchiveRequest
.
new
(
repository:
repository
.
gitaly_repository
,
commit_id:
metadata
[
'CommitId'
],
prefix:
metadata
[
'ArchivePrefix'
],
format:
Gitaly
::
GetArchiveRequest
::
Format
::
ZIP
,
path:
path
).
to_proto
)
}.
deep_stringify_keys
)
end
context
'when archive caching is disabled'
do
let
(
:cache_disabled
)
{
true
}
it
'tells workhorse not to use the cache'
do
it
'tells workhorse not to use the cache'
do
_
,
_
,
params
=
decode_workhorse_header
(
subject
)
_
,
_
,
params
=
decode_workhorse_header
(
subject
)
expect
(
params
).
to
include
({
'DisableCache'
=>
true
})
expect
(
params
).
to
include
({
'DisableCache'
=>
true
})
end
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