Let issue-tracker.list take numbers and worker (issue 1070)

This commit is contained in:
jochen
2026-10-17 22:50:09 +02:00
parent 01c9ab0cf5
commit 1124f17912
4 changed files with 140 additions and 9 deletions
@@ -42,15 +42,18 @@ var workerName = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._/-]*@[a-z0-9][a-z0-
func worked(status string) bool { return status == StatusDiagnosing || status == StatusFixing }
// checkWorker is `by` as kept: who@node, in lower case.
func checkWorker(s string) (string, error) {
s, err := singleLine("by", s, MostWorker)
func checkWorker(s string) (string, error) { return checkWorkerField("by", s) }
// checkWorkerField is a field holding who@node (`by`, or `worker` as list filters), as kept: in lower case.
func checkWorkerField(field, s string) (string, error) {
s, err := singleLine(field, s, MostWorker)
if err != nil {
return "", err
}
s = strings.ToLower(s)
if !workerName.MatchString(s) {
return "", fmt.Errorf("by %q is not who works on it and its node: give who@node, the agent or person and the "+
"machine it works on, such as fix-399@g14 or jochen@shanks", s)
return "", fmt.Errorf("%s %q is not who works on it and its node: give who@node, the agent or person and the "+
"machine it works on, such as fix-399@g14 or jochen@shanks", field, s)
}
return s, nil
}