summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-25 18:10:32 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-21 11:18:13 +0000
commit9a82aa70e3f3ff679c7a27ccbb9d497576b20822 (patch)
treece3319cfb4aae72797bc0f3f247d79a41481e551
parentdfa842ce1de5b93bca2f336f3cf8c8769a555853 (diff)
downloadgitlab-ce-9a82aa70e3f3ff679c7a27ccbb9d497576b20822.tar.gz
Remove builds tab from commit
Remove unused file Fix commit link
-rw-r--r--app/assets/javascripts/dispatcher.js.es61
-rw-r--r--app/controllers/projects/commit_controller.rb31
-rw-r--r--app/controllers/projects/merge_requests_controller.rb11
-rw-r--r--app/helpers/ci_status_helper.rb2
-rw-r--r--app/views/projects/_last_commit.html.haml3
-rw-r--r--app/views/projects/builds/_header.html.haml2
-rw-r--r--app/views/projects/commit/_builds.html.haml2
-rw-r--r--app/views/projects/commit/_ci_menu.html.haml4
-rw-r--r--app/views/projects/commit/builds.html.haml9
-rw-r--r--app/views/projects/merge_requests/show/_builds.html.haml1
-rw-r--r--config/routes/project.rb1
11 files changed, 6 insertions, 61 deletions
diff --git a/app/assets/javascripts/dispatcher.js.es6 b/app/assets/javascripts/dispatcher.js.es6
index 752f35e6356..f45371f121e 100644
--- a/app/assets/javascripts/dispatcher.js.es6
+++ b/app/assets/javascripts/dispatcher.js.es6
@@ -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':
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 8197d9e4c99..3a5bf7d9ff5 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -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)
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 7b6cdba8dc8..3abebdfd032 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -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
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index d9f5e01f0dc..94e91031680 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -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
diff --git a/app/views/projects/_last_commit.html.haml b/app/views/projects/_last_commit.html.haml
index 7f530708947..e1fea8ccf3d 100644
--- a/app/views/projects/_last_commit.html.haml
+++ b/app/views/projects/_last_commit.html.haml
@@ -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)
diff --git a/app/views/projects/builds/_header.html.haml b/app/views/projects/builds/_header.html.haml
index 057a720a54a..b15be0d861d 100644
--- a/app/views/projects/builds/_header.html.haml
+++ b/app/views/projects/builds/_header.html.haml
@@ -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
diff --git a/app/views/projects/commit/_builds.html.haml b/app/views/projects/commit/_builds.html.haml
deleted file mode 100644
index b7087749428..00000000000
--- a/app/views/projects/commit/_builds.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-- @ci_pipelines.each do |pipeline|
- = render "pipeline", pipeline: pipeline, pipeline_details: true
diff --git a/app/views/projects/commit/_ci_menu.html.haml b/app/views/projects/commit/_ci_menu.html.haml
index cbfd99ca448..13ab2253733 100644
--- a/app/views/projects/commit/_ci_menu.html.haml
+++ b/app/views/projects/commit/_ci_menu.html.haml
@@ -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
diff --git a/app/views/projects/commit/builds.html.haml b/app/views/projects/commit/builds.html.haml
deleted file mode 100644
index 077b2d2725b..00000000000
--- a/app/views/projects/commit/builds.html.haml
+++ /dev/null
@@ -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"
diff --git a/app/views/projects/merge_requests/show/_builds.html.haml b/app/views/projects/merge_requests/show/_builds.html.haml
deleted file mode 100644
index 808ef7fed27..00000000000
--- a/app/views/projects/merge_requests/show/_builds.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "projects/commit/pipeline", pipeline: @pipeline, link_to_commit: true
diff --git a/config/routes/project.rb b/config/routes/project.rb
index ddc7e955a27..99b0afcada1 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -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