Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
92984783
Commit
92984783
authored
Jun 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename commit_data in Pipeline to commit
parent
d9a64e9f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
15 deletions
+9
-15
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+4
-4
app/models/commit_status.rb
app/models/commit_status.rb
+2
-8
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+2
-2
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
92984783
...
@@ -54,6 +54,6 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -54,6 +54,6 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
def
commit
def
commit
@commit
||=
@pipeline
.
commit
_data
@commit
||=
@pipeline
.
commit
end
end
end
end
app/models/ci/pipeline.rb
View file @
92984783
...
@@ -37,22 +37,22 @@ module Ci
...
@@ -37,22 +37,22 @@ module Ci
end
end
def
git_author_name
def
git_author_name
commit
_data
.
author_name
if
commit_data
commit
.
try
(
:author_name
)
end
end
def
git_author_email
def
git_author_email
commit
_data
.
author_email
if
commit_data
commit
.
try
(
:author_email
)
end
end
def
git_commit_message
def
git_commit_message
commit
_data
.
message
if
commit_data
commit
.
try
(
:message
)
end
end
def
short_sha
def
short_sha
Ci
::
Pipeline
.
truncate_sha
(
sha
)
Ci
::
Pipeline
.
truncate_sha
(
sha
)
end
end
def
commit
_data
def
commit
@commit
||=
project
.
commit
(
sha
)
@commit
||=
project
.
commit
(
sha
)
rescue
rescue
nil
nil
...
...
app/models/commit_status.rb
View file @
92984783
...
@@ -8,6 +8,8 @@ class CommitStatus < ActiveRecord::Base
...
@@ -8,6 +8,8 @@ class CommitStatus < ActiveRecord::Base
belongs_to
:pipeline
,
class_name:
'Ci::Pipeline'
,
foreign_key: :commit_id
,
touch:
true
belongs_to
:pipeline
,
class_name:
'Ci::Pipeline'
,
foreign_key: :commit_id
,
touch:
true
belongs_to
:user
belongs_to
:user
delegate
:commit
,
to: :pipeline
validates
:pipeline
,
presence:
true
,
unless: :importing?
validates
:pipeline
,
presence:
true
,
unless: :importing?
validates_presence_of
:name
validates_presence_of
:name
...
@@ -90,12 +92,4 @@ class CommitStatus < ActiveRecord::Base
...
@@ -90,12 +92,4 @@ class CommitStatus < ActiveRecord::Base
def
stuck?
def
stuck?
false
false
end
end
##
# Deprecated, this should be removed in 9.0 in favor of exposing
# entire pipeline in API.
#
def
commit
pipeline
.
try
(
:commit_data
)
end
end
end
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
92984783
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
%span
.label.label-warning
stuck
%span
.label.label-warning
stuck
%p
.commit-title
%p
.commit-title
-
if
commit
_data
=
pipeline
.
commit_data
-
if
commit
=
pipeline
.
commit
=
link_to_gfm
truncate
(
commit
_data
.
title
,
length:
60
),
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commit_data
.
id
),
class:
"commit-row-message"
=
link_to_gfm
truncate
(
commit
.
title
,
length:
60
),
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
"commit-row-message"
-
else
-
else
Cant find HEAD commit for this branch
Cant find HEAD commit for this branch
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment