Add a `Gitlab::Workhorse::ARCHIVE_FORMATS` constant and use that instead of separate definitions
We have several places where we show different formats to download an archive, we should consolidate that to 1 constant, perhaps in Gitlab::Workhorse
since that's where the format is mapped to a Gitaly::GetArchiveRequest::Format
.
The following discussion from !19065 (merged) should be addressed:
-
@reprazent started a discussion: I'm seeing these formats defined in quite a few places.
I think we should move this into a constant, perhaps in
Gitlab::Workhorse
.I think we can do that in a separate issue though as we should also update these occurrences:
File: app/models/releases/source.rb 9:18: FORMATS = %w(zip tar.gz tar.bz2 tar).freeze File: app/views/projects/buttons/_download_links.html.haml 1:16:- formats = [['zip', 'btn-primary'], ['tar.gz'], ['tar.bz2'], ['tar']] File: spec/support/shared_examples/features/archive_download_buttons_shared_examples.rb 4:22: let(:formats) { %w(zip tar.gz tar.bz2 tar) }