chore(clbot): reformat messages

Instead of putting the subject in quotes, we instead reorder the message
to be of the format:

CL/2768 applied by lukegb - chore(clbot): reformat messages - https://cl.tvl.fyi/2768

Change-Id: I77d19525c399396a91797f423bdfc92069d47f9f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2768
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Luke Granger-Brown 2021-04-02 19:43:32 +00:00 committed by lukegb
parent 0456de3733
commit 23d8e89f03

View file

@ -232,13 +232,13 @@ func main() {
continue
}
user := username(e.PatchSet)
parsedMsg = nopingAll(user, fmt.Sprintf("CL/%d: %q proposed by %s - %s", e.Change.Number, e.Change.Subject, user, patchSetURL(e.Change, e.PatchSet)))
parsedMsg = nopingAll(user, fmt.Sprintf("CL/%d proposed by %s - %s - %s", e.Change.Number, user, e.Change.Subject, patchSetURL(e.Change, e.PatchSet)))
case *gerritevents.ChangeMerged:
if e.Change.Project != *notifyRepo || !notifyBranches[e.Change.Branch] {
continue
}
user := username(e.PatchSet)
parsedMsg = nopingAll(user, fmt.Sprintf("CL/%d: %q applied by %s - %s", e.Change.Number, e.Change.Subject, user, patchSetURL(e.Change, e.PatchSet)))
parsedMsg = nopingAll(user, fmt.Sprintf("CL/%d applied by %s - %s - %s", e.Change.Number, user, e.Change.Subject, patchSetURL(e.Change, e.PatchSet)))
}
if parsedMsg != "" {
sendMsgChan <- parsedMsg