We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32e6f67 commit 7e0a400Copy full SHA for 7e0a400
pkg/merger/merger_test.go
@@ -96,7 +96,7 @@ func TestMergeConfigFiles(t *testing.T) {
96
EnablePullRequestReviews: models.Bool(true),
97
EnableIssueDashboards: models.Bool(true),
98
SeverityThreshold: models.SeverityHigh,
99
- PriorityThreshold: models.PriorityMedium,
+ PriorityThreshold: models.PriorityImportant,
100
IgnoreDirs: []string{"dir1", "dir2"},
101
IgnorePaths: []string{"path1", "path2"},
102
Code: models.Code{
@@ -235,7 +235,7 @@ func TestMergeConfigFiles(t *testing.T) {
235
236
237
238
239
240
241
pkg/models/priority.go
@@ -1,9 +1,7 @@
1
package models
2
3
const (
4
- PriorityUrgent string = "URGENT"
5
- PriorityImportant string = "IMPORTANT"
6
- PriorityMedium string = "MEDIUM"
7
- PriorityLow string = "LOW"
8
- PriorityNegligible string = "NEGLIGIBLE"
+ PriorityUrgent string = "URGENT"
+ PriorityImportant string = "IMPORTANT"
+ PriorityInformational string = "INFORMATIONAL"
9
)
pkg/parser/defaults.go
@@ -3,7 +3,7 @@ package parser
import "github.com/nullify-platform/config-file-parser/pkg/models"
const DefaultSeverityThreshold = models.SeverityMedium
-const DefaultPriorityThreshold = models.PriorityMedium
+const DefaultPriorityThreshold = models.PriorityImportant
func NewDefaultConfig() *models.Configuration {
return &models.Configuration{
pkg/parser/parse.go
@@ -25,6 +25,11 @@ func sanitizeConfig(config *models.Configuration) {
25
config.SeverityThreshold = strings.ToUpper(config.SeverityThreshold)
26
}
27
28
+ config.PriorityThreshold = strings.Trim(config.PriorityThreshold, " ")
29
+ if config.PriorityThreshold != "" {
30
+ config.PriorityThreshold = strings.ToUpper(config.PriorityThreshold)
31
+ }
32
+
33
for name, n := range config.Notifications {
34
if n.Events.All != nil {
35
n.Events.All.MinimumSeverity = strings.ToUpper(n.Events.All.MinimumSeverity)
pkg/validator/severity.go
@@ -28,9 +28,7 @@ var validPriorities = []string{
"",
models.PriorityUrgent,
models.PriorityImportant,
- models.PriorityMedium,
- models.PriorityLow,
- models.PriorityNegligible,
+ models.PriorityInformational,
36
// ValidatePriorityThreshold returns true if the priority_threshold
tests/integration_test.go
@@ -15,6 +15,7 @@ func TestIntegration(t *testing.T) {
15
16
17
SeverityThreshold: models.SeverityMedium,
18
+ PriorityThreshold: models.PriorityUrgent,
19
IgnoreDirs: []string{"dir1"},
20
IgnorePaths: []string{"data/**/*"},
21
Secrets: models.Secrets{
tests/nullify.yaml
@@ -2,6 +2,7 @@ enable_fail_builds: true
enable_pull_request_reviews: true
enable_issue_dashboards: true
severity_threshold: medium
+priority_threshold: urgent
ignore_dirs:
- dir1
ignore_paths:
0 commit comments