Commit b5a79f15 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ee-backport-4753-tracing-mvc' into 'master'

backport changes from gitlab-ee!7903

See merge request gitlab-org/gitlab-ce!22767
parents df8f6636 11a606fe
...@@ -540,4 +540,13 @@ module ProjectsHelper ...@@ -540,4 +540,13 @@ module ProjectsHelper
network network
] ]
end end
def sidebar_operations_paths
%w[
environments
clusters
user
gcp
]
end
end end
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
= _('Charts') = _('Charts')
- if project_nav_tab? :operations - if project_nav_tab? :operations
= nav_link(controller: [:environments, :clusters, :user, :gcp]) do = nav_link(controller: sidebar_operations_paths) do
= link_to metrics_project_environments_path(@project), class: 'shortcuts-operations' do = link_to metrics_project_environments_path(@project), class: 'shortcuts-operations' do
.nav-icon-container .nav-icon-container
= sprite_icon('cloud-gear') = sprite_icon('cloud-gear')
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
= _('Operations') = _('Operations')
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
= nav_link(controller: [:environments, :clusters, :user, :gcp], html_options: { class: "fly-out-top-item" } ) do = nav_link(controller: sidebar_operations_paths, html_options: { class: "fly-out-top-item" } ) do
= link_to metrics_project_environments_path(@project) do = link_to metrics_project_environments_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Operations') = _('Operations')
...@@ -215,6 +215,8 @@ ...@@ -215,6 +215,8 @@
%span %span
= _('Metrics') = _('Metrics')
= render_if_exists "layouts/nav/sidebar/tracing_link"
= nav_link(controller: :environments, action: [:index, :folder, :show, :new, :edit, :create, :update, :stop, :terminal]) do = nav_link(controller: :environments, action: [:index, :folder, :show, :new, :edit, :create, :update, :stop, :terminal]) do
= link_to project_environments_path(@project), title: _('Environments'), class: 'shortcuts-environments qa-operations-environments-link' do = link_to project_environments_path(@project), title: _('Environments'), class: 'shortcuts-environments qa-operations-environments-link' do
%span %span
...@@ -326,6 +328,7 @@ ...@@ -326,6 +328,7 @@
= link_to project_settings_ci_cd_path(@project), title: _('CI / CD') do = link_to project_settings_ci_cd_path(@project), title: _('CI / CD') do
%span %span
= _('CI / CD') = _('CI / CD')
= render_if_exists 'projects/sidebar/settings_operations'
- if @project.pages_available? - if @project.pages_available?
= nav_link(controller: :pages) do = nav_link(controller: :pages) do
= link_to project_pages_path(@project), title: _('Pages') do = link_to project_pages_path(@project), title: _('Pages') do
......
...@@ -23,15 +23,23 @@ describe 'Import/Export attribute configuration' do ...@@ -23,15 +23,23 @@ describe 'Import/Export attribute configuration' do
let(:safe_attributes_file) { 'spec/lib/gitlab/import_export/safe_model_attributes.yml' } let(:safe_attributes_file) { 'spec/lib/gitlab/import_export/safe_model_attributes.yml' }
let(:safe_model_attributes) { YAML.load_file(safe_attributes_file) } let(:safe_model_attributes) { YAML.load_file(safe_attributes_file) }
let(:ee_safe_attributes_file) { 'ee/spec/lib/gitlab/import_export/safe_model_attributes.yml' }
let(:ee_safe_model_attributes) { File.exist?(ee_safe_attributes_file) ? YAML.load_file(ee_safe_attributes_file) : {} }
it 'has no new columns' do it 'has no new columns' do
relation_names.each do |relation_name| relation_names.each do |relation_name|
relation_class = relation_class_for_name(relation_name) relation_class = relation_class_for_name(relation_name)
relation_attributes = relation_class.new.attributes.keys relation_attributes = relation_class.new.attributes.keys
expect(safe_model_attributes[relation_class.to_s]).not_to be_nil, "Expected exported class #{relation_class} to exist in safe_model_attributes"
current_attributes = parsed_attributes(relation_name, relation_attributes) current_attributes = parsed_attributes(relation_name, relation_attributes)
safe_attributes = safe_model_attributes[relation_class.to_s] safe_attributes = safe_model_attributes[relation_class.to_s].dup || []
ee_safe_model_attributes[relation_class.to_s].to_a.each do |attribute|
safe_attributes << attribute
end
expect(safe_attributes).not_to be_nil, "Expected exported class #{relation_class} to exist in safe_model_attributes"
new_attributes = current_attributes - safe_attributes new_attributes = current_attributes - safe_attributes
expect(new_attributes).to be_empty, failure_message(relation_class.to_s, new_attributes) expect(new_attributes).to be_empty, failure_message(relation_class.to_s, new_attributes)
...@@ -43,6 +51,7 @@ describe 'Import/Export attribute configuration' do ...@@ -43,6 +51,7 @@ describe 'Import/Export attribute configuration' do
It looks like #{relation_class}, which is exported using the project Import/Export, has new attributes: #{new_attributes.join(',')} It looks like #{relation_class}, which is exported using the project Import/Export, has new attributes: #{new_attributes.join(',')}
Please add the attribute(s) to SAFE_MODEL_ATTRIBUTES if you consider this can be exported. Please add the attribute(s) to SAFE_MODEL_ATTRIBUTES if you consider this can be exported.
#{"If the model/associations are EE-specific, use `#{File.expand_path(ee_safe_attributes_file)}`.\n" if ee_safe_model_attributes.any?}
Otherwise, please blacklist the attribute(s) in IMPORT_EXPORT_CONFIG by adding it to its correspondent Otherwise, please blacklist the attribute(s) in IMPORT_EXPORT_CONFIG by adding it to its correspondent
model in the +excluded_attributes+ section. model in the +excluded_attributes+ section.
......
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