Commit 39c62c9e authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '254281-remove-push-mirror-syncs-lfs-feature-flag' into 'master'

Sync LFS objects when push mirroring over HTTPS

See merge request gitlab-org/gitlab!44457
parents 770dcbe9 5067d782
...@@ -9,7 +9,11 @@ module MirrorHelper ...@@ -9,7 +9,11 @@ module MirrorHelper
end end
def mirror_lfs_sync_message def mirror_lfs_sync_message
html_escape(_('The Git LFS objects will %{strong_open}not%{strong_close} be synced.')) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } docs_link_url = help_page_path('topics/git/lfs/index')
docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: docs_link_url }
html_escape(_('Git LFS objects will be synced if LFS is %{docs_link_start}enabled for the project%{docs_link_end}. Push mirrors will %{strong_open}not%{strong_close} sync LFS objects over SSH.')) %
{ docs_link_start: docs_link_start, docs_link_end: '</a>'.html_safe, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
end end
end end
......
...@@ -55,7 +55,6 @@ module Projects ...@@ -55,7 +55,6 @@ module Projects
end end
def send_lfs_objects!(remote_mirror) def send_lfs_objects!(remote_mirror)
return unless Feature.enabled?(:push_mirror_syncs_lfs, project)
return unless project.lfs_enabled? return unless project.lfs_enabled?
# TODO: Support LFS sync over SSH # TODO: Support LFS sync over SSH
......
---
title: Sync LFS objects when push mirroring over HTTPS
merge_request: 44457
author:
type: added
---
name: push_mirror_syncs_lfs
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40137
rollout_issue_url:
group: group::source code
type: development
default_enabled: false
...@@ -56,6 +56,7 @@ The following are some possible use cases for repository mirroring: ...@@ -56,6 +56,7 @@ The following are some possible use cases for repository mirroring:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/249) in GitLab Enterprise Edition 8.7. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/249) in GitLab Enterprise Edition 8.7.
> - [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18715) in 10.8. > - [Moved to GitLab Core](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18715) in 10.8.
> - [LFS support over HTTPS added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40137) in 13.5
For an existing project, you can set up push mirroring as follows: For an existing project, you can set up push mirroring as follows:
......
...@@ -36,13 +36,5 @@ module EE ...@@ -36,13 +36,5 @@ module EE
count = project.mirror == true ? 1 : 0 count = project.mirror == true ? 1 : 0
count + @project.remote_mirrors.to_a.count { |mirror| mirror.enabled } count + @project.remote_mirrors.to_a.count { |mirror| mirror.enabled }
end end
def mirror_lfs_sync_message
docs_link_url = help_page_path('topics/git/lfs/index')
docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: docs_link_url }
html_escape(_('Git LFS objects will be synced in pull mirrors if LFS is %{docs_link_start}enabled for the project%{docs_link_end}. They will %{strong_open}not%{strong_close} be synced in push mirrors.')) %
{ docs_link_start: docs_link_start, docs_link_end: '</a>'.html_safe, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
end
end end
end end
...@@ -12121,7 +12121,7 @@ msgstr "" ...@@ -12121,7 +12121,7 @@ msgstr ""
msgid "Git LFS is not enabled on this GitLab server, contact your admin." msgid "Git LFS is not enabled on this GitLab server, contact your admin."
msgstr "" msgstr ""
msgid "Git LFS objects will be synced in pull mirrors if LFS is %{docs_link_start}enabled for the project%{docs_link_end}. They will %{strong_open}not%{strong_close} be synced in push mirrors." msgid "Git LFS objects will be synced if LFS is %{docs_link_start}enabled for the project%{docs_link_end}. Push mirrors will %{strong_open}not%{strong_close} sync LFS objects over SSH."
msgstr "" msgstr ""
msgid "Git LFS status:" msgid "Git LFS status:"
...@@ -25786,9 +25786,6 @@ msgstr "" ...@@ -25786,9 +25786,6 @@ msgstr ""
msgid "The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment." msgid "The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment."
msgstr "" msgstr ""
msgid "The Git LFS objects will %{strong_open}not%{strong_close} be synced."
msgstr ""
msgid "The GitLab user to which the Jira user %{jiraDisplayName} will be mapped" msgid "The GitLab user to which the Jira user %{jiraDisplayName} will be mapped"
msgstr "" msgstr ""
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
module QA module QA
RSpec.describe 'Create' do RSpec.describe 'Create' do
describe 'Push mirror a repository over HTTP' do describe 'Push mirror a repository over HTTP' do
it 'configures and syncs LFS objects for a (push) mirrored repository', :requires_admin, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/414' do it 'configures and syncs LFS objects for a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/414' do
Runtime::Feature.enable(:push_mirror_syncs_lfs)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
......
...@@ -123,11 +123,6 @@ RSpec.describe Projects::UpdateRemoteMirrorService do ...@@ -123,11 +123,6 @@ RSpec.describe Projects::UpdateRemoteMirrorService do
stub_lfs_setting(enabled: true) stub_lfs_setting(enabled: true)
end end
context 'feature flag enabled' do
before do
stub_feature_flags(push_mirror_syncs_lfs: true)
end
it 'pushes LFS objects to a HTTP repository' do it 'pushes LFS objects to a HTTP repository' do
expect_next_instance_of(Lfs::PushService) do |service| expect_next_instance_of(Lfs::PushService) do |service|
expect(service).to receive(:execute) expect(service).to receive(:execute)
...@@ -160,18 +155,5 @@ RSpec.describe Projects::UpdateRemoteMirrorService do ...@@ -160,18 +155,5 @@ RSpec.describe Projects::UpdateRemoteMirrorService do
execute! execute!
end end
end end
context 'feature flag disabled' do
before do
stub_feature_flags(push_mirror_syncs_lfs: false)
end
it 'does nothing' do
expect_any_instance_of(Lfs::PushService).not_to receive(:execute)
execute!
end
end
end
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