Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/29604
to look at the new patch set (#2).
Change subject: util/scripts/maintainers.go: Provide delimiters between maintainers
......................................................................
util/scripts/maintainers.go: Provide delimiters between maintainers
Help automated tools make sense of the output.
Instead of "[name 1 <email> name 2 <email>]", it now prints
"name 1 <email>, name 2 <email>". As long as there are no commas in the
maintainer names, they can be split easily.
Change-Id: I4a254f566404b081a08923bc7ceb49f02039aa2a
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/scripts/maintainers.go
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/29604/2
--
To view, visit https://review.coreboot.org/29604
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4a254f566404b081a08923bc7ceb49f02039aa2a
Gerrit-Change-Number: 29604
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29604
Change subject: util/scripts/maintainers.go: Provide delimiters between maintainers
......................................................................
util/scripts/maintainers.go: Provide delimiters between maintainers
Help automated tools make sense of the output.
Instead of "[name 1 <email> name 2 <email>]", it now prints
"name 1 <email>, name 2 <email>". As long as there are no commas in the
maintainer names, they can be split easily.
Change-Id: I4a254f566404b081a08923bc7ceb49f02039aa2a
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/scripts/maintainers.go
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/29604/1
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index f99dc37..901817a 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -19,6 +19,7 @@
"log"
"os"
"os/exec"
+ "strings"
"github.com/gobwas/glob"
)
@@ -172,7 +173,7 @@
success = true
fmt.Println(fname, "is in subsystem",
subsystem.name)
- fmt.Println("Maintainers: ", subsystem.maintainer)
+ fmt.Println("Maintainers: ", strings.Join(subsystem.maintainer, ", "))
}
}
if !success {
--
To view, visit https://review.coreboot.org/29604
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a254f566404b081a08923bc7ceb49f02039aa2a
Gerrit-Change-Number: 29604
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29602
Change subject: util/scrips/maintainers.go: Allow file to appear in multiple components
......................................................................
util/scrips/maintainers.go: Allow file to appear in multiple components
Without this change, the tool only reports the first hit. We want to see
all of them.
Change-Id: Ib59b13c50b61c48e3cb200bf57e28c9453590819
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/scripts/maintainers.go
1 file changed, 10 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/29602/1
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index 1b8b645..352d0a1 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -206,6 +206,7 @@
}
func find_maintainer(fname string) {
+ success := false
for _, subsystem := range subsystems {
matched, err := match_file(fname, subsystem.file)
if err != nil {
@@ -213,16 +214,19 @@
return
}
if matched && subsystem.name != "THE REST" {
+ success = true
fmt.Println(fname, "is in subsystem",
subsystem.name)
fmt.Println("Maintainers: ", subsystem.maintainer)
- return
}
}
- fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ if !success {
+ fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ }
}
func find_unmaintained(fname string) {
+ success := false
for _, subsystem := range subsystems {
matched, err := match_file(fname, subsystem.file)
if err != nil {
@@ -230,12 +234,14 @@
return
}
if matched && subsystem.name != "THE REST" {
+ success = true
fmt.Println(fname, "is in subsystem",
subsystem.name)
- return
}
}
- fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ if !success {
+ fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ }
}
func main() {
--
To view, visit https://review.coreboot.org/29602
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib59b13c50b61c48e3cb200bf57e28c9453590819
Gerrit-Change-Number: 29602
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29603
Change subject: util/scripts/maintainers.go: Use a full glob parser
......................................................................
util/scripts/maintainers.go: Use a full glob parser
Instead of checking only for three cases, just use a glob parser.
This requires to download the parser first, using:
$ go get github.com/gobwas/glob # It's MIT licensed
After that, maintainers src/arch/x86/memlayout.h emits:
src/arch/x86/memlayout.h is in subsystem X86 ARCHITECTURE
Maintainers: []
src/arch/x86/memlayout.h is in subsystem MEMLAYOUT
Maintainers: [Julius Werner <jwerner(a)chromium.org>]
The latter entry was invisible to the maintainers tool because its path
description wasn't in one of the supported formats.
Change-Id: I7e5cf4269415269552e35f2c73952ce3dff487e1
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/scripts/maintainers.go
1 file changed, 22 insertions(+), 71 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/29603/1
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index 352d0a1..f99dc37 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -19,13 +19,15 @@
"log"
"os"
"os/exec"
- "path/filepath"
+
+ "github.com/gobwas/glob"
)
type subsystem struct {
name string
maintainer []string
- file []string
+ paths []string
+ globs []glob.Glob
}
var subsystems []subsystem
@@ -84,6 +86,14 @@
return maintainers, nil
}
+func path_to_glob(path string) glob.Glob {
+ // if prefix, allow all subdirectories
+ if path[len(path)-1] == '/' {
+ path += "**"
+ }
+ return glob.MustCompile(path)
+}
+
func build_maintainers(maintainers []string) {
var current *subsystem
for _, line := range maintainers {
@@ -119,9 +129,8 @@
case 'F':
{
// add files
- current.file =
- append(current.file,
- line[3:len(line)])
+ current.paths = append(current.paths, line[3:len(line)])
+ current.globs = append(current.globs, path_to_glob(line[3:len(line)]))
break
}
case 'W':
@@ -142,77 +151,23 @@
for _, subsystem := range subsystems {
fmt.Println(subsystem.name)
fmt.Println(" ", subsystem.maintainer)
- fmt.Println(" ", subsystem.file)
+ fmt.Println(" ", subsystem.paths)
}
}
-func match_file(fname string, files []string) (bool, error) {
- var matched bool
- var err error
-
- for _, file := range files {
- /* Direct match */
- matched, err = filepath.Match(file, fname)
- if err != nil {
- return false, err
- }
- if matched {
- return true, nil
- }
-
- /* There are three cases that match_file can handle:
- *
- * dirname/filename
- * dirname/*
- * dirname/
- *
- * The first case is an exact match, the second case is a
- * direct match of everything in that directory, and the third
- * is a direct match of everything in that directory and its
- * subdirectories.
- *
- * The first two cases are handled above, the code below is
- * only for that latter case, so if file doesn't end in /,
- * skip to the next file.
- */
- if file[len(file)-1] != '/' {
- continue
- }
-
- /* Remove / because we add it again below */
- file = file[:len(file)-1]
-
- /* Maximum tree depth, as calculated by
- * $(( `git ls-files | tr -d "[a-z][A-Z][0-9]\-\_\." | \
- * sort -u | tail -1 | wc -c` - 1 ))
- * 11
- */
- max_depth := 11
-
- for i := 0; i < max_depth; i++ {
- /* Subdirectory match */
- file += "/*"
-
- if matched, err = filepath.Match(file, fname); err != nil {
- return false, err
- }
- if matched {
- return true, nil
- }
-
+func match_file(fname string, component subsystem) bool {
+ for _, glob := range component.globs {
+ if glob.Match(fname) {
+ return true
}
}
- return false, nil
+ return false
}
func find_maintainer(fname string) {
success := false
for _, subsystem := range subsystems {
- matched, err := match_file(fname, subsystem.file)
- if err != nil {
- log.Fatalf("match_file failed: %v", err)
- return
- }
+ matched := match_file(fname, subsystem)
if matched && subsystem.name != "THE REST" {
success = true
fmt.Println(fname, "is in subsystem",
@@ -228,11 +183,7 @@
func find_unmaintained(fname string) {
success := false
for _, subsystem := range subsystems {
- matched, err := match_file(fname, subsystem.file)
- if err != nil {
- log.Fatalf("match_file failed: %v", err)
- return
- }
+ matched := match_file(fname, subsystem)
if matched && subsystem.name != "THE REST" {
success = true
fmt.Println(fname, "is in subsystem",
--
To view, visit https://review.coreboot.org/29603
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e5cf4269415269552e35f2c73952ce3dff487e1
Gerrit-Change-Number: 29603
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29601
Change subject: util/scripts/maintainers.go: Stub support for website tag
......................................................................
util/scripts/maintainers.go: Stub support for website tag
ME Cleaner's component has an entry specifying its website, which this
parser didn't know how to handle. Avoid the resulting warning.
Change-Id: Ifc23e28daba9d85bf690557a80134accea8bed21
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/scripts/maintainers.go
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/29601/1
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index 03c7709..1b8b645 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -124,6 +124,10 @@
line[3:len(line)])
break
}
+ case 'W':
+ {
+ break
+ }
default:
{
fmt.Println("No such specifier: ", line)
--
To view, visit https://review.coreboot.org/29601
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc23e28daba9d85bf690557a80134accea8bed21
Gerrit-Change-Number: 29601
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>