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
b8769936
Commit
b8769936
authored
May 19, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios
parent
86b22b4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
CHANGELOG
CHANGELOG
+1
-0
app/services/create_commit_builds_service.rb
app/services/create_commit_builds_service.rb
+7
-10
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+16
-0
No files found.
CHANGELOG
View file @
b8769936
...
...
@@ -8,6 +8,7 @@ v 8.8.0 (unreleased)
- Toggle sign-up confirmation emails in application settings
- Project#open_branches has been cleaned up and no longer loads entire records into memory.
- Escape HTML in commit titles in system note messages
- Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios
- Improve multiple branch push performance by memoizing permission checking
- Log to application.log when an admin starts and stops impersonating a user
- Changing the confidentiality of an issue now creates a new system note (Alex Moore-Niemi)
...
...
app/services/create_commit_builds_service.rb
View file @
b8769936
...
...
@@ -18,9 +18,7 @@ class CreateCommitBuildsService
return
false
end
commit
=
project
.
ci_commit
(
sha
,
ref
)
unless
commit
commit
=
project
.
ci_commits
.
new
(
sha:
sha
,
ref:
ref
,
before_sha:
before_sha
,
tag:
tag
)
commit
=
Ci
::
Commit
.
new
(
project:
project
,
sha:
sha
,
ref:
ref
,
before_sha:
before_sha
,
tag:
tag
)
# Skip creating ci_commit when no gitlab-ci.yml is found
unless
commit
.
ci_yaml_file
...
...
@@ -29,7 +27,6 @@ class CreateCommitBuildsService
# Create a new ci_commit
commit
.
save!
end
# Skip creating builds for commits that have [ci skip]
unless
commit
.
skip_ci?
...
...
spec/workers/post_receive_spec.rb
View file @
b8769936
...
...
@@ -48,6 +48,22 @@ describe PostReceive do
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
base64_changes
)
end
end
context
"gitlab-ci.yml"
do
subject
{
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
base64_changes
)
}
context
"creates a Ci::Commit for every change"
do
before
{
stub_ci_commit_to_return_yaml_file
}
it
{
expect
{
subject
}.
to
change
{
Ci
::
Commit
.
count
}.
by
(
2
)
}
end
context
"does not create a Ci::Commit"
do
before
{
stub_ci_commit_yaml_file
(
nil
)
}
it
{
expect
{
subject
}.
to_not
change
{
Ci
::
Commit
.
count
}
}
end
end
end
context
"webhook"
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