Add notification filtering for builds based on ref regex

Fixes #1835
This commit is contained in:
Joseph Schorr 2016-09-14 16:48:17 -04:00
parent 0dce935c40
commit 03d4445a02
3 changed files with 206 additions and 9 deletions

View file

@ -20,22 +20,62 @@ function(Config, Features, VulnerabilityService) {
{
'id': 'build_queued',
'title': 'Dockerfile Build Queued',
'icon': 'fa-tasks'
'icon': 'fa-tasks',
'fields': [
{
'name': 'ref-regex',
'type': 'regex',
'title': 'matching ref(s)',
'help_text': 'An optional regular expression for matching the git branch or tag ' +
'git ref. If left blank, the notification will fire for all builds.',
'optional': true,
}
]
},
{
'id': 'build_start',
'title': 'Dockerfile Build Started',
'icon': 'fa-circle-o-notch'
'icon': 'fa-circle-o-notch',
'fields': [
{
'name': 'ref-regex',
'type': 'regex',
'title': 'matching ref(s)',
'help_text': 'An optional regular expression for matching the git branch or tag ' +
'git ref. If left blank, the notification will fire for all builds.',
'optional': true,
}
]
},
{
'id': 'build_success',
'title': 'Dockerfile Build Successfully Completed',
'icon': 'fa-check-circle-o'
'icon': 'fa-check-circle-o',
'fields': [
{
'name': 'ref-regex',
'type': 'regex',
'title': 'matching ref(s)',
'help_text': 'An optional regular expression for matching the git branch or tag ' +
'git ref. If left blank, the notification will fire for all builds.',
'optional': true,
}
]
},
{
'id': 'build_failure',
'title': 'Dockerfile Build Failed',
'icon': 'fa-times-circle-o'
'icon': 'fa-times-circle-o',
'fields': [
{
'name': 'ref-regex',
'type': 'regex',
'title': 'matching ref(s)',
'help_text': 'An optional regular expression for matching the git branch or tag ' +
'git ref. If left blank, the notification will fire for all builds.',
'optional': true,
}
]
}];
for (var i = 0; i < buildEvents.length; ++i) {
@ -52,7 +92,7 @@ function(Config, Features, VulnerabilityService) {
{
'name': 'level',
'type': 'enum',
'title': 'Minimum Severity Level',
'title': 'minimum severity level',
'values': VulnerabilityService.LEVELS,
'help_text': 'A vulnerability must have a severity of the chosen level (or higher) ' +
'for this notification to fire. Defcon 1 is a special severity level ' +