BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d5264e88
Commit
d5264e88
authored
Aug 12, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the name for data builder, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13671791
parent
0a20897b
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
85 additions
and
63 deletions
+85
-63
build.rb
app/models/ci/build.rb
+1
-1
pipeline.rb
app/models/ci/pipeline.rb
+1
-1
builds_email_service.rb
app/models/project_services/builds_email_service.rb
+1
-2
service.rb
app/models/service.rb
+1
-1
delete_branch_service.rb
app/services/delete_branch_service.rb
+7
-2
delete_tag_service.rb
app/services/delete_tag_service.rb
+7
-2
git_push_service.rb
app/services/git_push_service.rb
+14
-4
git_tag_push_service.rb
app/services/git_tag_push_service.rb
+16
-4
post_process_service.rb
app/services/notes/post_process_service.rb
+1
-1
test_hook_service.rb
app/services/test_hook_service.rb
+1
-2
build.rb
lib/gitlab/data_builder/build.rb
+1
-1
note.rb
lib/gitlab/data_builder/note.rb
+1
-1
pipeline.rb
lib/gitlab/data_builder/pipeline.rb
+1
-1
push.rb
lib/gitlab/data_builder/push.rb
+1
-1
build_spec.rb
spec/lib/gitlab/data_builder/build_spec.rb
+1
-1
note_spec.rb
spec/lib/gitlab/data_builder/note_spec.rb
+1
-1
pipeline_spec.rb
spec/lib/gitlab/data_builder/pipeline_spec.rb
+1
-1
push_spec.rb
spec/lib/gitlab/data_builder/push_spec.rb
+1
-1
assembla_service_spec.rb
spec/models/project_services/assembla_service_spec.rb
+1
-2
builds_email_service_spec.rb
spec/models/project_services/builds_email_service_spec.rb
+3
-3
campfire_service_spec.rb
spec/models/project_services/campfire_service_spec.rb
+1
-1
drone_ci_service_spec.rb
spec/models/project_services/drone_ci_service_spec.rb
+1
-1
flowdock_service_spec.rb
spec/models/project_services/flowdock_service_spec.rb
+1
-2
gemnasium_service_spec.rb
spec/models/project_services/gemnasium_service_spec.rb
+1
-2
hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+7
-7
irker_service_spec.rb
spec/models/project_services/irker_service_spec.rb
+1
-1
jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+1
-2
pushover_service_spec.rb
spec/models/project_services/pushover_service_spec.rb
+1
-1
slack_service_spec.rb
spec/models/project_services/slack_service_spec.rb
+6
-8
user_spec.rb
spec/models/user_spec.rb
+1
-1
build_email_worker_spec.rb
spec/workers/build_email_worker_spec.rb
+1
-1
emails_on_push_worker_spec.rb
spec/workers/emails_on_push_worker_spec.rb
+1
-3
No files found.
app/models/ci/build.rb
View file @
d5264e88
...
...
@@ -343,7 +343,7 @@ module Ci
def
execute_hooks
return
unless
project
build_data
=
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
self
)
build_data
=
Gitlab
::
DataBuilder
::
Build
.
build
(
self
)
project
.
execute_hooks
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:build_hooks
)
project
.
running_or_pending_build_count
(
force:
true
)
...
...
app/models/ci/pipeline.rb
View file @
d5264e88
...
...
@@ -222,7 +222,7 @@ module Ci
end
def
pipeline_data
Gitlab
::
DataBuilder
::
Pipeline
DataBuilder
.
build
(
self
)
Gitlab
::
DataBuilder
::
Pipeline
.
build
(
self
)
end
def
keep_around_commits
...
...
app/models/project_services/builds_email_service.rb
View file @
d5264e88
...
...
@@ -51,8 +51,7 @@ class BuildsEmailService < Service
end
def
test_data
(
project
=
nil
,
user
=
nil
)
build
=
project
.
builds
.
last
Gitlab
::
DataBuilder
::
BuildDataBuilder
.
build
(
build
)
Gitlab
::
DataBuilder
::
Build
.
build
(
project
.
builds
.
last
)
end
def
fields
...
...
app/models/service.rb
View file @
d5264e88
...
...
@@ -80,7 +80,7 @@ class Service < ActiveRecord::Base
end
def
test_data
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
def
event_channel_names
...
...
app/services/delete_branch_service.rb
View file @
d5264e88
...
...
@@ -39,7 +39,12 @@ class DeleteBranchService < BaseService
end
def
build_push_data
(
branch
)
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
project
,
current_user
,
branch
.
target
.
sha
,
Gitlab
::
Git
::
BLANK_SHA
,
"
#{
Gitlab
::
Git
::
BRANCH_REF_PREFIX
}#{
branch
.
name
}
"
,
[])
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
current_user
,
branch
.
target
.
sha
,
Gitlab
::
Git
::
BLANK_SHA
,
"
#{
Gitlab
::
Git
::
BRANCH_REF_PREFIX
}#{
branch
.
name
}
"
,
[])
end
end
app/services/delete_tag_service.rb
View file @
d5264e88
...
...
@@ -33,7 +33,12 @@ class DeleteTagService < BaseService
end
def
build_push_data
(
tag
)
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
project
,
current_user
,
tag
.
target
.
sha
,
Gitlab
::
Git
::
BLANK_SHA
,
"
#{
Gitlab
::
Git
::
TAG_REF_PREFIX
}#{
tag
.
name
}
"
,
[])
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
current_user
,
tag
.
target
.
sha
,
Gitlab
::
Git
::
BLANK_SHA
,
"
#{
Gitlab
::
Git
::
TAG_REF_PREFIX
}#{
tag
.
name
}
"
,
[])
end
end
app/services/git_push_service.rb
View file @
d5264e88
...
...
@@ -138,13 +138,23 @@ class GitPushService < BaseService
end
def
build_push_data
@push_data
||=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
@project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
push_commits
)
@push_data
||=
Gitlab
::
DataBuilder
::
Push
.
build
(
@project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
push_commits
)
end
def
build_push_data_system_hook
@push_data_system
||=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
@project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
[])
@push_data_system
||=
Gitlab
::
DataBuilder
::
Push
.
build
(
@project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
[])
end
def
push_to_existing_branch?
...
...
app/services/git_tag_push_service.rb
View file @
d5264e88
...
...
@@ -34,12 +34,24 @@ class GitTagPushService < BaseService
end
end
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
commits
,
message
)
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
commits
,
message
)
end
def
build_system_push_data
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build
(
project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
[],
''
)
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
[],
''
)
end
end
app/services/notes/post_process_service.rb
View file @
d5264e88
...
...
@@ -16,7 +16,7 @@ module Notes
end
def
hook_data
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
@note
,
@note
.
author
)
Gitlab
::
DataBuilder
::
Note
.
build
(
@note
,
@note
.
author
)
end
def
execute_note_hooks
...
...
app/services/test_hook_service.rb
View file @
d5264e88
class
TestHookService
def
execute
(
hook
,
current_user
)
data
=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
hook
.
project
,
current_user
)
data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
hook
.
project
,
current_user
)
hook
.
execute
(
data
,
'push_hooks'
)
end
end
lib/gitlab/data_builder/build
_data_builder
.rb
→
lib/gitlab/data_builder/build.rb
View file @
d5264e88
module
Gitlab
module
DataBuilder
module
Build
DataBuilder
module
Build
extend
self
def
build
(
build
)
...
...
lib/gitlab/data_builder/note
_data_builder
.rb
→
lib/gitlab/data_builder/note.rb
View file @
d5264e88
module
Gitlab
module
DataBuilder
module
Note
DataBuilder
module
Note
extend
self
# Produce a hash of post-receive data
...
...
lib/gitlab/data_builder/pipeline
_data_builder
.rb
→
lib/gitlab/data_builder/pipeline.rb
View file @
d5264e88
module
Gitlab
module
DataBuilder
module
Pipeline
DataBuilder
module
Pipeline
extend
self
def
build
(
pipeline
)
...
...
lib/gitlab/data_builder/push
_data_builder
.rb
→
lib/gitlab/data_builder/push.rb
View file @
d5264e88
module
Gitlab
module
DataBuilder
module
Push
DataBuilder
module
Push
extend
self
# Produce a hash of post-receive data
...
...
spec/lib/gitlab/data_builder/build_
data_builder_
spec.rb
→
spec/lib/gitlab/data_builder/build_spec.rb
View file @
d5264e88
require
'spec_helper'
describe
Gitlab
::
DataBuilder
::
Build
DataBuilder
do
describe
Gitlab
::
DataBuilder
::
Build
do
let
(
:build
)
{
create
(
:ci_build
)
}
describe
'.build'
do
...
...
spec/lib/gitlab/data_builder/note_
data_builder_
spec.rb
→
spec/lib/gitlab/data_builder/note_spec.rb
View file @
d5264e88
require
'spec_helper'
describe
Gitlab
::
DataBuilder
::
Note
DataBuilder
,
lib:
true
do
describe
Gitlab
::
DataBuilder
::
Note
,
lib:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:data
)
{
described_class
.
build
(
note
,
user
)
}
...
...
spec/lib/gitlab/data_builder/pipeline_
data_builder_
spec.rb
→
spec/lib/gitlab/data_builder/pipeline_spec.rb
View file @
d5264e88
require
'spec_helper'
describe
Gitlab
::
DataBuilder
::
Pipeline
DataBuilder
do
describe
Gitlab
::
DataBuilder
::
Pipeline
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/lib/gitlab/data_builder/push_
data_builder_
spec.rb
→
spec/lib/gitlab/data_builder/push_spec.rb
View file @
d5264e88
require
'spec_helper'
describe
Gitlab
::
DataBuilder
::
Push
DataBuilder
,
lib:
true
do
describe
Gitlab
::
DataBuilder
::
Push
,
lib:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
spec/models/project_services/assembla_service_spec.rb
View file @
d5264e88
...
...
@@ -39,8 +39,7 @@ describe AssemblaService, models: true do
token:
'verySecret'
,
subdomain:
'project_name'
)
@sample_data
=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
project
,
user
)
@sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
@api_url
=
'https://atlas.assembla.com/spaces/project_name/github_tool?secret_key=verySecret'
WebMock
.
stub_request
(
:post
,
@api_url
)
end
...
...
spec/models/project_services/builds_email_service_spec.rb
View file @
d5264e88
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
BuildsEmailService
do
let
(
:data
)
do
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
create
(
:ci_build
))
Gitlab
::
DataBuilder
::
Build
.
build
(
create
(
:ci_build
))
end
describe
'Validations'
do
...
...
@@ -41,7 +41,7 @@ describe BuildsEmailService do
describe
'#test'
do
it
'sends email'
do
data
=
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
create
(
:ci_build
))
data
=
Gitlab
::
DataBuilder
::
Build
.
build
(
create
(
:ci_build
))
subject
.
recipients
=
'test@gitlab.com'
expect
(
BuildEmailWorker
).
to
receive
(
:perform_async
)
...
...
@@ -51,7 +51,7 @@ describe BuildsEmailService do
context
'notify only failed builds is true'
do
it
'sends email'
do
data
=
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
create
(
:ci_build
))
data
=
Gitlab
::
DataBuilder
::
Build
.
build
(
create
(
:ci_build
))
data
[
:build_status
]
=
"success"
subject
.
recipients
=
'test@gitlab.com'
...
...
spec/models/project_services/campfire_service_spec.rb
View file @
d5264e88
...
...
@@ -54,7 +54,7 @@ describe CampfireService, models: true do
subdomain:
'project-name'
,
room:
'test-room'
)
@sample_data
=
Gitlab
::
PushDataBuilder
.
build_sample
(
project
,
user
)
@sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
@rooms_url
=
'https://verySecret:X@project-name.campfirenow.com/rooms.json'
@headers
=
{
'Content-Type'
=>
'application/json; charset=utf-8'
}
end
...
...
spec/models/project_services/drone_ci_service_spec.rb
View file @
d5264e88
...
...
@@ -85,7 +85,7 @@ describe DroneCiService, models: true do
let
(
:user
)
{
create
(
:user
,
username:
'username'
)
}
let
(
:push_sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
it
do
...
...
spec/models/project_services/flowdock_service_spec.rb
View file @
d5264e88
...
...
@@ -52,8 +52,7 @@ describe FlowdockService, models: true do
service_hook:
true
,
token:
'verySecret'
)
@sample_data
=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
project
,
user
)
@sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
@api_url
=
'https://api.flowdock.com/v1/messages'
WebMock
.
stub_request
(
:post
,
@api_url
)
end
...
...
spec/models/project_services/gemnasium_service_spec.rb
View file @
d5264e88
...
...
@@ -55,8 +55,7 @@ describe GemnasiumService, models: true do
token:
'verySecret'
,
api_key:
'GemnasiumUserApiKey'
)
@sample_data
=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
project
,
user
)
@sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
it
"calls Gemnasium service"
do
expect
(
Gemnasium
::
GitlabService
).
to
receive
(
:execute
).
with
(
an_instance_of
(
Hash
)).
once
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
d5264e88
...
...
@@ -49,7 +49,7 @@ describe HipchatService, models: true do
let
(
:token
)
{
'verySecret'
}
let
(
:server_url
)
{
'https://hipchat.example.com'
}
let
(
:push_sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
before
(
:each
)
do
...
...
@@ -111,7 +111,7 @@ describe HipchatService, models: true do
context
'tag_push events'
do
let
(
:push_sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build
(
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
user
,
Gitlab
::
Git
::
BLANK_SHA
,
...
...
@@ -195,7 +195,7 @@ describe HipchatService, models: true do
end
it
"calls Hipchat API for commit comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
commit_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
commit_note
,
user
)
hipchat
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
api_url
).
once
...
...
@@ -227,7 +227,7 @@ describe HipchatService, models: true do
end
it
"calls Hipchat API for merge request comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
merge_request_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
merge_request_note
,
user
)
hipchat
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
api_url
).
once
...
...
@@ -254,7 +254,7 @@ describe HipchatService, models: true do
end
it
"calls Hipchat API for issue comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
issue_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
issue_note
,
user
)
hipchat
.
execute
(
data
)
message
=
hipchat
.
send
(
:create_message
,
data
)
...
...
@@ -280,7 +280,7 @@ describe HipchatService, models: true do
end
it
"calls Hipchat API for snippet comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
snippet_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
snippet_note
,
user
)
hipchat
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
api_url
).
once
...
...
@@ -303,7 +303,7 @@ describe HipchatService, models: true do
context
'build events'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
build
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Build
.
build
(
build
)
}
context
'for failed'
do
before
{
build
.
drop
}
...
...
spec/models/project_services/irker_service_spec.rb
View file @
d5264e88
...
...
@@ -47,7 +47,7 @@ describe IrkerService, models: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
let
(
:recipients
)
{
'#commits irc://test.net/#test ftp://bad'
}
...
...
spec/models/project_services/jira_service_spec.rb
View file @
d5264e88
...
...
@@ -66,8 +66,7 @@ describe JiraService, models: true do
password:
'gitlab_jira_password'
)
@jira_service
.
save
# will build API URL, as api_url was not specified above
@sample_data
=
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
project
,
user
)
@sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
# https://github.com/bblimke/webmock#request-with-basic-authentication
@api_url
=
'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123/transitions'
@comment_url
=
'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123/comment'
...
...
spec/models/project_services/pushover_service_spec.rb
View file @
d5264e88
...
...
@@ -49,7 +49,7 @@ describe PushoverService, models: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
let
(
:api_key
)
{
'verySecret'
}
...
...
spec/models/project_services/slack_service_spec.rb
View file @
d5264e88
...
...
@@ -46,7 +46,7 @@ describe SlackService, models: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:push_sample_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
let
(
:webhook_url
)
{
'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
}
let
(
:username
)
{
'slack_username'
}
...
...
@@ -197,8 +197,7 @@ describe SlackService, models: true do
it
"uses the right channel"
do
slack
.
update_attributes
(
note_channel:
"random"
)
note_data
=
Gitlab
::
DataBuilder
::
NoteDataBuilder
.
build
(
issue_note
,
user
)
note_data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
issue_note
,
user
)
expect
(
Slack
::
Notifier
).
to
receive
(
:new
).
with
(
webhook_url
,
channel:
"random"
).
...
...
@@ -238,7 +237,7 @@ describe SlackService, models: true do
end
it
"calls Slack API for commit comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
commit_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
commit_note
,
user
)
slack
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
webhook_url
).
once
...
...
@@ -252,8 +251,7 @@ describe SlackService, models: true do
end
it
"calls Slack API for merge request comment events"
do
data
=
Gitlab
::
DataBuilder
::
NoteDataBuilder
.
build
(
merge_request_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
merge_request_note
,
user
)
slack
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
webhook_url
).
once
...
...
@@ -266,7 +264,7 @@ describe SlackService, models: true do
end
it
"calls Slack API for issue comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
issue_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
issue_note
,
user
)
slack
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
webhook_url
).
once
...
...
@@ -280,7 +278,7 @@ describe SlackService, models: true do
end
it
"calls Slack API for snippet comment events"
do
data
=
Gitlab
::
DataBuilder
::
Note
DataBuilder
.
build
(
snippet_note
,
user
)
data
=
Gitlab
::
DataBuilder
::
Note
.
build
(
snippet_note
,
user
)
slack
.
execute
(
data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
webhook_url
).
once
...
...
spec/models/user_spec.rb
View file @
d5264e88
...
...
@@ -896,7 +896,7 @@ describe User, models: true do
let!
(
:project1
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:project
,
forked_from_project:
project1
)
}
let!
(
:push_data
)
do
Gitlab
::
DataBuilder
::
Push
DataBuilder
.
build_sample
(
project2
,
subject
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project2
,
subject
)
end
let!
(
:push_event
)
{
create
(
:event
,
action:
Event
::
PUSHED
,
project:
project2
,
target:
project1
,
author:
subject
,
data:
push_data
)
}
...
...
spec/workers/build_email_worker_spec.rb
View file @
d5264e88
...
...
@@ -5,7 +5,7 @@ describe BuildEmailWorker do
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Build
DataBuilder
.
build
(
build
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Build
.
build
(
build
)
}
subject
{
BuildEmailWorker
.
new
}
...
...
spec/workers/emails_on_push_worker_spec.rb
View file @
d5264e88
...
...
@@ -5,9 +5,7 @@ describe EmailsOnPushWorker do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:data
)
do
Gitlab
::
DataBuilder
::
PushDataBuilder
.
build_sample
(
project
,
user
)
end
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
let
(
:recipients
)
{
user
.
email
}
let
(
:perform
)
{
subject
.
perform
(
project
.
id
,
recipients
,
data
.
stringify_keys
)
}
...
...
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