diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-24 10:36:02 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-24 10:36:02 +0000 |
commit | f2999fe8f3709775ea2151fa3dcd7c456267edb2 (patch) | |
tree | 23dd1fbf6c40f1074b31f1d799e4cfcf9c9d0935 | |
parent | fd39414408208f07b22a48006aa523c326332725 (diff) | |
parent | 2be714dcf61842e41d0432fae3abdf1a09215012 (diff) | |
download | gitlab-ce-f2999fe8f3709775ea2151fa3dcd7c456267edb2.tar.gz |
Merge branch 'build-status-on-commit-page' into 'master'
Build status on commit page
Screenshot:
![Screenshot_2015-09-24_11.29.54](https://gitlab.com/gitlab-org/gitlab-ce/uploads/49d1b9dc60d328dceaf771b5e44726ca/Screenshot_2015-09-24_11.29.54.png)
Part of #2594
See merge request !1418
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/ci/projects.scss | 34 | ||||
-rw-r--r-- | app/assets/stylesheets/ci/status.scss | 37 | ||||
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 2 | ||||
-rw-r--r-- | app/views/projects/commit/_commit_box.html.haml | 7 | ||||
-rw-r--r-- | features/project/commits/commits.feature | 5 | ||||
-rw-r--r-- | features/steps/project/commits/commits.rb | 9 |
7 files changed, 61 insertions, 34 deletions
diff --git a/CHANGELOG b/CHANGELOG index b1e61ddf8e7..4a34a3835a7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ v 8.1.0 (unreleased) - Move CI charts to project graphs area - Fix cases where Markdown did not render links in activity feed (Stan Hu) - Add first and last to pagination (Zeger-Jan van de Weg) + - Show CI status on commit page v 8.0.2 (unreleased) - Skip check_initd_configured_correctly on omnibus installs diff --git a/app/assets/stylesheets/ci/projects.scss b/app/assets/stylesheets/ci/projects.scss index c63a67ab720..8c5273abcda 100644 --- a/app/assets/stylesheets/ci/projects.scss +++ b/app/assets/stylesheets/ci/projects.scss @@ -56,38 +56,4 @@ margin-bottom: 16px; } } - - .ci-status { - padding: 2px 7px; - margin-right: 5px; - border: 1px solid #EEE; - white-space: nowrap; - @include border-radius(4px); - - &.ci-failed { - color: $gl-danger; - border-color: $gl-danger; - } - - &.ci-success { - color: $gl-success; - border-color: $gl-success; - } - - &.ci-info { - color: $gl-info; - border-color: $gl-info; - } - - &.ci-disabled { - color: $gl-gray; - border-color: $gl-gray; - } - - &.ci-pending, - &.ci-running { - color: $gl-warning; - border-color: $gl-warning; - } - } } diff --git a/app/assets/stylesheets/ci/status.scss b/app/assets/stylesheets/ci/status.scss new file mode 100644 index 00000000000..a7d3b2197f1 --- /dev/null +++ b/app/assets/stylesheets/ci/status.scss @@ -0,0 +1,37 @@ +.ci-status { + padding: 2px 7px; + margin-right: 5px; + border: 1px solid #EEE; + white-space: nowrap; + @include border-radius(4px); + + &:hover { + text-decoration: none; + } + + &.ci-failed { + color: $gl-danger; + border-color: $gl-danger; + } + + &.ci-success { + color: $gl-success; + border-color: $gl-success; + } + + &.ci-info { + color: $gl-info; + border-color: $gl-info; + } + + &.ci-disabled { + color: $gl-gray; + border-color: $gl-gray; + } + + &.ci-pending, + &.ci-running { + color: $gl-warning; + border-color: $gl-warning; + } +} diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 78d42d695b6..2fae5057138 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -22,6 +22,8 @@ class Projects::CommitController < Projects::ApplicationController commit_id: @commit.id } + @ci_commit = project.ci_commit(commit.sha) + respond_to do |format| format.html format.diff { render text: @commit.to_diff } diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 2ac79e87b4a..fbf0a9ec0c3 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -38,6 +38,13 @@ - @commit.parents.each do |parent| = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent) +- if @ci_commit + .pull-right + = link_to ci_status_path(@ci_commit), class: "ci-status ci-#{@ci_commit.status}" do + = ci_status_icon(@ci_commit) + build: + = @ci_commit.status + .commit-info-row.branches %i.fa.fa-spinner.fa-spin diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature index 3ebc8a39aae..34161b81d44 100644 --- a/features/project/commits/commits.feature +++ b/features/project/commits/commits.feature @@ -16,6 +16,11 @@ Feature: Project Commits Then I see commit info And I see side-by-side diff button + Scenario: I browse commit with ci from list + Given commit has ci status + And I click on commit link + Then I see commit ci info + Scenario: I browse commit with side-by-side diff view Given I click on commit link And I click side-by-side diff button diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 23e67371f96..56f1f06fb06 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -101,4 +101,13 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I click side-by-side diff button' do find('#parallel-diff-btn').click end + + step 'commit has ci status' do + @project.enable_ci(@user) + create :ci_commit, project: @project.gitlab_ci_project, sha: sample_commit.id + end + + step 'I see commit ci info' do + expect(page).to have_content "build: skipped" + end end |