File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ pub(crate) struct PrioritizeConfig {
81
81
#[ serde( default ) ]
82
82
pub ( crate ) prioritize_on : Vec < String > ,
83
83
#[ serde( default ) ]
84
- pub ( crate ) priority_labels : String ,
84
+ pub ( crate ) exclude_labels : Vec < String > ,
85
85
pub ( crate ) zulip_stream : u64 ,
86
86
}
87
87
Original file line number Diff line number Diff line change @@ -39,18 +39,23 @@ impl Handler for PrioritizeHandler {
39
39
// We need to take the exact same action in this case.
40
40
return Ok ( Some ( Prioritize :: Start ) ) ;
41
41
} else {
42
- match glob:: Pattern :: new ( & config. priority_labels ) {
43
- Ok ( glob) => {
44
- let issue_labels = event. issue ( ) . unwrap ( ) . labels ( ) ;
45
- let label_name = & e. label . as_ref ( ) . expect ( "label" ) . name ;
42
+ let label_name = & e. label . as_ref ( ) . expect ( "label" ) . name ;
46
43
47
- if issue_labels. iter ( ) . all ( |l| !glob. matches ( & l. name ) )
48
- && config. prioritize_on . iter ( ) . any ( |l| l == label_name)
49
- {
50
- return Ok ( Some ( Prioritize :: Label ) ) ;
44
+ if config. prioritize_on . iter ( ) . any ( |l| l == label_name)
45
+ && config. exclude_labels . iter ( ) . all ( |exclude_label| {
46
+ match glob:: Pattern :: new ( exclude_label) {
47
+ Ok ( glob) => {
48
+ let issue_labels = event. issue ( ) . unwrap ( ) . labels ( ) ;
49
+ issue_labels. iter ( ) . all ( |l| !glob. matches ( & l. name ) )
50
+ }
51
+ Err ( error) => {
52
+ log:: error!( "Invalid glob pattern: {}" , error) ;
53
+ false
54
+ }
51
55
}
52
- }
53
- Err ( error) => log:: error!( "Invalid glob pattern: {}" , error) ,
56
+ } )
57
+ {
58
+ return Ok ( Some ( Prioritize :: Label ) ) ;
54
59
}
55
60
}
56
61
}
You can’t perform that action at this time.
0 commit comments