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
8936d625
Commit
8936d625
authored
Jan 05, 2022
by
Sven Groot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag for deployment notifications
parent
8720f46a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
app/models/integrations/base_chat_notification.rb
app/models/integrations/base_chat_notification.rb
+1
-0
config/feature_flags/development/chat_notification_deployment_protected_branch_filter.yml
.../chat_notification_deployment_protected_branch_filter.yml
+8
-0
spec/support/shared_examples/models/concerns/integrations/slack_mattermost_notifier_shared_examples.rb
...integrations/slack_mattermost_notifier_shared_examples.rb
+10
-0
No files found.
app/models/integrations/base_chat_notification.rb
View file @
8936d625
...
...
@@ -241,6 +241,7 @@ module Integrations
def
notify_for_ref?
(
data
)
return
true
if
data
[
:object_kind
]
==
'tag_push'
return
true
if
data
[
:object_kind
]
==
'deployment'
&&
!
Feature
.
enabled?
(
:chat_notification_deployment_protected_branch_filter
,
project
)
ref
=
data
[
:ref
]
||
data
.
dig
(
:object_attributes
,
:ref
)
return
true
if
ref
.
blank?
# No need to check protected branches when there is no ref
...
...
config/feature_flags/development/chat_notification_deployment_protected_branch_filter.yml
0 → 100644
View file @
8936d625
---
name
:
chat_notification_deployment_protected_branch_filter
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74423
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/349131
milestone
:
'
14.7'
type
:
development
group
:
group::integrations
default_enabled
:
false
spec/support/shared_examples/models/concerns/integrations/slack_mattermost_notifier_shared_examples.rb
View file @
8936d625
...
...
@@ -693,6 +693,16 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
context
'notification enabled for all branches'
do
it_behaves_like
"triggered
#{
service_name
}
service"
,
event_type:
"pipeline"
,
branches_to_be_notified:
"all"
end
context
'when chat_notification_deployment_protected_branch_filter is disabled'
do
before
do
stub_feature_flags
(
chat_notification_deployment_protected_branch_filter:
false
)
end
context
'notification enabled only for default branch'
do
it_behaves_like
"triggered
#{
service_name
}
service"
,
event_type:
"pipeline"
,
branches_to_be_notified:
"default"
end
end
end
end
end
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