Commit 29d8179b authored by Stan Hu's avatar Stan Hu

Merge branch '53700-hashed-storagemigration' into 'master'

Hashed Storage: allow migration to be retried in partially migrated projects

Closes #53700

See merge request gitlab-org/gitlab-ce!23087
parents 85bc7844 f208f4c2
......@@ -1964,7 +1964,7 @@ class Project < ActiveRecord::Base
end
def migrate_to_hashed_storage!
return if hashed_storage?(:repository)
return unless storage_upgradable?
update!(repository_read_only: true)
......
---
title: 'Hashed Storage: allow migration to be retried in partially migrated projects'
merge_request: 23087
author:
type: fixed
......@@ -3087,6 +3087,14 @@ describe Project do
it 'does not flag as read-only' do
expect { project.migrate_to_hashed_storage! }.not_to change { project.repository_read_only }
end
context 'when partially migrated' do
it 'returns true' do
project = create(:project, storage_version: 1, skip_disk_validation: true)
expect(project.migrate_to_hashed_storage!).to be_truthy
end
end
end
end
......
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