diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 3a5bf7d9ff5c6c9ba3380a18fb0d1b81dd1b8efb..791ed88db30faee34999024814cb12ab7c42103e 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -8,6 +8,7 @@ class Projects::CommitController < Projects::ApplicationController # Authorize before_action :require_non_empty_project + before_action :authorize_download_code! before_action :authorize_read_pipeline!, only: [:pipelines] before_action :commit before_action :define_commit_vars, only: [:show, :diff_for_path, :pipelines] @@ -107,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 end def assign_change_commit_vars(mr_source_branch) diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 94e91031680b0f08cffb6104cffbdd0f03cd77fb..94f3b48017814cf8d74ab363ed585d3d4ef7187e 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) + namespace_project_pipeline_path(project.namespace, project, pipeline) end # Is used by Commit and Merge Request Widget diff --git a/config/routes/project.rb b/config/routes/project.rb index 99b0afcada1bbd4720c41faaf37054d6eafd5112..2d261337594f1f968b35284da5c109d72250e7ba 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -33,8 +33,6 @@ constraints(ProjectUrlConstrainer.new) do member do get :branches get :pipelines - post :cancel_builds - post :retry_builds post :revert post :cherry_pick get :diff_for_path diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index 1776c07e60e1d32245bd9e9a7ea368a563a40cfc..3459cce03f9edb33046343e0dbee3645fd4e67f7 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -47,8 +47,6 @@ Feature: Project Commits And repository contains ".gitlab-ci.yml" file When I click on commit link Then I see commit ci info - And I click status link - Then I see builds list Scenario: I browse commit with side-by-side diff view Given I click on commit link diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 007dfb67a77641cede3fd6280cb58b9c7b0d4e36..18e267294e408939dd2f037520f67e3ad75c88b5 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -166,15 +166,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps expect(page).to have_content "Pipeline #1 for 570e7b2a pending" end - step 'I click status link' do - find('.commit-ci-menu').click_link "Builds" - end - - step 'I see builds list' do - expect(page).to have_content "Pipeline #1 for 570e7b2a pending" - expect(page).to have_content "1 build" - end - step 'I search "submodules" commits' do fill_in 'commits-search', with: 'submodules' end diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index fcdf7870f34f2ffd889a50e4406ecb9df44b5323..33f1c323af17e0ed6251d93675954e490aadb6ed 100644 --- a/spec/features/projects/commit/builds_spec.rb +++ b/spec/features/projects/commit/builds_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'project commit builds' do +feature 'project commit pipelines' do given(:project) { create(:project) } background do @@ -16,11 +16,13 @@ feature 'project commit builds' do ref: 'master') end - scenario 'user views commit builds page' do - visit builds_namespace_project_commit_path(project.namespace, - project, project.commit.sha) + scenario 'user views commit pipelines page' do + visit pipelines_namespace_project_commit_path(project.namespace, project, project.commit.sha) - expect(page).to have_content('Builds') + page.within('.table-holder') do + expect(page).to have_content project.pipelines[0].status # pipeline status + expect(page).to have_content project.pipelines[0].id # pipeline ids + end end end end