Skip to content
Snippets Groups Projects
Commit 9a82702a authored by Douwe Maan's avatar Douwe Maan
Browse files

Move commit/:sha/ci to commit/:sha/builds.

parent 49be57ae
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,8 +6,8 @@ class Projects::CommitController < Projects::ApplicationController
before_action :require_non_empty_project
before_action :authorize_download_code!
before_action :commit
before_action :define_show_vars, only: [:show, :ci]
before_action :authorize_manage_builds!, only: [:cancel_builds, :retry_builds]
before_action :define_show_vars, only: [:show, :builds]
 
def show
return git_not_found! unless @commit
Loading
Loading
@@ -29,7 +29,7 @@ class Projects::CommitController < Projects::ApplicationController
end
end
 
def ci
def builds
@ci_project = @project.gitlab_ci_project
end
 
Loading
Loading
@@ -37,7 +37,7 @@ class Projects::CommitController < Projects::ApplicationController
@ci_commit = @project.ci_commit(@commit.sha)
@ci_commit.builds.running_or_pending.each(&:cancel)
 
redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha)
redirect_to builds_namespace_project_commit_path(project.namespace, project, commit.sha)
end
 
def retry_builds
Loading
Loading
@@ -48,7 +48,7 @@ class Projects::CommitController < Projects::ApplicationController
end
end
 
redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha)
redirect_to builds_namespace_project_commit_path(project.namespace, project, commit.sha)
end
 
def branches
Loading
Loading
module CiStatusHelper
def ci_status_path(ci_commit)
project = ci_commit.gl_project
ci_namespace_project_commit_path(project.namespace, project, ci_commit.sha)
builds_namespace_project_commit_path(project.namespace, project, ci_commit.sha)
end
 
def ci_status_icon(ci_commit)
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
= link_to namespace_project_commit_path(@project.namespace, @project, @commit.id) do
Changes
%span.badge= @diffs.count
= nav_link(path: 'commit#ci') do
= link_to ci_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
= nav_link(path: 'commit#builds') do
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
Builds
%span.badge= @builds.count
Loading
Loading
@@ -27,10 +27,10 @@
 
- if @ci_project && current_user && can?(current_user, :manage_builds, @project)
- if @ci_commit.builds.latest.failed.any?(&:retryable?)
= link_to "Retry failed", retry_ci_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-primary', method: :post
= link_to "Retry failed", retry_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-primary', method: :post
 
- if @ci_commit.builds.running_or_pending.any?
= link_to "Cancel running", cancel_ci_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-danger', method: :post
= link_to "Cancel running", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-danger', method: :post
 
%table.table.builds
%thead
Loading
Loading
Loading
Loading
@@ -473,7 +473,7 @@ Gitlab::Application.routes.draw do
resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
member do
get :branches
get :ci
get :builds
post :cancel_builds
post :retry_builds
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment