summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /app/controllers/projects
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/artifacts_controller.rb2
-rw-r--r--app/controllers/projects/boards_controller.rb6
-rw-r--r--app/controllers/projects/branches_controller.rb6
-rw-r--r--app/controllers/projects/commit_controller.rb6
-rw-r--r--app/controllers/projects/compare_controller.rb2
-rw-r--r--app/controllers/projects/environments_controller.rb6
-rw-r--r--app/controllers/projects/google_cloud/base_controller.rb6
-rw-r--r--app/controllers/projects/graphs_controller.rb2
-rw-r--r--app/controllers/projects/group_links_controller.rb21
-rw-r--r--app/controllers/projects/incidents_controller.rb5
-rw-r--r--app/controllers/projects/issues_controller.rb22
-rw-r--r--app/controllers/projects/jobs_controller.rb14
-rw-r--r--app/controllers/projects/learn_gitlab_controller.rb5
-rw-r--r--app/controllers/projects/merge_requests_controller.rb36
-rw-r--r--app/controllers/projects/milestones_controller.rb1
-rw-r--r--app/controllers/projects/packages/infrastructure_registry_controller.rb1
-rw-r--r--app/controllers/projects/pipeline_schedules_controller.rb4
-rw-r--r--app/controllers/projects/pipelines/tests_controller.rb12
-rw-r--r--app/controllers/projects/pipelines_controller.rb8
-rw-r--r--app/controllers/projects/project_members_controller.rb2
-rw-r--r--app/controllers/projects/refs_controller.rb12
-rw-r--r--app/controllers/projects/releases_controller.rb3
-rw-r--r--app/controllers/projects/security/configuration_controller.rb1
-rw-r--r--app/controllers/projects/serverless/functions_controller.rb2
-rw-r--r--app/controllers/projects/services_controller.rb4
-rw-r--r--app/controllers/projects/snippets_controller.rb4
-rw-r--r--app/controllers/projects/static_site_editor_controller.rb24
-rw-r--r--app/controllers/projects/tree_controller.rb1
-rw-r--r--app/controllers/projects/uploads_controller.rb2
-rw-r--r--app/controllers/projects/usage_quotas_controller.rb2
-rw-r--r--app/controllers/projects/web_ide_schemas_controller.rb2
-rw-r--r--app/controllers/projects/web_ide_terminals_controller.rb10
-rw-r--r--app/controllers/projects/work_items_controller.rb6
33 files changed, 113 insertions, 127 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index 7bb3ed1d109..feed94708f6 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -5,6 +5,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
include RendersBlob
include SendFileUpload
+ urgency :low, [:browse, :file, :latest_succeeded]
+
layout 'project'
before_action :authorize_read_build!
before_action :authorize_update_build!, only: [:keep]
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index c44a0830e2e..7a30e68d9a2 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -8,7 +8,7 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :assign_endpoint_vars
before_action do
push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml)
- push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml)
+ push_frontend_feature_flag(:realtime_labels, project&.group, default_enabled: :yaml)
experiment(:prominent_create_board_btn, subject: current_user) do |e|
e.control { }
e.candidate { }
@@ -44,11 +44,11 @@ class Projects::BoardsController < Projects::ApplicationController
def assign_endpoint_vars
@boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project)
- @namespace_path = project.namespace.full_path
- @labels_endpoint = project_labels_path(project)
end
def authorize_read_board!
access_denied! unless can?(current_user, :read_issue_board, project)
end
end
+
+Projects::BoardsController.prepend_mod
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index dad73c37fea..6264f10ce2d 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -34,11 +34,9 @@ class Projects::BranchesController < Projects::ApplicationController
Gitlab::GitalyClient.allow_n_plus_1_calls do
render
end
- rescue Gitlab::Git::CommandError => e
- Gitlab::ErrorTracking.track_exception(e)
-
+ rescue Gitlab::Git::CommandError
@gitaly_unavailable = true
- render
+ render status: :service_unavailable
end
format.json do
branches = BranchesFinder.new(@repository, params).execute
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 0c26b402876..2b2764d2e34 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -31,7 +31,7 @@ class Projects::CommitController < Projects::ApplicationController
respond_to do |format|
format.html do
- render
+ render locals: { pagination_params: params.permit(:page) }
end
format.diff do
send_git_diff(@project.repository, @commit.diff_refs)
@@ -106,6 +106,8 @@ class Projects::CommitController < Projects::ApplicationController
end
def revert
+ return render_404 unless @commit
+
assign_change_commit_vars
return render_404 if @start_branch.blank?
@@ -117,6 +119,8 @@ class Projects::CommitController < Projects::ApplicationController
end
def cherry_pick
+ return render_404 unless @commit
+
assign_change_commit_vars
return render_404 if @start_branch.blank?
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 243cc7a346c..3ced5f21b24 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -34,7 +34,7 @@ class Projects::CompareController < Projects::ApplicationController
def show
apply_diff_view_cookie!
- render
+ render locals: { pagination_params: params.permit(:page) }
end
def diff_for_path
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index eabc048e341..8e81e75ad13 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -104,11 +104,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def stop
return render_404 unless @environment.available?
- stop_action = @environment.stop_with_action!(current_user)
+ stop_actions = @environment.stop_with_actions!(current_user)
action_or_env_url =
- if stop_action
- polymorphic_url([project, stop_action])
+ if stop_actions&.count == 1
+ polymorphic_url([project, stop_actions.first])
else
project_environment_url(project, @environment)
end
diff --git a/app/controllers/projects/google_cloud/base_controller.rb b/app/controllers/projects/google_cloud/base_controller.rb
index f293ec752ab..0d65431d870 100644
--- a/app/controllers/projects/google_cloud/base_controller.rb
+++ b/app/controllers/projects/google_cloud/base_controller.rb
@@ -25,7 +25,11 @@ class Projects::GoogleCloud::BaseController < Projects::ApplicationController
end
def feature_flag_enabled!
- unless Feature.enabled?(:incubation_5mp_google_cloud)
+ enabled_for_user = Feature.enabled?(:incubation_5mp_google_cloud, current_user)
+ enabled_for_group = Feature.enabled?(:incubation_5mp_google_cloud, project.group)
+ enabled_for_project = Feature.enabled?(:incubation_5mp_google_cloud, project)
+ feature_is_enabled = enabled_for_user || enabled_for_group || enabled_for_project
+ unless feature_is_enabled
track_event('feature_flag_enabled!', 'access_denied', 'feature_flag_not_enabled')
access_denied!
end
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index d3a05736a47..606f6ac7941 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -102,3 +102,5 @@ class Projects::GraphsController < Projects::ApplicationController
render json: @log.to_json
end
end
+
+Projects::GraphsController.prepend_mod
diff --git a/app/controllers/projects/group_links_controller.rb b/app/controllers/projects/group_links_controller.rb
index 6bc81381d92..6007e09f109 100644
--- a/app/controllers/projects/group_links_controller.rb
+++ b/app/controllers/projects/group_links_controller.rb
@@ -7,21 +7,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
feature_category :subgroups
- def create
- group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
-
- if group
- result = Projects::GroupLinks::CreateService.new(project, current_user, group_link_create_params).execute(group)
- return render_404 if result[:http_status] == 404
-
- flash[:alert] = result[:message] if result[:http_status] == 409
- else
- flash[:alert] = _('Please select a group.')
- end
-
- redirect_to project_project_members_path(project)
- end
-
def update
group_link = @project.project_group_links.find(params[:id])
Projects::GroupLinks::UpdateService.new(group_link).execute(group_link_params)
@@ -54,10 +39,4 @@ class Projects::GroupLinksController < Projects::ApplicationController
def group_link_params
params.require(:group_link).permit(:group_access, :expires_at)
end
-
- def group_link_create_params
- params.permit(:link_group_access, :expires_at)
- end
end
-
-Projects::GroupLinksController.prepend_mod_with('Projects::GroupLinksController')
diff --git a/app/controllers/projects/incidents_controller.rb b/app/controllers/projects/incidents_controller.rb
index 293581a6744..dd1e51bb9bd 100644
--- a/app/controllers/projects/incidents_controller.rb
+++ b/app/controllers/projects/incidents_controller.rb
@@ -7,9 +7,8 @@ class Projects::IncidentsController < Projects::ApplicationController
before_action :authorize_read_issue!
before_action :load_incident, only: [:show]
before_action do
- push_frontend_feature_flag(:incident_escalations, @project)
- push_frontend_feature_flag(:incident_timeline_event_tab, @project, default_enabled: :yaml)
- push_licensed_feature(:incident_timeline_events) if @project.licensed_feature_available?(:incident_timeline_events)
+ push_frontend_feature_flag(:incident_escalations, @project, default_enabled: :yaml)
+ push_frontend_feature_flag(:incident_timeline, @project, default_enabled: :yaml)
end
feature_category :incident_management
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index d4474b9d5a3..46943e7214a 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -10,7 +10,7 @@ class Projects::IssuesController < Projects::ApplicationController
include RecordUserLastActivity
ISSUES_EXCEPT_ACTIONS = %i[index calendar new create bulk_update import_csv export_csv service_desk].freeze
- SET_ISSUABLES_INDEX_ONLY_ACTIONS = %i[calendar service_desk].freeze
+ SET_ISSUABLES_INDEX_ONLY_ACTIONS = %i[index calendar service_desk].freeze
prepend_before_action(only: [:index]) { authenticate_sessionless_user!(:rss) }
prepend_before_action(only: [:calendar]) { authenticate_sessionless_user!(:ics) }
@@ -22,7 +22,9 @@ class Projects::IssuesController < Projects::ApplicationController
before_action :issue, unless: ->(c) { ISSUES_EXCEPT_ACTIONS.include?(c.action_name.to_sym) }
after_action :log_issue_show, unless: ->(c) { ISSUES_EXCEPT_ACTIONS.include?(c.action_name.to_sym) }
- before_action :set_issuables_index, if: ->(c) { SET_ISSUABLES_INDEX_ONLY_ACTIONS.include?(c.action_name.to_sym) }
+ before_action :set_issuables_index, if: ->(c) {
+ SET_ISSUABLES_INDEX_ONLY_ACTIONS.include?(c.action_name.to_sym) && !vue_issues_list?
+ }
# Allow write(create) issue
before_action :authorize_create_issue!, only: [:new, :create]
@@ -37,18 +39,17 @@ class Projects::IssuesController < Projects::ApplicationController
before_action :authorize_download_code!, only: [:related_branches]
before_action do
- push_frontend_feature_flag(:improved_emoji_picker, project, default_enabled: :yaml)
push_frontend_feature_flag(:vue_issues_list, project&.group, default_enabled: :yaml)
- push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml)
push_frontend_feature_flag(:contacts_autocomplete, project&.group, default_enabled: :yaml)
- push_frontend_feature_flag(:markdown_continue_lists, project, default_enabled: :yaml)
+ push_frontend_feature_flag(:incident_timeline, project, default_enabled: :yaml)
end
before_action only: :show do
push_frontend_feature_flag(:confidential_notes, project&.group, default_enabled: :yaml)
push_frontend_feature_flag(:issue_assignees_widget, project, default_enabled: :yaml)
push_frontend_feature_flag(:paginated_issue_discussions, project, default_enabled: :yaml)
- push_frontend_feature_flag(:work_items, project&.group, default_enabled: :yaml)
+ push_frontend_feature_flag(:realtime_labels, project, default_enabled: :yaml)
+ push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
end
around_action :allow_gitaly_ref_name_caching, only: [:discussions]
@@ -72,10 +73,9 @@ class Projects::IssuesController < Projects::ApplicationController
attr_accessor :vulnerability_id
def index
- if html_request? && Feature.enabled?(:vue_issues_list, project&.group, default_enabled: :yaml)
+ if vue_issues_list?
set_sort_order
else
- set_issuables_index
@issues = @issuables
end
@@ -249,6 +249,12 @@ class Projects::IssuesController < Projects::ApplicationController
protected
+ def vue_issues_list?
+ action_name.to_sym == :index &&
+ html_request? &&
+ Feature.enabled?(:vue_issues_list, project&.group, default_enabled: :yaml)
+ end
+
def sorting_field
Issue::SORTING_PREFERENCE_FIELD
end
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index b0f032a01e5..4189419c3ba 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -18,6 +18,7 @@ class Projects::JobsController < Projects::ApplicationController
before_action :authorize_create_proxy_build!, only: :proxy_websocket_authorize
before_action :verify_proxy_request!, only: :proxy_websocket_authorize
before_action :push_jobs_table_vue, only: [:index]
+ before_action :push_jobs_table_vue_search, only: [:index]
before_action do
push_frontend_feature_flag(:infinitely_collapsible_sections, @project, default_enabled: :yaml)
@@ -77,10 +78,13 @@ class Projects::JobsController < Projects::ApplicationController
end
def retry
- return respond_422 unless @build.retryable?
+ response = Ci::RetryJobService.new(project, current_user).execute(@build)
- build = Ci::Build.retry(@build, current_user)
- redirect_to build_path(build)
+ if response.success?
+ redirect_to build_path(response[:job])
+ else
+ respond_422
+ end
end
def play
@@ -269,4 +273,8 @@ class Projects::JobsController < Projects::ApplicationController
def push_jobs_table_vue
push_frontend_feature_flag(:jobs_table_vue, @project, default_enabled: :yaml)
end
+
+ def push_jobs_table_vue_search
+ push_frontend_feature_flag(:jobs_table_vue_search, @project, default_enabled: :yaml)
+ end
end
diff --git a/app/controllers/projects/learn_gitlab_controller.rb b/app/controllers/projects/learn_gitlab_controller.rb
index 177533b89c8..b9f9a1810b7 100644
--- a/app/controllers/projects/learn_gitlab_controller.rb
+++ b/app/controllers/projects/learn_gitlab_controller.rb
@@ -4,6 +4,7 @@ class Projects::LearnGitlabController < Projects::ApplicationController
before_action :authenticate_user!
before_action :check_experiment_enabled?
before_action :enable_invite_for_help_continuous_onboarding_experiment
+ before_action :enable_video_tutorials_continuous_onboarding_experiment
feature_category :users
@@ -24,4 +25,8 @@ class Projects::LearnGitlabController < Projects::ApplicationController
e.publish_to_database
end
end
+
+ def enable_video_tutorials_continuous_onboarding_experiment
+ experiment(:video_tutorials_continuous_onboarding, namespace: project&.namespace).publish
+ end
end
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 60d7920f83e..03bb132fe47 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -37,17 +37,12 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:core_security_mr_widget_counts, project)
push_frontend_feature_flag(:paginated_notes, project, default_enabled: :yaml)
push_frontend_feature_flag(:confidential_notes, project, default_enabled: :yaml)
- push_frontend_feature_flag(:improved_emoji_picker, project, default_enabled: :yaml)
push_frontend_feature_flag(:restructured_mr_widget, project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_mr_widgets_extensions, project, default_enabled: :yaml)
push_frontend_feature_flag(:rebase_without_ci_ui, project, default_enabled: :yaml)
- push_frontend_feature_flag(:markdown_continue_lists, project, default_enabled: :yaml)
push_frontend_feature_flag(:secure_vulnerability_training, project, default_enabled: :yaml)
push_frontend_feature_flag(:issue_assignees_widget, @project, default_enabled: :yaml)
- # Usage data feature flags
- push_frontend_feature_flag(:users_expanding_widgets_usage_data, project, default_enabled: :yaml)
- push_frontend_feature_flag(:diff_settings_usage_data, default_enabled: :yaml)
- push_frontend_feature_flag(:usage_data_diff_searches, project, default_enabled: :yaml)
+ push_frontend_feature_flag(:realtime_labels, project, default_enabled: :yaml)
end
before_action do
@@ -85,7 +80,12 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
:destroy,
:rebase,
:discussions,
- :pipelines
+ :pipelines,
+ :test_reports
+ ]
+ urgency :low, [
+ :codequality_mr_diff_reports,
+ :codequality_reports
]
def index
@@ -130,9 +130,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
set_pipeline_variables
- ::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do
- @number_of_pipelines = @pipelines.size
- end
+ @number_of_pipelines = @pipelines.size
render
end
@@ -196,17 +194,15 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
Gitlab::PollingInterval.set_header(response, interval: 10_000)
- ::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do
- render json: {
- pipelines: PipelineSerializer
- .new(project: @project, current_user: @current_user)
- .with_pagination(request, response)
- .represent(@pipelines),
- count: {
- all: @pipelines.count
- }
+ render json: {
+ pipelines: PipelineSerializer
+ .new(project: @project, current_user: @current_user)
+ .with_pagination(request, response)
+ .represent(@pipelines),
+ count: {
+ all: @pipelines.count
}
- end
+ }
end
def sast_reports
diff --git a/app/controllers/projects/milestones_controller.rb b/app/controllers/projects/milestones_controller.rb
index 5dc9718d7a4..b896e2543ff 100644
--- a/app/controllers/projects/milestones_controller.rb
+++ b/app/controllers/projects/milestones_controller.rb
@@ -26,6 +26,7 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to do |format|
format.html do
+ @milestone_states = Milestone.states_count(@project)
# We need to show group milestones in the JSON response
# so that people can filter by and assign group milestones,
# but we don't need to show them on the project milestones page itself.
diff --git a/app/controllers/projects/packages/infrastructure_registry_controller.rb b/app/controllers/projects/packages/infrastructure_registry_controller.rb
index 2fe353b7acb..99d75afc63a 100644
--- a/app/controllers/projects/packages/infrastructure_registry_controller.rb
+++ b/app/controllers/projects/packages/infrastructure_registry_controller.rb
@@ -9,7 +9,6 @@ module Projects
def show
@package = project.packages.find(params[:id])
- @package_files = @package.installable_package_files.recent
end
end
end
diff --git a/app/controllers/projects/pipeline_schedules_controller.rb b/app/controllers/projects/pipeline_schedules_controller.rb
index 271c31b6429..ac94cc001dd 100644
--- a/app/controllers/projects/pipeline_schedules_controller.rb
+++ b/app/controllers/projects/pipeline_schedules_controller.rb
@@ -10,10 +10,6 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
before_action :authorize_update_pipeline_schedule!, except: [:index, :new, :create, :play]
before_action :authorize_admin_pipeline_schedule!, only: [:destroy]
- before_action do
- push_frontend_feature_flag(:pipeline_schedules_with_tags, @project, default_enabled: :yaml)
- end
-
feature_category :continuous_integration
# rubocop: disable CodeReuse/ActiveRecord
diff --git a/app/controllers/projects/pipelines/tests_controller.rb b/app/controllers/projects/pipelines/tests_controller.rb
index 602fc02686a..4daf700a8bd 100644
--- a/app/controllers/projects/pipelines/tests_controller.rb
+++ b/app/controllers/projects/pipelines/tests_controller.rb
@@ -3,6 +3,8 @@
module Projects
module Pipelines
class TestsController < Projects::Pipelines::ApplicationController
+ urgency :low, [:show, :summary]
+
before_action :authorize_read_build!
before_action :builds, only: [:show]
@@ -21,9 +23,13 @@ module Projects
def show
respond_to do |format|
format.json do
- render json: TestSuiteSerializer
- .new(project: project, current_user: @current_user)
- .represent(test_suite, details: true)
+ if Feature.enabled?(:ci_test_report_artifacts_expired, project, default_enabled: :yaml) && pipeline.has_expired_test_reports?
+ render json: { errors: 'Test report artifacts have expired' }, status: :not_found
+ else
+ render json: TestSuiteSerializer
+ .new(project: project, current_user: @current_user)
+ .represent(test_suite, details: true)
+ end
end
end
end
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 8279bb20769..02f041637ba 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -5,7 +5,7 @@ class Projects::PipelinesController < Projects::ApplicationController
include RedisTracking
urgency :default, [:status]
- urgency :low, [:index, :new, :builds, :show, :failures, :create, :stage, :retry, :dag, :cancel]
+ urgency :low, [:index, :new, :builds, :show, :failures, :create, :stage, :retry, :dag, :cancel, :test_report]
before_action :disable_query_limiting, only: [:create, :retry]
before_action :pipeline, except: [:index, :new, :create, :charts, :config_variables]
@@ -17,6 +17,10 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action :ensure_pipeline, only: [:show, :downloadable_artifacts]
+ before_action do
+ push_frontend_feature_flag(:pipeline_tabs_vue, @project, default_enabled: :yaml)
+ end
+
# Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596
before_action :redirect_for_legacy_scope_filter, only: [:index], if: -> { request.format.html? }
@@ -264,7 +268,7 @@ class Projects::PipelinesController < Projects::ApplicationController
project
.all_pipelines
.includes(builds: :tags, user: :status)
- .find_by!(id: params[:id])
+ .find(params[:id])
.present(current_user: current_user)
end
end
diff --git a/app/controllers/projects/project_members_controller.rb b/app/controllers/projects/project_members_controller.rb
index 0279a65f262..49618c89672 100644
--- a/app/controllers/projects/project_members_controller.rb
+++ b/app/controllers/projects/project_members_controller.rb
@@ -8,7 +8,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
- feature_category :authentication_and_authorization
+ feature_category :projects
def index
@sort = params[:sort].presence || sort_value_name
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index b070f9419fc..72af3280a39 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -43,12 +43,7 @@ class Projects::RefsController < Projects::ApplicationController
end
def logs_tree
- tree_summary = ::Gitlab::TreeSummary.new(
- @commit, @project, current_user,
- path: @path, offset: permitted_params[:offset], limit: 25)
-
respond_to do |format|
- format.html { render_404 }
format.json do
logs, next_offset = tree_summary.fetch_logs
@@ -61,6 +56,13 @@ class Projects::RefsController < Projects::ApplicationController
private
+ def tree_summary
+ ::Gitlab::TreeSummary.new(
+ @commit, @project, current_user,
+ path: @path, offset: permitted_params[:offset], limit: 25
+ )
+ end
+
def validate_ref_id
return not_found if permitted_params[:id].present? && permitted_params[:id] !~ Gitlab::PathRegex.git_reference_regex
end
diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb
index 1a2baf96020..19413d97d9d 100644
--- a/app/controllers/projects/releases_controller.rb
+++ b/app/controllers/projects/releases_controller.rb
@@ -8,9 +8,6 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :authorize_update_release!, only: %i[edit update]
before_action :authorize_create_release!, only: :new
before_action :validate_suffix_path, :fetch_latest_tag, only: :latest_permalink
- before_action only: :index do
- push_frontend_feature_flag(:releases_index_apollo_client, project, default_enabled: :yaml)
- end
feature_category :release_orchestration
diff --git a/app/controllers/projects/security/configuration_controller.rb b/app/controllers/projects/security/configuration_controller.rb
index 7b799cc0aa6..cdb02047215 100644
--- a/app/controllers/projects/security/configuration_controller.rb
+++ b/app/controllers/projects/security/configuration_controller.rb
@@ -6,6 +6,7 @@ module Projects
include SecurityAndCompliancePermissions
feature_category :static_application_security_testing, [:show]
+ urgency :low, [:show]
def show
render_403 unless can?(current_user, :read_security_configuration, project)
diff --git a/app/controllers/projects/serverless/functions_controller.rb b/app/controllers/projects/serverless/functions_controller.rb
index b6f77a6d515..7352edaaab2 100644
--- a/app/controllers/projects/serverless/functions_controller.rb
+++ b/app/controllers/projects/serverless/functions_controller.rb
@@ -6,7 +6,7 @@ module Projects
before_action :ensure_feature_enabled!
before_action :authorize_read_cluster!
- feature_category :not_owned
+ feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
def index
respond_to do |format|
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index 105f8efde7b..1321111faaf 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -13,10 +13,6 @@ class Projects::ServicesController < Projects::ApplicationController
before_action :set_deprecation_notice_for_prometheus_integration, only: [:edit, :update]
before_action :redirect_deprecated_prometheus_integration, only: [:update]
- before_action do
- push_frontend_feature_flag(:integration_form_sections, project, default_enabled: :yaml)
- end
-
respond_to :html
layout "project_settings"
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb
index 97f9c5814e2..c861b24d9ec 100644
--- a/app/controllers/projects/snippets_controller.rb
+++ b/app/controllers/projects/snippets_controller.rb
@@ -14,9 +14,7 @@ class Projects::SnippetsController < Projects::Snippets::ApplicationController
before_action :authorize_read_snippet!, except: [:new, :index]
before_action :authorize_update_snippet!, only: :edit
- before_action only: [:show] do
- push_frontend_feature_flag(:improved_emoji_picker, @project, default_enabled: :yaml)
- end
+ urgency :low, [:index]
def index
@snippet_counts = ::Snippets::CountService
diff --git a/app/controllers/projects/static_site_editor_controller.rb b/app/controllers/projects/static_site_editor_controller.rb
index 0d9a6f568a1..fed6307514e 100644
--- a/app/controllers/projects/static_site_editor_controller.rb
+++ b/app/controllers/projects/static_site_editor_controller.rb
@@ -3,6 +3,7 @@
class Projects::StaticSiteEditorController < Projects::ApplicationController
include ExtractsPath
include CreatesCommit
+ include BlobHelper
layout 'fullscreen'
@@ -24,28 +25,7 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
end
def show
- service_response = ::StaticSiteEditor::ConfigService.new(
- container: project,
- current_user: current_user,
- params: {
- ref: @ref,
- path: @path,
- return_url: params[:return_url]
- }
- ).execute
-
- if service_response.success?
- Gitlab::UsageDataCounters::StaticSiteEditorCounter.increment_views_count
-
- @data = serialize_necessary_payload_values_to_json(service_response.payload)
- else
- # TODO: For now, if the service returns any error, the user is redirected
- # to the root project page with the error message displayed as an alert.
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/213285#note_414808004
- # for discussion of plans to handle this via a page owned by the Static Site Editor.
- flash[:alert] = service_response.message
- redirect_to project_path(project)
- end
+ redirect_to ide_edit_path(project, @ref, @path)
end
private
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index e447fc3f3fe..a70795f2065 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -18,7 +18,6 @@ class Projects::TreeController < Projects::ApplicationController
before_action do
push_frontend_feature_flag(:lazy_load_commits, @project, default_enabled: :yaml)
- push_frontend_feature_flag(:new_dir_modal, @project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml)
push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml)
push_licensed_feature(:file_locks) if @project.licensed_feature_available?(:file_locks)
diff --git a/app/controllers/projects/uploads_controller.rb b/app/controllers/projects/uploads_controller.rb
index ed5bd73d6d1..e6e91231ba2 100644
--- a/app/controllers/projects/uploads_controller.rb
+++ b/app/controllers/projects/uploads_controller.rb
@@ -11,7 +11,7 @@ class Projects::UploadsController < Projects::ApplicationController
before_action :authorize_upload_file!, only: [:create, :authorize]
before_action :verify_workhorse_api!, only: [:authorize]
- feature_category :not_owned
+ feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
private
diff --git a/app/controllers/projects/usage_quotas_controller.rb b/app/controllers/projects/usage_quotas_controller.rb
index 680874ffee4..f45ee265432 100644
--- a/app/controllers/projects/usage_quotas_controller.rb
+++ b/app/controllers/projects/usage_quotas_controller.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class Projects::UsageQuotasController < Projects::ApplicationController
- before_action :authorize_admin_project!
+ before_action :authorize_read_usage_quotas!
layout "project_settings"
diff --git a/app/controllers/projects/web_ide_schemas_controller.rb b/app/controllers/projects/web_ide_schemas_controller.rb
index 84a191815f4..cdc416de6c9 100644
--- a/app/controllers/projects/web_ide_schemas_controller.rb
+++ b/app/controllers/projects/web_ide_schemas_controller.rb
@@ -5,6 +5,8 @@ class Projects::WebIdeSchemasController < Projects::ApplicationController
feature_category :web_ide
+ urgency :low
+
def show
return respond_422 unless branch_sha
diff --git a/app/controllers/projects/web_ide_terminals_controller.rb b/app/controllers/projects/web_ide_terminals_controller.rb
index 1d179765ad9..350b091edfa 100644
--- a/app/controllers/projects/web_ide_terminals_controller.rb
+++ b/app/controllers/projects/web_ide_terminals_controller.rb
@@ -57,11 +57,13 @@ class Projects::WebIdeTerminalsController < Projects::ApplicationController
end
def retry
- return respond_422 unless build.retryable?
+ response = Ci::RetryJobService.new(build.project, current_user).execute(build)
- new_build = Ci::Build.retry(build, current_user)
-
- render_terminal(new_build)
+ if response.success?
+ render_terminal(response[:job])
+ else
+ respond_422
+ end
end
private
diff --git a/app/controllers/projects/work_items_controller.rb b/app/controllers/projects/work_items_controller.rb
index 1bd2762f277..d39664e1deb 100644
--- a/app/controllers/projects/work_items_controller.rb
+++ b/app/controllers/projects/work_items_controller.rb
@@ -2,12 +2,12 @@
class Projects::WorkItemsController < Projects::ApplicationController
before_action do
- push_frontend_feature_flag(:work_items, project, default_enabled: :yaml)
+ push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
end
- feature_category :not_owned
+ feature_category :team_planning
def index
- render_404 unless Feature.enabled?(:work_items, project, default_enabled: :yaml)
+ render_404 unless project&.work_items_feature_flag_enabled?
end
end