From 81583f2a55d25fcba3454f60a979dfd3a8c67f5c Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 7 May 2024 12:03:10 +0200 Subject: pkg/subsystem: don't Cc some parent subsystems Our fs is more generic than it was defined in MAINTAINERS. Let's not spam its mailing lists with bugs from individual filesystem implementations. --- pkg/subsystem/entities.go | 8 ++++++-- pkg/subsystem/entities_test.go | 12 ++++++++---- pkg/subsystem/linux/rules.go | 5 +++++ pkg/subsystem/linux/subsystems.go | 1 + 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'pkg') diff --git a/pkg/subsystem/entities.go b/pkg/subsystem/entities.go index 338447ad4..493f2fe67 100644 --- a/pkg/subsystem/entities.go +++ b/pkg/subsystem/entities.go @@ -10,8 +10,10 @@ type Subsystem struct { Lists []string Maintainers []string Parents []*Subsystem - // If NoReminders is set to true, there should be no monthly reports for the subsystem. + // If NoReminders is true, there should be no monthly reports for the subsystem. NoReminders bool + // If NoIndirectCc is true, the subsystem lists are not tagged in sub-subsystem reports. + NoIndirectCc bool } // ReachableParents returns the set of subsystems reachable from the current one. @@ -41,7 +43,9 @@ func (subsystem *Subsystem) Emails() []string { ret = append(ret, subsystem.Maintainers...) // For its parent subsystems, we only take lists. for parent := range subsystem.ReachableParents() { - ret = append(ret, parent.Lists...) + if !parent.NoIndirectCc { + ret = append(ret, parent.Lists...) + } } return ret } diff --git a/pkg/subsystem/entities_test.go b/pkg/subsystem/entities_test.go index 81c970b65..a15b25ea7 100644 --- a/pkg/subsystem/entities_test.go +++ b/pkg/subsystem/entities_test.go @@ -30,13 +30,17 @@ func TestSubsystemEmails(t *testing.T) { Maintainers: []string{"c@person.com"}, Parents: []*Subsystem{parentParent}, } + parent3 := &Subsystem{ + Lists: []string{"d@list.com"}, + NoIndirectCc: true, + } subsystem := &Subsystem{ - Lists: []string{"d@list.com"}, - Maintainers: []string{"d@person.com"}, - Parents: []*Subsystem{parent1, parent2}, + Lists: []string{"e@list.com"}, + Maintainers: []string{"e@person.com"}, + Parents: []*Subsystem{parent1, parent2, parent3}, } assert.ElementsMatch(t, subsystem.Emails(), []string{ - "a@list.com", "b@list.com", "c@list.com", "d@list.com", "d@person.com", + "a@list.com", "b@list.com", "c@list.com", "e@list.com", "e@person.com", }) } diff --git a/pkg/subsystem/linux/rules.go b/pkg/subsystem/linux/rules.go index dd46bc1d1..ecc05e5ec 100644 --- a/pkg/subsystem/linux/rules.go +++ b/pkg/subsystem/linux/rules.go @@ -14,6 +14,8 @@ type customRules struct { extraSubsystems map[string][]string // For these subsystems we do not generate monthly reminders. noReminders map[string]struct{} + // We don't want to tag these subsystems in the reports of its sub-subsystem bugs. + noIndirectCc map[string]struct{} // Extra child->[]parent links (on top of the inferred ones). addParents map[string][]string } @@ -105,5 +107,8 @@ var ( // By MAINTAINERS, wireless is somewhat separate, but it's better to keep it as a net child. "wireless": {"net"}, }, + noIndirectCc: map[string]struct{}{ + "fs": {}, + }, } ) diff --git a/pkg/subsystem/linux/subsystems.go b/pkg/subsystem/linux/subsystems.go index e5b44a02e..9da38d321 100644 --- a/pkg/subsystem/linux/subsystems.go +++ b/pkg/subsystem/linux/subsystems.go @@ -145,6 +145,7 @@ func (ctx *linuxCtx) applyExtraRules(list []*subsystem.Subsystem) error { for _, entry := range list { entry.Syscalls = ctx.extraRules.subsystemCalls[entry.Name] _, entry.NoReminders = ctx.extraRules.noReminders[entry.Name] + _, entry.NoIndirectCc = ctx.extraRules.noIndirectCc[entry.Name] perName[entry.Name] = entry } for from, toNames := range ctx.extraRules.addParents { -- cgit mrf-deployment