From f986ce9ffa56e25d0a3010c78d9481664742d766 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 23 Mar 2021 18:09:05 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/graphql_controller.rb | 5 ++--- app/controllers/projects/forks_controller.rb | 10 +++++++++- app/controllers/projects/pipelines_controller.rb | 1 + app/controllers/projects/releases_controller.rb | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 82005c548f2..a13ec1daddb 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -146,8 +146,7 @@ class GraphqlController < ApplicationController end def logs - RequestStore.store[:graphql_logs].to_h - .except(:duration_s, :query_string) - .merge(operation_name: params[:operationName]) + RequestStore.store[:graphql_logs].to_a + .map { |log| log.except(:duration_s, :query_string) } end end diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 005bc2a385b..b999110181b 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -44,13 +44,17 @@ class Projects::ForksController < Projects::ApplicationController def new respond_to do |format| format.html do - @own_namespace = current_user.namespace if fork_service.valid_fork_targets.include?(current_user.namespace) + @own_namespace = current_user.namespace if can_fork_to?(current_user.namespace) @project = project end format.json do namespaces = load_namespaces_with_associations - [project.namespace] + namespaces = [current_user.namespace] + namespaces if + Feature.enabled?(:fork_project_form, project, default_enabled: :yaml) && + can_fork_to?(current_user.namespace) + render json: { namespaces: ForkNamespaceSerializer.new.represent(namespaces, project: project, current_user: current_user, memberships: memberships_hash) } @@ -78,6 +82,10 @@ class Projects::ForksController < Projects::ApplicationController private + def can_fork_to?(namespace) + ForkTargetsFinder.new(@project, current_user).execute.id_in(current_user.namespace).any? + end + def load_forks forks = ForkProjectsFinder.new( project, diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 35d138fc27b..e1c2efc3760 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -15,6 +15,7 @@ class Projects::PipelinesController < Projects::ApplicationController before_action do push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: :yaml) push_frontend_feature_flag(:pipeline_graph_layers_view, project, type: :development, default_enabled: :yaml) + push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details_users, current_user, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:jira_for_vulnerabilities, project, type: :development, default_enabled: :yaml) diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb index 614bada09ed..26382856761 100644 --- a/app/controllers/projects/releases_controller.rb +++ b/app/controllers/projects/releases_controller.rb @@ -12,7 +12,6 @@ class Projects::ReleasesController < Projects::ApplicationController push_frontend_feature_flag(:graphql_release_data, project, default_enabled: true) push_frontend_feature_flag(:graphql_milestone_stats, project, default_enabled: true) push_frontend_feature_flag(:graphql_releases_page, project, default_enabled: true) - push_frontend_feature_flag(:graphql_individual_release_page, project, default_enabled: true) end before_action :authorize_update_release!, only: %i[edit update] before_action :authorize_create_release!, only: :new -- cgit v1.2.3