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
5ba226ce
Commit
5ba226ce
authored
Aug 18, 2021
by
Anna Vovchenko
Committed by
Vitali Tatarintev
Aug 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag infrastructure_registry_page
parent
8263433e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
47 deletions
+22
-47
app/controllers/projects/packages/infrastructure_registry_controller.rb
...s/projects/packages/infrastructure_registry_controller.rb
+2
-7
config/feature_flags/development/infrastructure_registry_page.yml
...eature_flags/development/infrastructure_registry_page.yml
+0
-8
lib/sidebars/projects/menus/packages_registries_menu.rb
lib/sidebars/projects/menus/packages_registries_menu.rb
+1
-1
spec/controllers/projects/packages/infrastructure_registry_controller_spec.rb
...jects/packages/infrastructure_registry_controller_spec.rb
+4
-4
spec/features/projects/infrastructure_registry_spec.rb
spec/features/projects/infrastructure_registry_spec.rb
+3
-3
spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb
.../sidebars/projects/menus/packages_registries_menu_spec.rb
+10
-22
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+2
-2
No files found.
app/controllers/projects/packages/infrastructure_registry_controller.rb
View file @
5ba226ce
...
...
@@ -3,19 +3,14 @@
module
Projects
module
Packages
class
InfrastructureRegistryController
<
Projects
::
ApplicationController
before_action
:verify_feature_enabled!
include
PackagesAccess
feature_category
:infrastructure_as_code
def
show
@package
=
project
.
packages
.
find
(
params
[
:id
])
@package_files
=
@package
.
package_files
.
recent
end
private
def
verify_feature_enabled!
render_404
unless
Feature
.
enabled?
(
:infrastructure_registry_page
,
default_enabled: :yaml
)
end
end
end
end
config/feature_flags/development/infrastructure_registry_page.yml
deleted
100644 → 0
View file @
8263433e
---
name
:
infrastructure_registry_page
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57338
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/326460
milestone
:
'
13.11'
type
:
development
group
:
group::package
default_enabled
:
true
lib/sidebars/projects/menus/packages_registries_menu.rb
View file @
5ba226ce
...
...
@@ -58,7 +58,7 @@ module Sidebars
end
def
infrastructure_registry_menu_item
if
Feature
.
disabled?
(
:infrastructure_registry_page
,
context
.
current_user
,
default_enabled: :yaml
)
||
packages_registry_disabled?
if
packages_registry_disabled?
return
::
Sidebars
::
NilMenuItem
.
new
(
item_id: :infrastructure_registry
)
end
...
...
spec/controllers/projects/packages/infrastructure_registry_controller_spec.rb
View file @
5ba226ce
...
...
@@ -18,9 +18,9 @@ RSpec.describe Projects::Packages::InfrastructureRegistryController do
it_behaves_like
'returning response status'
,
:ok
context
'when the
feature is disabled
'
do
context
'when the
packages registry is not available
'
do
before
do
stub_
feature_flags
(
infrastructure_registry_page:
false
)
stub_
config
(
packages:
{
enabled:
false
}
)
end
it_behaves_like
'returning response status'
,
:not_found
...
...
@@ -34,9 +34,9 @@ RSpec.describe Projects::Packages::InfrastructureRegistryController do
it_behaves_like
'returning response status'
,
:ok
context
'when the
feature is disabled
'
do
context
'when the
packages registry is not available
'
do
before
do
stub_
feature_flags
(
infrastructure_registry_page:
false
)
stub_
config
(
packages:
{
enabled:
false
}
)
end
it_behaves_like
'returning response status'
,
:not_found
...
...
spec/features/projects/infrastructure_registry_spec.rb
View file @
5ba226ce
...
...
@@ -11,9 +11,9 @@ RSpec.describe 'Infrastructure Registry' do
project
.
add_maintainer
(
user
)
end
context
'when
feature is not available
'
do
context
'when
packages registry is not enabled
'
do
before
do
stub_
feature_flags
(
infrastructure_registry_page:
false
)
stub_
config
(
packages:
{
enabled:
false
}
)
end
it
'gives 404'
do
...
...
@@ -23,7 +23,7 @@ RSpec.describe 'Infrastructure Registry' do
end
end
context
'when
feature is available
'
,
:js
do
context
'when
packages registry is enabled
'
,
:js
do
before
do
visit_project_infrastructure_registry
end
...
...
spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb
View file @
5ba226ce
...
...
@@ -124,34 +124,22 @@ RSpec.describe Sidebars::Projects::Menus::PackagesRegistriesMenu do
describe
'Infrastructure Registry'
do
let
(
:item_id
)
{
:infrastructure_registry
}
context
'when feature flag :infrastructure_registry_page is enabled'
do
it
'the menu item is added to list of menu items'
do
stub_feature_flags
(
infrastructure_registry_page:
true
)
is_expected
.
not_to
be_nil
end
context
'when config package setting is disabled'
do
it
'does not add the menu item to the list'
do
stub_config
(
packages:
{
enabled:
false
})
is_expected
.
to
be_nil
end
end
it
'the menu item is added to list of menu items'
do
is_expected
.
not_to
be_nil
end
context
'when user cannot read packages'
do
let
(
:user
)
{
nil
}
context
'when config package setting is disabled'
do
it
'does not add the menu item to the list'
do
stub_config
(
packages:
{
enabled:
false
})
it
'does not add the menu item to the list'
do
is_expected
.
to
be_nil
end
is_expected
.
to
be_nil
end
end
context
'when feature flag :infrastructure_registry_page is disabled'
do
it
'does not add the menu item to the list'
do
stub_feature_flags
(
infrastructure_registry_page:
false
)
context
'when user cannot read packages'
do
let
(
:user
)
{
nil
}
it
'does not add the menu item to the list'
do
is_expected
.
to
be_nil
end
end
...
...
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
5ba226ce
...
...
@@ -640,9 +640,9 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
expect
(
rendered
).
to
have_link
(
'Infrastructure Registry'
,
href:
project_infrastructure_registry_index_path
(
project
))
end
context
'when
feature flag :infrastructure_registry_page
is disabled'
do
context
'when
package registry config
is disabled'
do
it
'does not show link to package registry page'
do
stub_
feature_flags
(
infrastructure_registry_page:
false
)
stub_
config
(
packages:
{
enabled:
false
}
)
render
...
...
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