You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: updater.go
    path of file: ./repos/gitness/app/pipeline/manager
    
    the code of the file until where you have to start completion: // Copyright 2023 Harness, Inc.
//
// Licensed under the Apache Lice
    
func (u *updater) do(ctx context.Context, step *types.Step) error {
	log := log.Ctx(ctx).With().
		Str("step.name", step.Name).
		Str("step.status", string(step.Status)).
		Int64("step.id", step.ID).
		Logger()

	if len(step.Error) > 500 {
		step.Error = step.Error[:500]
	}
	err := u.Steps.Update(noContext, step)
	if err != nil {
		log.Error().Err(err).Msg("manager: cannot update step")
		return err
	}

	stage, err := u.Stages.Find(noContext, step.StageID)
	if err != nil {
		log.Error().Err(err).Msg("manager: cannot find stage")
		return nil
	}

	execution, err := u.Executions.Find(noContext, stage.ExecutionID)
	if err != nil {
		log.Error().Err(err).Msg("manager: cannot find execution")
		return nil
	}

	repo, err := u.Repos.Find(noContext, execution.RepoID)
	if err != nil {
		log.Error().Err(err).Msg("manager: cannot find repo")
		return nil
	}

	stages, err := u.Stages.ListWithSteps(noContext, stage.ExecutionID)
	if err != nil {
		log.Error().Err(err).Msg("manager: cannot find stages")
		return nil
	}

	execution.Stages = stages
	err = u.SSEStreamer.Publish(noContext, repo.ParentID, enum.SSETypeExecutionUpdated, execution)
	if err != nil {
		log.Warn().Err(err).Msg("manager: cannot publish execution updated event")
	}

	return nil
}