core: component -> task
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
ef407c787a
commit
81ec746d2c
@ -223,7 +223,7 @@ func (c *Client) logSolveStatus(ctx context.Context, pctx *plancontext.Context,
|
||||
lg := log.
|
||||
Ctx(ctx).
|
||||
With().
|
||||
Str("component", component).
|
||||
Str("task", component).
|
||||
Logger()
|
||||
|
||||
lg.
|
||||
@ -238,7 +238,7 @@ func (c *Client) logSolveStatus(ctx context.Context, pctx *plancontext.Context,
|
||||
lg := log.
|
||||
Ctx(ctx).
|
||||
With().
|
||||
Str("component", component).
|
||||
Str("task", component).
|
||||
Logger()
|
||||
|
||||
msg := secureSprintf(format, a...)
|
||||
@ -251,7 +251,7 @@ func (c *Client) logSolveStatus(ctx context.Context, pctx *plancontext.Context,
|
||||
lg := log.
|
||||
Ctx(ctx).
|
||||
With().
|
||||
Str("component", component).
|
||||
Str("task", component).
|
||||
Logger()
|
||||
|
||||
msg := secureSprintf(format, a...)
|
||||
|
@ -118,7 +118,7 @@ func formatMessage(event map[string]interface{}) string {
|
||||
|
||||
func parseSource(event map[string]interface{}) string {
|
||||
source := "system"
|
||||
if task, ok := event["component"].(string); ok && task != "" {
|
||||
if task, ok := event["task"].(string); ok && task != "" {
|
||||
source = task
|
||||
}
|
||||
return source
|
||||
@ -141,7 +141,7 @@ func formatFields(entry map[string]interface{}) string {
|
||||
zerolog.ErrorFieldName: {},
|
||||
zerolog.CallerFieldName: {},
|
||||
"environment": {},
|
||||
"component": {},
|
||||
"task": {},
|
||||
"state": {},
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ func (l *Logs) Add(event Event) error {
|
||||
l.l.Lock()
|
||||
defer l.l.Unlock()
|
||||
|
||||
component, ok := event["component"].(string)
|
||||
task, ok := event["task"].(string)
|
||||
if !ok {
|
||||
l.Messages = append(l.Messages, Message{
|
||||
Event: event,
|
||||
@ -52,7 +52,7 @@ func (l *Logs) Add(event Event) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
groupKey := strings.Split(component, ".#up")[0]
|
||||
groupKey := strings.Split(task, ".#up")[0]
|
||||
group := l.groups[groupKey]
|
||||
|
||||
// If the group doesn't exist, create it
|
||||
@ -72,8 +72,8 @@ func (l *Logs) Add(event Event) error {
|
||||
// For state events, we just want to update the group status -- no need to
|
||||
// dispanything
|
||||
if st, ok := event["state"].(string); ok {
|
||||
// Ignore state updates for "sub" components
|
||||
if component != groupKey {
|
||||
// Ignore state updates for "sub" tasks
|
||||
if task != groupKey {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ func newPipelineRunner(computed *compiler.Value, s solver.Solver, pctx *plancont
|
||||
lg := log.
|
||||
Ctx(ctx).
|
||||
With().
|
||||
Str("component", t.Path().String()).
|
||||
Str("task", t.Path().String()).
|
||||
Logger()
|
||||
ctx = lg.WithContext(ctx)
|
||||
|
||||
|
@ -166,7 +166,7 @@ func (p *Pipeline) Run(ctx context.Context) error {
|
||||
lg := log.
|
||||
Ctx(ctx).
|
||||
With().
|
||||
Str("component", p.name).
|
||||
Str("task", p.name).
|
||||
Logger()
|
||||
|
||||
start := time.Now()
|
||||
|
@ -120,7 +120,7 @@ func newRunner(pctx *plancontext.Context, s solver.Solver, computed *compiler.Va
|
||||
// Wrapper around `task.Run` that handles logging, tracing, etc.
|
||||
return cueflow.RunnerFunc(func(t *cueflow.Task) error {
|
||||
ctx := t.Context()
|
||||
lg := log.Ctx(ctx).With().Str("component", t.Path().String()).Logger()
|
||||
lg := log.Ctx(ctx).With().Str("task", t.Path().String()).Logger()
|
||||
ctx = lg.WithContext(ctx)
|
||||
ctx, span := otel.Tracer("dagger").Start(ctx, fmt.Sprintf("compute: %s", t.Path().String()))
|
||||
defer span.End()
|
||||
|
Reference in New Issue
Block a user