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
115708d8
Commit
115708d8
authored
May 11, 2020
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the keep_divergent_refs feature flag
This feature is now generally available.
parent
4ca162db
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
48 deletions
+11
-48
app/views/projects/mirrors/_mirror_repos_push.html.haml
app/views/projects/mirrors/_mirror_repos_push.html.haml
+4
-7
changelogs/unreleased/rs-enable-keep-divergent-refs.yml
changelogs/unreleased/rs-enable-keep-divergent-refs.yml
+5
-0
lib/api/entities/remote_mirror.rb
lib/api/entities/remote_mirror.rb
+1
-3
lib/api/remote_mirrors.rb
lib/api/remote_mirrors.rb
+0
-2
spec/features/projects/settings/repository_settings_spec.rb
spec/features/projects/settings/repository_settings_spec.rb
+0
-14
spec/requests/api/remote_mirrors_spec.rb
spec/requests/api/remote_mirrors_spec.rb
+1
-22
No files found.
app/views/projects/mirrors/_mirror_repos_push.html.haml
View file @
115708d8
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
-
keep_divergent_refs
=
Feature
.
enabled?
(
:keep_divergent_refs
,
@project
)
=
f
.
fields_for
:remote_mirrors
,
@project
.
remote_mirrors
.
build
do
|
rm_f
|
=
f
.
fields_for
:remote_mirrors
,
@project
.
remote_mirrors
.
build
do
|
rm_f
|
=
rm_f
.
hidden_field
:enabled
,
value:
'1'
=
rm_f
.
hidden_field
:enabled
,
value:
'1'
=
rm_f
.
hidden_field
:url
,
class:
'js-mirror-url-hidden'
,
required:
true
,
pattern:
"(
#{
protocols
}
):
\/\/
.+"
=
rm_f
.
hidden_field
:url
,
class:
'js-mirror-url-hidden'
,
required:
true
,
pattern:
"(
#{
protocols
}
):
\/\/
.+"
=
rm_f
.
hidden_field
:only_protected_branches
,
class:
'js-mirror-protected-hidden'
=
rm_f
.
hidden_field
:only_protected_branches
,
class:
'js-mirror-protected-hidden'
-
if
keep_divergent_refs
=
rm_f
.
hidden_field
:keep_divergent_refs
,
class:
'js-mirror-keep-divergent-refs-hidden'
=
rm_f
.
hidden_field
:keep_divergent_refs
,
class:
'js-mirror-keep-divergent-refs-hidden'
=
render
partial:
'projects/mirrors/ssh_host_keys'
,
locals:
{
f:
rm_f
}
=
render
partial:
'projects/mirrors/ssh_host_keys'
,
locals:
{
f:
rm_f
}
=
render
partial:
'projects/mirrors/authentication_method'
,
locals:
{
f:
rm_f
}
=
render
partial:
'projects/mirrors/authentication_method'
,
locals:
{
f:
rm_f
}
-
if
keep_divergent_refs
.form-check.append-bottom-10
.form-check.append-bottom-10
=
check_box_tag
:keep_divergent_refs
,
'1'
,
false
,
class:
'js-mirror-keep-divergent-refs form-check-input'
=
check_box_tag
:keep_divergent_refs
,
'1'
,
false
,
class:
'js-mirror-keep-divergent-refs form-check-input'
=
label_tag
:keep_divergent_refs
,
'Keep divergent refs'
,
class:
'form-check-label'
=
label_tag
:keep_divergent_refs
,
'Keep divergent refs'
,
class:
'form-check-label'
changelogs/unreleased/rs-enable-keep-divergent-refs.yml
0 → 100644
View file @
115708d8
---
title
:
Add "Keep divergent refs" option for push mirrors
merge_request
:
32381
author
:
type
:
added
lib/api/entities/remote_mirror.rb
View file @
115708d8
...
@@ -12,9 +12,7 @@ module API
...
@@ -12,9 +12,7 @@ module API
expose
:last_successful_update_at
expose
:last_successful_update_at
expose
:last_error
expose
:last_error
expose
:only_protected_branches
expose
:only_protected_branches
expose
:keep_divergent_refs
,
if:
->
(
mirror
,
_options
)
do
expose
:keep_divergent_refs
::
Feature
.
enabled?
(
:keep_divergent_refs
,
mirror
.
project
)
end
end
end
end
end
end
end
lib/api/remote_mirrors.rb
View file @
115708d8
...
@@ -34,7 +34,6 @@ module API
...
@@ -34,7 +34,6 @@ module API
end
end
post
':id/remote_mirrors'
do
post
':id/remote_mirrors'
do
create_params
=
declared_params
(
include_missing:
false
)
create_params
=
declared_params
(
include_missing:
false
)
create_params
.
delete
(
:keep_divergent_refs
)
unless
::
Feature
.
enabled?
(
:keep_divergent_refs
,
user_project
)
new_mirror
=
user_project
.
remote_mirrors
.
create
(
create_params
)
new_mirror
=
user_project
.
remote_mirrors
.
create
(
create_params
)
...
@@ -59,7 +58,6 @@ module API
...
@@ -59,7 +58,6 @@ module API
mirror_params
=
declared_params
(
include_missing:
false
)
mirror_params
=
declared_params
(
include_missing:
false
)
mirror_params
[
:id
]
=
mirror_params
.
delete
(
:mirror_id
)
mirror_params
[
:id
]
=
mirror_params
.
delete
(
:mirror_id
)
mirror_params
.
delete
(
:keep_divergent_refs
)
unless
::
Feature
.
enabled?
(
:keep_divergent_refs
,
user_project
)
update_params
=
{
remote_mirrors_attributes:
mirror_params
}
update_params
=
{
remote_mirrors_attributes:
mirror_params
}
...
...
spec/features/projects/settings/repository_settings_spec.rb
View file @
115708d8
...
@@ -222,20 +222,6 @@ describe 'Projects > Settings > Repository settings' do
...
@@ -222,20 +222,6 @@ describe 'Projects > Settings > Repository settings' do
end
end
end
end
# Removal: https://gitlab.com/gitlab-org/gitlab/-/issues/208828
context
'with the `keep_divergent_refs` feature flag disabled'
do
before
do
stub_feature_flags
(
keep_divergent_refs:
false
)
end
it
'hides the "Keep divergent refs" option'
do
visit
project_settings_repository_path
(
project
)
expect
(
page
).
not_to
have_selector
(
'#keep_divergent_refs'
)
expect
(
page
).
not_to
have_text
(
'Keep divergent refs'
)
end
end
context
'repository cleanup settings'
do
context
'repository cleanup settings'
do
let
(
:object_map_file
)
{
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'bfg_object_map.txt'
)
}
let
(
:object_map_file
)
{
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'bfg_object_map.txt'
)
}
...
...
spec/requests/api/remote_mirrors_spec.rb
View file @
115708d8
...
@@ -78,10 +78,6 @@ describe API::RemoteMirrors do
...
@@ -78,10 +78,6 @@ describe API::RemoteMirrors do
let
(
:route
)
{
->
(
id
)
{
"/projects/
#{
project
.
id
}
/remote_mirrors/
#{
id
}
"
}
}
let
(
:route
)
{
->
(
id
)
{
"/projects/
#{
project
.
id
}
/remote_mirrors/
#{
id
}
"
}
}
let
(
:mirror
)
{
project
.
remote_mirrors
.
first
}
let
(
:mirror
)
{
project
.
remote_mirrors
.
first
}
before
do
stub_feature_flags
(
keep_divergent_refs:
false
)
end
it
'requires `admin_remote_mirror` permission'
do
it
'requires `admin_remote_mirror` permission'
do
put
api
(
route
[
mirror
.
id
],
developer
)
put
api
(
route
[
mirror
.
id
],
developer
)
...
@@ -100,24 +96,7 @@ describe API::RemoteMirrors do
...
@@ -100,24 +96,7 @@ describe API::RemoteMirrors do
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
expect
(
json_response
[
'enabled'
]).
to
eq
(
false
)
expect
(
json_response
[
'enabled'
]).
to
eq
(
false
)
expect
(
json_response
[
'only_protected_branches'
]).
to
eq
(
true
)
expect
(
json_response
[
'only_protected_branches'
]).
to
eq
(
true
)
# Deleted due to lack of feature availability
expect
(
json_response
[
'keep_divergent_refs'
]).
to
be_nil
end
context
'with the `keep_divergent_refs` feature enabled'
do
before
do
stub_feature_flags
(
keep_divergent_refs:
project
)
end
it
'updates the `keep_divergent_refs` attribute'
do
project
.
add_maintainer
(
user
)
put
api
(
route
[
mirror
.
id
],
user
),
params:
{
keep_divergent_refs:
'true'
}
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
expect
(
json_response
[
'keep_divergent_refs'
]).
to
eq
(
true
)
expect
(
json_response
[
'keep_divergent_refs'
]).
to
eq
(
true
)
end
end
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