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
Jérome Perrin
gitlab-ce
Commits
26e73c2e
Commit
26e73c2e
authored
Sep 27, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some minor improvements to pipeline creation chain
parent
057a8b70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
14 deletions
+5
-14
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+3
-9
lib/gitlab/ci/pipeline/chain/sequence.rb
lib/gitlab/ci/pipeline/chain/sequence.rb
+2
-3
lib/gitlab/ci/pipeline/chain/validate/repository.rb
lib/gitlab/ci/pipeline/chain/validate/repository.rb
+0
-2
No files found.
app/services/ci/create_pipeline_service.rb
View file @
26e73c2e
...
@@ -15,7 +15,7 @@ module Ci
...
@@ -15,7 +15,7 @@ module Ci
ref:
ref
,
ref:
ref
,
sha:
sha
,
sha:
sha
,
before_sha:
before_sha
,
before_sha:
before_sha
,
tag:
tag?
,
tag:
tag
_exists
?
,
trigger_requests:
Array
(
trigger_request
),
trigger_requests:
Array
(
trigger_request
),
user:
current_user
,
user:
current_user
,
pipeline_schedule:
schedule
,
pipeline_schedule:
schedule
,
...
@@ -88,20 +88,14 @@ module Ci
...
@@ -88,20 +88,14 @@ module Ci
params
[
:ref
]
params
[
:ref
]
end
end
def
tag?
def
tag_exists?
return
@is_tag
if
defined?
(
@is_tag
)
project
.
repository
.
tag_exists?
(
ref
)
@is_tag
=
project
.
repository
.
tag_exists?
(
ref
)
end
end
def
ref
def
ref
@ref
||=
Gitlab
::
Git
.
ref_name
(
origin_ref
)
@ref
||=
Gitlab
::
Git
.
ref_name
(
origin_ref
)
end
end
def
valid_sha?
origin_sha
&&
origin_sha
!=
Gitlab
::
Git
::
BLANK_SHA
end
def
pipeline_created_counter
def
pipeline_created_counter
@pipeline_created_counter
||=
Gitlab
::
Metrics
@pipeline_created_counter
||=
Gitlab
::
Metrics
.
counter
(
:pipelines_created_total
,
"Counter of pipelines created"
)
.
counter
(
:pipelines_created_total
,
"Counter of pipelines created"
)
...
...
lib/gitlab/ci/pipeline/chain/sequence.rb
View file @
26e73c2e
...
@@ -18,7 +18,7 @@ module Gitlab
...
@@ -18,7 +18,7 @@ module Gitlab
break
if
step
.
break?
break
if
step
.
break?
@completed
<<
true
@completed
<<
step
end
end
@pipeline
.
tap
do
@pipeline
.
tap
do
...
@@ -27,8 +27,7 @@ module Gitlab
...
@@ -27,8 +27,7 @@ module Gitlab
end
end
def
complete?
def
complete?
@completed
.
size
==
@sequence
.
size
&&
@completed
.
size
==
@sequence
.
size
@completed
.
all?
end
end
end
end
end
end
...
...
lib/gitlab/ci/pipeline/chain/validate/repository.rb
View file @
26e73c2e
...
@@ -14,8 +14,6 @@ module Gitlab
...
@@ -14,8 +14,6 @@ module Gitlab
## TODO, we check commit in the service, that is why
## TODO, we check commit in the service, that is why
# there is no repository access here.
# there is no repository access here.
#
#
# Should we validate repository before building a pipeline?
#
unless
pipeline
.
sha
unless
pipeline
.
sha
return
error
(
'Commit not found'
)
return
error
(
'Commit not found'
)
end
end
...
...
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