提交 f2999fe8 编写于 作者: D Dmitriy Zaporozhets

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
......@@ -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
......
......@@ -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;
}
}
}
.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;
}
}
......@@ -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 }
......
......@@ -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
......
......@@ -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
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册