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
ec3b0929
Commit
ec3b0929
authored
May 04, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add executable filtering to group hooks
parent
c6df195e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
ee/app/models/ee/group.rb
ee/app/models/ee/group.rb
+1
-1
ee/spec/models/ee/group_spec.rb
ee/spec/models/ee/group_spec.rb
+13
-0
No files found.
ee/app/models/ee/group.rb
View file @
ec3b0929
...
...
@@ -461,7 +461,7 @@ module EE
return
unless
feature_available?
(
:group_webhooks
)
self_and_ancestor_hooks
=
GroupHook
.
where
(
group_id:
self_and_ancestors
)
self_and_ancestor_hooks
.
hooks_for
(
hooks_scope
).
each
do
|
hook
|
self_and_ancestor_hooks
.
executable
.
hooks_for
(
hooks_scope
).
each
do
|
hook
|
hook
.
async_execute
(
data
,
hooks_scope
.
to_s
)
end
end
...
...
ee/spec/models/ee/group_spec.rb
View file @
ec3b0929
...
...
@@ -986,6 +986,19 @@ RSpec.describe Group do
group
.
execute_hooks
(
data
,
:member_hooks
)
end
end
context
'when a hook is not executable'
do
before
do
group_hook
.
update!
(
recent_failures:
4
)
end
it
'does not execute the disabled hook'
do
expect
(
WebHookService
).
to
receive
(
:new
).
with
(
parent_group_hook
,
anything
,
anything
).
and_call_original
expect
(
WebHookService
).
not_to
receive
(
:new
).
with
(
group_hook
,
anything
,
anything
)
group
.
execute_hooks
(
data
,
:member_hooks
)
end
end
end
context
'when group_webhooks feature is disabled'
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