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
65d576ae
Commit
65d576ae
authored
Jun 15, 2021
by
Nicolò Maria Mezzopera
Committed by
David Fernandez
Jun 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable infrastructure registry
parent
0655405a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
5 deletions
+50
-5
app/controllers/projects/packages/infrastructure_registry_controller.rb
...s/projects/packages/infrastructure_registry_controller.rb
+1
-1
app/views/projects/packages/infrastructure_registry/show.html.haml
.../projects/packages/infrastructure_registry/show.html.haml
+2
-2
config/feature_flags/development/infrastructure_registry_page.yml
...eature_flags/development/infrastructure_registry_page.yml
+1
-1
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
+45
-0
No files found.
app/controllers/projects/packages/infrastructure_registry_controller.rb
View file @
65d576ae
...
...
@@ -14,7 +14,7 @@ module Projects
private
def
verify_feature_enabled!
render_404
unless
Feature
.
enabled?
(
:infrastructure_registry_page
)
render_404
unless
Feature
.
enabled?
(
:infrastructure_registry_page
,
default_enabled: :yaml
)
end
end
end
...
...
app/views/projects/packages/infrastructure_registry/show.html.haml
View file @
65d576ae
-
add_to_breadcrumbs
_
(
"Infrastructure Registry"
),
project_
packages
_path
(
@project
)
-
add_to_breadcrumbs
@package
.
name
,
project_
packages
_path
(
@project
)
-
add_to_breadcrumbs
_
(
"Infrastructure Registry"
),
project_
infrastructure_registry_index
_path
(
@project
)
-
add_to_breadcrumbs
@package
.
name
,
project_
infrastructure_registry_index
_path
(
@project
)
-
breadcrumb_title
@package
.
version
-
page_title
_
(
"Infrastructure Registry"
)
-
@content_class
=
"limit-container-width"
unless
fluid_layout
...
...
config/feature_flags/development/infrastructure_registry_page.yml
View file @
65d576ae
...
...
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326460
milestone
:
'
13.11'
type
:
development
group
:
group::package
default_enabled
:
fals
e
default_enabled
:
tru
e
lib/sidebars/projects/menus/packages_registries_menu.rb
View file @
65d576ae
...
...
@@ -58,7 +58,7 @@ module Sidebars
end
def
infrastructure_registry_menu_item
if
Feature
.
disabled?
(
:infrastructure_registry_page
,
context
.
current_user
)
if
Feature
.
disabled?
(
:infrastructure_registry_page
,
context
.
current_user
,
default_enabled: :yaml
)
return
::
Sidebars
::
NilMenuItem
.
new
(
item_id: :infrastructure_registry
)
end
...
...
spec/controllers/projects/packages/infrastructure_registry_controller_spec.rb
0 → 100644
View file @
65d576ae
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
Packages
::
InfrastructureRegistryController
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:params
)
{
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
before
do
sign_in
(
user
)
project
.
add_maintainer
(
user
)
end
describe
'GET #index'
do
subject
{
get
:index
,
params:
params
,
format: :html
}
it_behaves_like
'returning response status'
,
:ok
context
'when the feature is disabled'
do
before
do
stub_feature_flags
(
infrastructure_registry_page:
false
)
end
it_behaves_like
'returning response status'
,
:not_found
end
end
describe
'GET #show'
do
let_it_be
(
:terraform_module
)
{
create
(
:terraform_module_package
,
project:
project
)
}
subject
{
get
:show
,
params:
params
.
merge
(
id:
terraform_module
.
id
),
format: :html
}
it_behaves_like
'returning response status'
,
:ok
context
'when the feature is disabled'
do
before
do
stub_feature_flags
(
infrastructure_registry_page:
false
)
end
it_behaves_like
'returning response status'
,
:not_found
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