1
0
mirror of https://github.com/golang/go synced 2024-11-16 23:04:44 -07:00

cmd/go: always include action mode in trace name

For actions with no package, the title "Executing action" is extremely
vague. Add the action mode so that there is some differentiation.

Change-Id: If6dcf81c7cd1f19a9532e56dd9f88abd1182ea97
Reviewed-on: https://go-review.googlesource.com/c/go/+/567936
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Michael Pratt 2024-02-28 15:25:40 -05:00
parent cb733da42c
commit c57b18b48f

View File

@ -139,10 +139,11 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
var err error var err error
if a.Actor != nil && (!a.Failed || a.IgnoreFail) { if a.Actor != nil && (!a.Failed || a.IgnoreFail) {
// TODO(matloob): Better action descriptions // TODO(matloob): Better action descriptions
desc := "Executing action " desc := "Executing action (" + a.Mode
if a.Package != nil { if a.Package != nil {
desc += "(" + a.Mode + " " + a.Package.Desc() + ")" desc += " " + a.Package.Desc()
} }
desc += ")"
ctx, span := trace.StartSpan(ctx, desc) ctx, span := trace.StartSpan(ctx, desc)
a.traceSpan = span a.traceSpan = span
for _, d := range a.Deps { for _, d := range a.Deps {