summaryrefslogtreecommitdiff
path: root/app/controllers/projects/commit_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-15 18:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-15 18:09:05 +0000
commita0213db466c75403a5a79f95af8a0a5cff13014c (patch)
tree6118144407f99f1121c34e934cf0d96c991d578e /app/controllers/projects/commit_controller.rb
parentf5c3f32975addd56fe8659f1c346d0e56f0b23d9 (diff)
downloadgitlab-ce-a0213db466c75403a5a79f95af8a0a5cff13014c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index cbb2a35d047..c1685676340 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -16,9 +16,14 @@ class Projects::CommitController < Projects::ApplicationController
before_action :authorize_read_pipeline!, only: [:pipelines]
before_action :commit
before_action :define_commit_vars, only: [:show, :diff_for_path, :diff_files, :pipelines, :merge_requests]
+ before_action :define_commit_box_vars, only: [:show, :pipelines]
before_action :define_note_vars, only: [:show, :diff_for_path, :diff_files]
before_action :authorize_edit_tree!, only: [:revert, :cherry_pick]
+ before_action only: [:show, :pipelines] do
+ push_frontend_feature_flag(:ci_commit_pipeline_mini_graph_vue, @project, default_enabled: :yaml)
+ end
+
BRANCH_SEARCH_LIMIT = 1000
COMMIT_DIFFS_PER_PAGE = 75
@@ -202,6 +207,15 @@ class Projects::CommitController < Projects::ApplicationController
end
# rubocop: enable CodeReuse/ActiveRecord
+ def define_commit_box_vars
+ @last_pipeline = @commit.last_pipeline
+
+ return unless ::Gitlab::Ci::Features.ci_commit_pipeline_mini_graph_vue_enabled?(@project)
+ return unless @commit.last_pipeline
+
+ @last_pipeline_stages = StageSerializer.new(project: @project, current_user: @current_user).represent(@last_pipeline.stages)
+ end
+
def assign_change_commit_vars
@start_branch = params[:start_branch]
@commit_params = { commit: @commit }