Remove builds tab from commit
Remove unused file Fix commit link
This commit is contained in:
parent
dfa842ce1d
commit
9a82aa70e3
|
@ -138,7 +138,6 @@
|
|||
new MergedButtons();
|
||||
break;
|
||||
case 'projects:merge_requests:commits':
|
||||
case 'projects:merge_requests:builds':
|
||||
new MergedButtons();
|
||||
break;
|
||||
case 'projects:merge_requests:pipelines':
|
||||
|
|
|
@ -8,13 +8,10 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
|
||||
# Authorize
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!, except: [:cancel_builds, :retry_builds]
|
||||
before_action :authorize_update_build!, only: [:cancel_builds, :retry_builds]
|
||||
before_action :authorize_read_pipeline!, only: [:pipelines]
|
||||
before_action :authorize_read_commit_status!, only: [:builds]
|
||||
before_action :commit
|
||||
before_action :define_commit_vars, only: [:show, :diff_for_path, :builds, :pipelines]
|
||||
before_action :define_status_vars, only: [:show, :builds, :pipelines]
|
||||
before_action :define_commit_vars, only: [:show, :diff_for_path, :pipelines]
|
||||
before_action :define_status_vars, only: [:show, :pipelines]
|
||||
before_action :define_note_vars, only: [:show, :diff_for_path]
|
||||
before_action :authorize_edit_tree!, only: [:revert, :cherry_pick]
|
||||
|
||||
|
@ -35,25 +32,6 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
def pipelines
|
||||
end
|
||||
|
||||
def builds
|
||||
end
|
||||
|
||||
def cancel_builds
|
||||
ci_builds.running_or_pending.each(&:cancel)
|
||||
|
||||
redirect_back_or_default default: builds_namespace_project_commit_path(project.namespace, project, commit.sha)
|
||||
end
|
||||
|
||||
def retry_builds
|
||||
ci_builds.latest.failed.each do |build|
|
||||
if build.retryable?
|
||||
Ci::Build.retry(build, current_user)
|
||||
end
|
||||
end
|
||||
|
||||
redirect_back_or_default default: builds_namespace_project_commit_path(project.namespace, project, commit.sha)
|
||||
end
|
||||
|
||||
def branches
|
||||
@branches = @project.repository.branch_names_contains(commit.id)
|
||||
@tags = @project.repository.tag_names_contains(commit.id)
|
||||
|
@ -98,10 +76,6 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
@noteable = @commit ||= @project.commit(params[:id])
|
||||
end
|
||||
|
||||
def ci_builds
|
||||
@ci_builds ||= Ci::Build.where(pipeline: pipelines)
|
||||
end
|
||||
|
||||
def define_commit_vars
|
||||
return git_not_found! unless commit
|
||||
|
||||
|
@ -134,7 +108,6 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
def define_status_vars
|
||||
@ci_pipelines = project.pipelines.where(sha: commit.sha)
|
||||
@statuses = CommitStatus.where(pipeline: @ci_pipelines).relevant
|
||||
@builds = Ci::Build.where(pipeline: @ci_pipelines).relevant
|
||||
end
|
||||
|
||||
def assign_change_commit_vars(mr_source_branch)
|
||||
|
|
|
@ -201,17 +201,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def builds
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
define_discussion_vars
|
||||
|
||||
render 'show'
|
||||
end
|
||||
format.json { render json: { html: view_to_html_string('projects/merge_requests/show/_builds') } }
|
||||
end
|
||||
end
|
||||
|
||||
def pipelines
|
||||
@pipelines = @merge_request.all_pipelines
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module CiStatusHelper
|
||||
def ci_status_path(pipeline)
|
||||
project = pipeline.project
|
||||
builds_namespace_project_commit_path(project.namespace, project, pipeline.sha)
|
||||
# builds_namespace_project_commit_path(project.namespace, project, pipeline.sha)
|
||||
end
|
||||
|
||||
# Is used by Commit and Merge Request Widget
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
- ref = local_assigns.fetch(:ref)
|
||||
- status = commit.status(ref)
|
||||
- if status
|
||||
= link_to builds_namespace_project_commit_path(commit.project.namespace, commit.project, commit), class: "ci-status ci-#{status}" do
|
||||
= link_to pipelines_namespace_project_commit_path(commit.project.namespace, commit.project, commit), class: "ci-status ci-#{status}" do
|
||||
= ci_icon_for_status(status)
|
||||
= ci_label_for_status(status)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
= link_to pipeline_path(@build.pipeline) do
|
||||
%strong ##{@build.pipeline.id}
|
||||
for commit
|
||||
= link_to ci_status_path(@build.pipeline) do
|
||||
= link_to namespace_project_commit_path(@project.namespace, @project, @build.pipeline.sha) do
|
||||
%strong= @build.pipeline.short_sha
|
||||
from
|
||||
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
- @ci_pipelines.each do |pipeline|
|
||||
= render "pipeline", pipeline: pipeline, pipeline_details: true
|
|
@ -8,7 +8,3 @@
|
|||
= link_to pipelines_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
|
||||
Pipelines
|
||||
%span.badge= @ci_pipelines.count
|
||||
= nav_link(path: 'commit#builds') do
|
||||
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
|
||||
Builds
|
||||
%span.badge= @statuses.count
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
- @no_container = true
|
||||
- page_title "Builds", "#{@commit.title} (#{@commit.short_id})", "Commits"
|
||||
= render "projects/commits/head"
|
||||
|
||||
%div{ class: container_class }
|
||||
= render "commit_box"
|
||||
|
||||
= render "ci_menu"
|
||||
= render "builds"
|
|
@ -1 +0,0 @@
|
|||
= render "projects/commit/pipeline", pipeline: @pipeline, link_to_commit: true
|
|
@ -32,7 +32,6 @@ constraints(ProjectUrlConstrainer.new) do
|
|||
resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
|
||||
member do
|
||||
get :branches
|
||||
get :builds
|
||||
get :pipelines
|
||||
post :cancel_builds
|
||||
post :retry_builds
|
||||
|
|
Loading…
Reference in New Issue