Commit 4b88d6a1 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'sh-drop-include-lfs-feature-flag' into 'master'

Remove include_lfs_blobs_in_archive feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62539
parents 9dd5444f c17834bb
---
name: include_lfs_blobs_in_archive
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44116
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/268409
milestone: '13.5'
type: development
group: group::source code
default_enabled: true
......@@ -114,11 +114,9 @@ See the documentation on [File Locking](../../../user/project/file_lock.md).
## LFS objects in project archives
> - Support for including Git LFS blobs inside [project source downloads](../../../user/project/repository/index.md) was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15079) in GitLab 13.5.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/268409) in GitLab 13.6.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-lfs-objects-in-project-archives).
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
......@@ -134,31 +132,11 @@ oid sha256:3ea5dd307f195f449f0e08234183b82e92c3d5f4cff11c2a6bb014f9e0de12aa
size 177735
```
Starting with GitLab 13.5, these pointers are converted to the uploaded
LFS object if the `include_lfs_blobs_in_archive` feature flag is
enabled.
In GitLab version 13.5 and later, these pointers are converted to the uploaded
LFS object.
Technical details about how this works can be found in the [development documentation for LFS](../../../development/lfs.md#including-lfs-blobs-in-project-archives).
### Enable or disable LFS objects in project archives
_LFS objects in project archives_ is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
Feature.enable(:include_lfs_blobs_in_archive)
```
To disable it:
```ruby
Feature.disable(:include_lfs_blobs_in_archive)
```
## Troubleshooting
### Encountered `n` file(s) that should have been pointers, but weren't
......
......@@ -302,8 +302,6 @@ module Gitlab
private :archive_file_path
def archive_version_path
return '' unless Feature.enabled?(:include_lfs_blobs_in_archive, default_enabled: true)
'@v2'
end
private :archive_version_path
......
......@@ -270,7 +270,7 @@ module Gitlab
prefix: metadata['ArchivePrefix'],
format: format,
path: path.presence || "",
include_lfs_blobs: Feature.enabled?(:include_lfs_blobs_in_archive, default_enabled: true)
include_lfs_blobs: true
).to_proto
)
}
......
......@@ -133,32 +133,10 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
expect(metadata['ArchivePrefix']).to eq(expected_prefix)
end
context 'when :include_lfs_blobs_in_archive feature flag is disabled' do
let(:expected_path) { File.join(storage_path, cache_key, expected_filename) }
it 'sets ArchivePath to the expected globally-unique path' do
expect(expected_path).to include(File.join(repository.gl_repository, SeedRepo::LastCommit::ID))
before do
stub_feature_flags(include_lfs_blobs_in_archive: false)
end
it 'sets ArchivePath to the expected globally-unique path' do
# This is really important from a security perspective. Think carefully
# before changing it: https://gitlab.com/gitlab-org/gitlab-foss/issues/45689
expect(expected_path).to include(File.join(repository.gl_repository, SeedRepo::LastCommit::ID))
expect(metadata['ArchivePath']).to eq(expected_path)
end
end
context 'when :include_lfs_blobs_in_archive feature flag is enabled' do
before do
stub_feature_flags(include_lfs_blobs_in_archive: true)
end
it 'sets ArchivePath to the expected globally-unique path' do
expect(expected_path).to include(File.join(repository.gl_repository, SeedRepo::LastCommit::ID))
expect(metadata['ArchivePath']).to eq(expected_path)
end
expect(metadata['ArchivePath']).to eq(expected_path)
end
context 'path is set' do
......
......@@ -60,37 +60,6 @@ RSpec.describe Gitlab::Workhorse do
}.deep_stringify_keys)
end
context 'when include_lfs_blobs_in_archive is disabled' do
before do
stub_feature_flags(include_lfs_blobs_in_archive: false)
end
it 'sets include_lfs_blobs to false' do
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-enforce-requests-limits' => '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,
include_lfs_blobs: false
).to_proto
)
}.deep_stringify_keys)
end
end
context 'when archive caching is disabled' do
let(:cache_disabled) { true }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment