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
88d9a031
Commit
88d9a031
authored
Dec 09, 2020
by
serenafang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start adding backend for group member hook
Use group member data builder
parent
f55774d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
2 deletions
+7
-2
app/models/concerns/triggerable_hooks.rb
app/models/concerns/triggerable_hooks.rb
+2
-1
app/models/members/group_member.rb
app/models/members/group_member.rb
+2
-0
app/models/service.rb
app/models/service.rb
+1
-0
ee/app/models/hooks/group_hook.rb
ee/app/models/hooks/group_hook.rb
+2
-1
No files found.
app/models/concerns/triggerable_hooks.rb
View file @
88d9a031
...
...
@@ -15,7 +15,8 @@ module TriggerableHooks
wiki_page_hooks: :wiki_page_events
,
deployment_hooks: :deployment_events
,
feature_flag_hooks: :feature_flag_events
,
release_hooks: :releases_events
release_hooks: :releases_events
,
member_hooks: :member_events
}.
freeze
extend
ActiveSupport
::
Concern
...
...
app/models/members/group_member.rb
View file @
88d9a031
...
...
@@ -63,6 +63,8 @@ class GroupMember < Member
def
post_create_hook
run_after_commit_or_now
{
notification_service
.
new_group_member
(
self
)
}
add_group_member_data
=
Gitlab
::
HookData
::
GroupMemberBuilder
.
new
(
self
).
build
(
create
)
group
.
execute_services
(
add_group_member_data
,
:member_hooks
)
super
end
...
...
app/models/service.rb
View file @
88d9a031
...
...
@@ -86,6 +86,7 @@ class Service < ApplicationRecord
scope
:pipeline_hooks
,
->
{
where
(
pipeline_events:
true
,
active:
true
)
}
scope
:wiki_page_hooks
,
->
{
where
(
wiki_page_events:
true
,
active:
true
)
}
scope
:deployment_hooks
,
->
{
where
(
deployment_events:
true
,
active:
true
)
}
scope
:member_hooks
,
->
{
where
(
member_events:
true
,
active:
true
)
}
scope
:alert_hooks
,
->
{
where
(
alert_events:
true
,
active:
true
)
}
scope
:deployment
,
->
{
where
(
category:
'deployment'
)
}
...
...
ee/app/models/hooks/group_hook.rb
View file @
88d9a031
...
...
@@ -20,7 +20,8 @@ class GroupHook < WebHook
:pipeline_hooks
,
:wiki_page_hooks
,
:deployment_hooks
,
:release_hooks
:release_hooks
,
:member_hooks
]
belongs_to
:group
...
...
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