mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-17 01:58:02 +00:00
dashboard/app: remove ReportingType.NeedMaintainers
Instead require DefaultMaintainers if MailMaintainers is set. This makes logic in needReport a bit simpler.
This commit is contained in:
parent
647e8b6e47
commit
4df543c9ab
@ -223,10 +223,6 @@ func (cfg *TestConfig) Type() string {
|
||||
return "test"
|
||||
}
|
||||
|
||||
func (cfg *TestConfig) NeedMaintainers() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (cfg *TestConfig) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -111,8 +111,6 @@ type Reporting struct {
|
||||
type ReportingType interface {
|
||||
// Type returns a unique string that identifies this reporting type (e.g. "email").
|
||||
Type() string
|
||||
// NeedMaintainers says if this reporting requires non-empty maintainers list.
|
||||
NeedMaintainers() bool
|
||||
// Validate validates the current object, this is called only during init.
|
||||
Validate() error
|
||||
}
|
||||
|
@ -126,11 +126,6 @@ func needReport(c context.Context, typ string, state *ReportingState, bug *Bug)
|
||||
reporting, bugReporting = nil, nil
|
||||
return
|
||||
}
|
||||
if reporting.Config.NeedMaintainers() && len(crash.Maintainers) == 0 {
|
||||
status = fmt.Sprintf("%v: no maintainers", reporting.DisplayTitle)
|
||||
reporting, bugReporting = nil, nil
|
||||
return
|
||||
}
|
||||
|
||||
// Limit number of reports sent per day,
|
||||
// but don't limit sending repros to already reported bugs.
|
||||
|
@ -66,10 +66,6 @@ func (cfg *EmailConfig) Type() string {
|
||||
return emailType
|
||||
}
|
||||
|
||||
func (cfg *EmailConfig) NeedMaintainers() bool {
|
||||
return cfg.MailMaintainers && len(cfg.DefaultMaintainers) == 0
|
||||
}
|
||||
|
||||
func (cfg *EmailConfig) Validate() error {
|
||||
if _, err := mail.ParseAddress(cfg.Email); err != nil {
|
||||
return fmt.Errorf("bad email address %q: %v", cfg.Email, err)
|
||||
@ -82,6 +78,9 @@ func (cfg *EmailConfig) Validate() error {
|
||||
if cfg.Moderation && cfg.MailMaintainers {
|
||||
return fmt.Errorf("both Moderation and MailMaintainers set")
|
||||
}
|
||||
if cfg.MailMaintainers && len(cfg.DefaultMaintainers) == 0 {
|
||||
return fmt.Errorf("MailMaintainers is set but no DefaultMaintainers")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user