Commit 9a82aa70 authored by Filipa Lacerda's avatar Filipa Lacerda

Remove builds tab from commit

Remove unused file

Fix commit link
parent dfa842ce
...@@ -138,7 +138,6 @@ ...@@ -138,7 +138,6 @@
new MergedButtons(); new MergedButtons();
break; break;
case 'projects:merge_requests:commits': case 'projects:merge_requests:commits':
case 'projects:merge_requests:builds':
new MergedButtons(); new MergedButtons();
break; break;
case 'projects:merge_requests:pipelines': case 'projects:merge_requests:pipelines':
......
...@@ -8,13 +8,10 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -8,13 +8,10 @@ class Projects::CommitController < Projects::ApplicationController
# Authorize # Authorize
before_action :require_non_empty_project 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_pipeline!, only: [:pipelines]
before_action :authorize_read_commit_status!, only: [:builds]
before_action :commit before_action :commit
before_action :define_commit_vars, only: [:show, :diff_for_path, :builds, :pipelines] before_action :define_commit_vars, only: [:show, :diff_for_path, :pipelines]
before_action :define_status_vars, only: [:show, :builds, :pipelines] before_action :define_status_vars, only: [:show, :pipelines]
before_action :define_note_vars, only: [:show, :diff_for_path] before_action :define_note_vars, only: [:show, :diff_for_path]
before_action :authorize_edit_tree!, only: [:revert, :cherry_pick] before_action :authorize_edit_tree!, only: [:revert, :cherry_pick]
...@@ -35,25 +32,6 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -35,25 +32,6 @@ class Projects::CommitController < Projects::ApplicationController
def pipelines def pipelines
end 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 def branches
@branches = @project.repository.branch_names_contains(commit.id) @branches = @project.repository.branch_names_contains(commit.id)
@tags = @project.repository.tag_names_contains(commit.id) @tags = @project.repository.tag_names_contains(commit.id)
...@@ -98,10 +76,6 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -98,10 +76,6 @@ class Projects::CommitController < Projects::ApplicationController
@noteable = @commit ||= @project.commit(params[:id]) @noteable = @commit ||= @project.commit(params[:id])
end end
def ci_builds
@ci_builds ||= Ci::Build.where(pipeline: pipelines)
end
def define_commit_vars def define_commit_vars
return git_not_found! unless commit return git_not_found! unless commit
...@@ -134,7 +108,6 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -134,7 +108,6 @@ class Projects::CommitController < Projects::ApplicationController
def define_status_vars def define_status_vars
@ci_pipelines = project.pipelines.where(sha: commit.sha) @ci_pipelines = project.pipelines.where(sha: commit.sha)
@statuses = CommitStatus.where(pipeline: @ci_pipelines).relevant @statuses = CommitStatus.where(pipeline: @ci_pipelines).relevant
@builds = Ci::Build.where(pipeline: @ci_pipelines).relevant
end end
def assign_change_commit_vars(mr_source_branch) def assign_change_commit_vars(mr_source_branch)
......
...@@ -201,17 +201,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -201,17 +201,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
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 def pipelines
@pipelines = @merge_request.all_pipelines @pipelines = @merge_request.all_pipelines
......
module CiStatusHelper module CiStatusHelper
def ci_status_path(pipeline) def ci_status_path(pipeline)
project = pipeline.project project = pipeline.project
builds_namespace_project_commit_path(project.namespace, project, pipeline.sha) # builds_namespace_project_commit_path(project.namespace, project, pipeline.sha)
end end
# Is used by Commit and Merge Request Widget # Is used by Commit and Merge Request Widget
......
- ref = local_assigns.fetch(:ref) - ref = local_assigns.fetch(:ref)
- status = commit.status(ref) - status = commit.status(ref)
- if status - 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_icon_for_status(status)
= ci_label_for_status(status) = ci_label_for_status(status)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= link_to pipeline_path(@build.pipeline) do = link_to pipeline_path(@build.pipeline) do
%strong ##{@build.pipeline.id} %strong ##{@build.pipeline.id}
for commit 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 %strong= @build.pipeline.short_sha
from from
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do = link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
......
- @ci_pipelines.each do |pipeline|
= render "pipeline", pipeline: pipeline, pipeline_details: true
...@@ -8,7 +8,3 @@ ...@@ -8,7 +8,3 @@
= link_to pipelines_namespace_project_commit_path(@project.namespace, @project, @commit.id) do = link_to pipelines_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
Pipelines Pipelines
%span.badge= @ci_pipelines.count %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
- @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"
= render "projects/commit/pipeline", pipeline: @pipeline, link_to_commit: true
...@@ -32,7 +32,6 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -32,7 +32,6 @@ constraints(ProjectUrlConstrainer.new) do
resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
member do member do
get :branches get :branches
get :builds
get :pipelines get :pipelines
post :cancel_builds post :cancel_builds
post :retry_builds post :retry_builds
......
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