From adcab296fd48074daf9cac903d90270391f3e9d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 15 Jan 2016 10:33:42 +0100 Subject: Expose link to CI Lint Tool on builds page --- app/views/projects/builds/index.html.haml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 5d18c0d803a..36b308b7b8f 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -6,7 +6,19 @@ - if can?(current_user, :manage_builds, @project) .pull-left.hidden-xs - if @all_builds.running_or_pending.any? - = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post + = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), + data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post + + .pull-left.hidden-xs.hidden-sm{ style: 'margin-left: 7px;' } + .dropdown + %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } + Tools + %span.caret + %ul.dropdown-menu.dropdown-menu-right + %li + = link_to ci_lint_path do + = icon('wrench') + %span CI Lint Tool %ul.nav-links %li{class: ('active' if @scope.nil?)} -- cgit v1.2.1 From 59ffe978fd5e89b55c737a030314a0bc3fdb85bd Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 17 Jan 2016 16:33:53 +0100 Subject: Reuse existing CSS classes when exposing CI Lint tool --- app/views/projects/builds/index.html.haml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 36b308b7b8f..747d94cc9e6 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -9,16 +9,15 @@ = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post - .pull-left.hidden-xs.hidden-sm{ style: 'margin-left: 7px;' } - .dropdown - %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } - Tools - %span.caret - %ul.dropdown-menu.dropdown-menu-right - %li - = link_to ci_lint_path do - = icon('wrench') - %span CI Lint Tool + .dropdown.inline + %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } + Tools + %span.caret + %ul.dropdown-menu.dropdown-menu-right + %li + = link_to ci_lint_path do + = icon('wrench') + %span CI Lint Tool %ul.nav-links %li{class: ('active' if @scope.nil?)} -- cgit v1.2.1 From d9629a0cf03b80c8074b2ffa003d541193ca7097 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 17 Jan 2016 16:57:42 +0100 Subject: Add specs for CI Lint button exposed on a builds page --- features/project/builds/summary.feature | 10 +++++++--- features/steps/project/builds/summary.rb | 9 ++++++++- features/steps/shared/builds.rb | 6 +++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/features/project/builds/summary.feature b/features/project/builds/summary.feature index e90ea592aab..9f006fcaca8 100644 --- a/features/project/builds/summary.feature +++ b/features/project/builds/summary.feature @@ -5,7 +5,11 @@ Feature: Project Builds Summary And project has CI enabled And project has a recent build - Scenario: I browse build summary page - When I visit recent build summary page - Then I see summary for build + Scenario: I browse build details page + When I visit recent build details page + Then I see details of a build And I see build trace + + Scenario: I browse project builds page + When I visit project builds page + Then I see button to CI Lint Tool diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 2439d48fbef..67986b958ec 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -4,11 +4,18 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps include SharedBuilds include RepoHelpers - step 'I see summary for build' do + step 'I see details of a build' do expect(page).to have_content "Build ##{@build.id}" end step 'I see build trace' do expect(page).to have_css '#build-trace' end + + step 'I see button to CI Lint Tool' do + page.within('.controls') do + ci_lint_tool_link = page.find_link('CI Lint Tool') + expect(ci_lint_tool_link[:href]).to eq ci_lint_path + end + end end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index f88b01af84e..92bf362879b 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -10,10 +10,14 @@ module SharedBuilds @build = create :ci_build, commit: ci_commit end - step 'I visit recent build summary page' do + step 'I visit recent build details page' do visit namespace_project_build_path(@project.namespace, @project, @build) end + step 'I visit project builds page' do + visit namespace_project_builds_path(@project.namespace, @project) + end + step 'recent build has artifacts available' do artifacts = Rails.root + 'spec/fixtures/ci_build_artifacts.zip' archive = fixture_file_upload(artifacts, 'application/zip') -- cgit v1.2.1 From 968998a9d18cd6e108abafc6ba4606ce7249fd0a Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 17 Jan 2016 17:04:00 +0100 Subject: Add Changelog entry for exposing CI Lint tool on builds page --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index a15bbfbc49e..102382b02f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -58,6 +58,7 @@ v 8.4.0 (unreleased) - Import GitHub wiki into GitLab - Add reporters ability to download and browse build artifacts (Andrew Johnson) - Autofill referring url in message box when reporting user abuse. (Josh Frye) + - Expose button to CI Lint tool on project builds page v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) -- cgit v1.2.1 From 7506afe14bad7bb4f93e26a539b3ffe75303e180 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 17 Jan 2016 18:13:45 +0100 Subject: Update build artifacts feature tests --- features/project/builds/artifacts.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/project/builds/artifacts.feature b/features/project/builds/artifacts.feature index 7a7dbb71b18..d17c8aa89e6 100644 --- a/features/project/builds/artifacts.feature +++ b/features/project/builds/artifacts.feature @@ -7,21 +7,21 @@ Feature: Project Builds Artifacts Scenario: I download build artifacts Given recent build has artifacts available - When I visit recent build summary page + When I visit recent build details page And I click artifacts download button Then download of build artifacts archive starts Scenario: I browse build artifacts Given recent build has artifacts available And recent build has artifacts metadata available - When I visit recent build summary page + When I visit recent build details page And I click artifacts browse button Then I should see content of artifacts archive Scenario: I browse subdirectory of build artifacts Given recent build has artifacts available And recent build has artifacts metadata available - When I visit recent build summary page + When I visit recent build details page And I click artifacts browse button And I click link to subdirectory within build artifacts Then I should see content of subdirectory within artifacts archive @@ -30,7 +30,7 @@ Feature: Project Builds Artifacts Given recent build has artifacts available And recent build has artifacts metadata available And recent build artifacts contain directory with UTF-8 characters - When I visit recent build summary page + When I visit recent build details page And I click artifacts browse button And I navigate to directory with UTF-8 characters in name Then I should see content of directory with UTF-8 characters in name @@ -39,7 +39,7 @@ Feature: Project Builds Artifacts Given recent build has artifacts available And recent build has artifacts metadata available And recent build artifacts contain directory with invalid UTF-8 characters - When I visit recent build summary page + When I visit recent build details page And I click artifacts browse button And I navigate to parent directory of directory with invalid name Then I should not see directory with invalid name on the list @@ -47,7 +47,7 @@ Feature: Project Builds Artifacts Scenario: I download a single file from build artifacts Given recent build has artifacts available And recent build has artifacts metadata available - When I visit recent build summary page + When I visit recent build details page And I click artifacts browse button And I click download button for a file within build artifacts Then download of a file extracted from build artifacts should start -- cgit v1.2.1 From 6fe33804dc080522242d9ea3639548c2b246a56b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 08:12:31 +0100 Subject: Remove dropdown containing CI Lint button on builds page Link to CI Lint on builds page will be a separate button from now on. --- app/views/projects/builds/index.html.haml | 12 +++--------- features/project/builds/summary.feature | 2 +- features/steps/project/builds/summary.rb | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 747d94cc9e6..bbb6944a65a 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -9,15 +9,9 @@ = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post - .dropdown.inline - %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } - Tools - %span.caret - %ul.dropdown-menu.dropdown-menu-right - %li - = link_to ci_lint_path do - = icon('wrench') - %span CI Lint Tool + = link_to ci_lint_path, class: 'btn btn-default' do + = icon('wrench') + %span CI Lint %ul.nav-links %li{class: ('active' if @scope.nil?)} diff --git a/features/project/builds/summary.feature b/features/project/builds/summary.feature index 9f006fcaca8..b69d279517b 100644 --- a/features/project/builds/summary.feature +++ b/features/project/builds/summary.feature @@ -12,4 +12,4 @@ Feature: Project Builds Summary Scenario: I browse project builds page When I visit project builds page - Then I see button to CI Lint Tool + Then I see button to CI Lint diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 67986b958ec..036bc0a499e 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -12,9 +12,9 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps expect(page).to have_css '#build-trace' end - step 'I see button to CI Lint Tool' do + step 'I see button to CI Lint' do page.within('.controls') do - ci_lint_tool_link = page.find_link('CI Lint Tool') + ci_lint_tool_link = page.find_link('CI Lint') expect(ci_lint_tool_link[:href]).to eq ci_lint_path end end -- cgit v1.2.1