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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d5a2ffc8
Commit
d5a2ffc8
authored
Apr 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
91876d57
474f8dab
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
25 deletions
+78
-25
app/assets/stylesheets/framework/common.scss
app/assets/stylesheets/framework/common.scss
+6
-0
app/assets/stylesheets/pages/stat_graph.scss
app/assets/stylesheets/pages/stat_graph.scss
+0
-8
app/services/git/base_hooks_service.rb
app/services/git/base_hooks_service.rb
+2
-0
app/views/projects/graphs/show.html.haml
app/views/projects/graphs/show.html.haml
+2
-2
app/workers/post_receive.rb
app/workers/post_receive.rb
+15
-12
changelogs/unreleased/limit-amount-of-created-pipelines.yml
changelogs/unreleased/limit-amount-of-created-pipelines.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+9
-0
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+39
-3
No files found.
app/assets/stylesheets/framework/common.scss
View file @
d5a2ffc8
...
...
@@ -436,6 +436,12 @@ img.emoji {
.h-3
{
width
:
#{
3
*
$grid-size
}
;
}
.svg-w-100
{
svg
{
width
:
100%
;
}
}
/** COMMON SPACING CLASSES **/
.gl-pl-0
{
padding-left
:
0
;
}
.gl-pl-1
{
padding-left
:
#{
0
.5
*
$grid-size
}
;
}
...
...
app/assets/stylesheets/pages/stat_graph.scss
View file @
d5a2ffc8
...
...
@@ -18,10 +18,6 @@
@include
make-col-ready
();
@include
make-col
(
12
);
}
svg
{
width
:
100%
;
}
}
#contributors
{
...
...
@@ -31,10 +27,6 @@
margin
:
0
0
10px
;
list-style
:
none
;
padding
:
0
;
svg
{
width
:
100%
;
}
}
.person
{
...
...
app/services/git/base_hooks_service.rb
View file @
d5a2ffc8
...
...
@@ -51,6 +51,8 @@ module Git
end
def
create_pipelines
return
unless
params
.
fetch
(
:create_pipelines
,
true
)
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
push_data
)
.
execute
(
:push
,
pipeline_options
)
...
...
app/views/projects/graphs/show.html.haml
View file @
d5a2ffc8
...
...
@@ -22,6 +22,6 @@
=
s_
(
'ContributorsPage|Commits to %{branch_name}, excluding merge commits. Limited to 6,000 commits.'
)
%
{
branch_name:
@ref
}
%input
#brush_change
{
:type
=>
"hidden"
}
.graphs.row
#contributors-master
#contributors-master
.svg-w-100
#contributors
.clearfix
%ol
.contributors-list.row
%ol
.contributors-list.
svg-w-100.
row
app/workers/post_receive.rb
View file @
d5a2ffc8
...
...
@@ -3,6 +3,8 @@
class
PostReceive
include
ApplicationWorker
PIPELINE_PROCESS_LIMIT
=
4
def
perform
(
gl_repository
,
identifier
,
changes
,
push_options
=
{})
project
,
repo_type
=
Gitlab
::
GlRepository
.
parse
(
gl_repository
)
...
...
@@ -36,23 +38,24 @@ class PostReceive
return
false
end
post_received
.
changes_refs
do
|
oldrev
,
newrev
,
ref
|
if
Gitlab
::
Git
.
tag_ref?
(
ref
)
Git
::
TagPushService
.
new
(
post_received
.
project
,
@user
,
oldrev:
oldrev
,
newrev:
newrev
,
ref:
ref
,
push_options:
post_received
.
push_options
).
execute
elsif
Gitlab
::
Git
.
branch_ref?
(
ref
)
Git
::
BranchPushService
.
new
(
post_received
.
enum_for
(
:changes_refs
).
with_index
do
|
(
oldrev
,
newrev
,
ref
),
index
|
service_klass
=
if
Gitlab
::
Git
.
tag_ref?
(
ref
)
Git
::
TagPushService
elsif
Gitlab
::
Git
.
branch_ref?
(
ref
)
Git
::
BranchPushService
end
if
service_klass
service_klass
.
new
(
post_received
.
project
,
@user
,
oldrev:
oldrev
,
newrev:
newrev
,
ref:
ref
,
push_options:
post_received
.
push_options
).
execute
push_options:
post_received
.
push_options
,
create_pipelines:
index
<
PIPELINE_PROCESS_LIMIT
||
Feature
.
enabled?
(
:git_push_create_all_pipelines
,
post_received
.
project
)
).
execute
end
changes
<<
Gitlab
::
DataBuilder
::
Repository
.
single_change
(
oldrev
,
newrev
,
ref
)
...
...
changelogs/unreleased/limit-amount-of-created-pipelines.yml
0 → 100644
View file @
d5a2ffc8
---
title
:
Process at most 4 pipelines during push
merge_request
:
27205
author
:
type
:
performance
doc/ci/yaml/README.md
View file @
d5a2ffc8
...
...
@@ -2701,6 +2701,15 @@ Not to be confused with [`trigger`](#trigger-premium).
[
Read more in the triggers documentation.
](
../triggers/README.md
)
## Processing Git pushes
GitLab will create at most 4 branch and tags pipelines when
doing pushing multiple changes in single
`git push`
invocation.
This limitation does not affect any of the updated Merge Request pipelines,
all updated Merge Requests will have a pipeline created when using
[
pipelines for merge requests
](
../merge_request_pipelines/index.md
)
.
## Skipping jobs
If your commit message contains
`[ci skip]`
or
`[skip ci]`
, using any
...
...
spec/workers/post_receive_spec.rb
View file @
d5a2ffc8
...
...
@@ -99,11 +99,21 @@ describe PostReceive do
end
context
"gitlab-ci.yml"
do
let
(
:changes
)
{
"123456 789012 refs/heads/feature
\n
654321 210987 refs/tags/tag"
}
let
(
:changes
)
do
<<-
EOF
.
strip_heredoc
123456 789012 refs/heads/feature
654321 210987 refs/tags/tag
123456 789012 refs/heads/feature2
123458 789013 refs/heads/feature3
123459 789015 refs/heads/feature4
EOF
end
let
(
:changes_count
)
{
changes
.
lines
.
count
}
subject
{
described_class
.
new
.
perform
(
gl_repository
,
key_id
,
base64_changes
)
}
context
"
creates a Ci::Pipeline for every change
"
do
context
"
with valid .gitlab-ci.yml
"
do
before
do
stub_ci_pipeline_to_return_yaml_file
...
...
@@ -116,7 +126,33 @@ describe PostReceive do
.
and_return
(
true
)
end
it
{
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
2
)
}
context
'when git_push_create_all_pipelines is disabled'
do
before
do
stub_feature_flags
(
git_push_create_all_pipelines:
false
)
end
it
"creates pipeline for branches and tags"
do
subject
expect
(
Ci
::
Pipeline
.
pluck
(
:ref
)).
to
contain_exactly
(
"feature"
,
"tag"
,
"feature2"
,
"feature3"
)
end
it
"creates exactly
#{
described_class
::
PIPELINE_PROCESS_LIMIT
}
pipelines"
do
expect
(
changes_count
).
to
be
>
described_class
::
PIPELINE_PROCESS_LIMIT
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
described_class
::
PIPELINE_PROCESS_LIMIT
)
end
end
context
'when git_push_create_all_pipelines is enabled'
do
before
do
stub_feature_flags
(
git_push_create_all_pipelines:
true
)
end
it
"creates all pipelines"
do
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
changes_count
)
end
end
end
context
"does not create a Ci::Pipeline"
do
...
...
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