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
Léo-Paul Géneau
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
ref:
ref
,
sha:
sha
,
before_sha:
before_sha
,
tag:
tag?
,
tag:
tag
_exists
?
,
trigger_requests:
Array
(
trigger_request
),
user:
current_user
,
pipeline_schedule:
schedule
,
...
...
@@ -88,20 +88,14 @@ module Ci
params
[
:ref
]
end
def
tag?
return
@is_tag
if
defined?
(
@is_tag
)
@is_tag
=
project
.
repository
.
tag_exists?
(
ref
)
def
tag_exists?
project
.
repository
.
tag_exists?
(
ref
)
end
def
ref
@ref
||=
Gitlab
::
Git
.
ref_name
(
origin_ref
)
end
def
valid_sha?
origin_sha
&&
origin_sha
!=
Gitlab
::
Git
::
BLANK_SHA
end
def
pipeline_created_counter
@pipeline_created_counter
||=
Gitlab
::
Metrics
.
counter
(
:pipelines_created_total
,
"Counter of pipelines created"
)
...
...
lib/gitlab/ci/pipeline/chain/sequence.rb
View file @
26e73c2e
...
...
@@ -18,7 +18,7 @@ module Gitlab
break
if
step
.
break?
@completed
<<
true
@completed
<<
step
end
@pipeline
.
tap
do
...
...
@@ -27,8 +27,7 @@ module Gitlab
end
def
complete?
@completed
.
size
==
@sequence
.
size
&&
@completed
.
all?
@completed
.
size
==
@sequence
.
size
end
end
end
...
...
lib/gitlab/ci/pipeline/chain/validate/repository.rb
View file @
26e73c2e
...
...
@@ -14,8 +14,6 @@ module Gitlab
## TODO, we check commit in the service, that is why
# there is no repository access here.
#
# Should we validate repository before building a pipeline?
#
unless
pipeline
.
sha
return
error
(
'Commit not found'
)
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