// step converts an annotation step to a buildbot step.
542324
func (ac *annotationConverter) step(c context.Context, src *miloProto.Step) (*buildbot.Step, error) {
	// This implementation is based on
	// https://chromium.googlesource.com/infra/luci/luci-go/+/7ad046489c578e339b873886d6973abbe43cc137/milo/buildsource/rawpresentation/logDogBuild.go#47

	res := &buildbot.Step{
		Name:       src.Name,
		IsStarted:  true,
		IsFinished: src.Ended != nil,
	}

	// Convert step result.
	switch {
	case src.Status == miloProto.Status_SUCCESS:
		res.Results.Result = buildbot.Success

	case src.Status == miloProto.Status_FAILURE:
		res.Results.Result = buildbot.Failure
		if fd := src.GetFailureDetails(); fd != nil {
			if fd.Type != miloProto.FailureDetails_GENERAL {
				res.Results.Result = buildbot.Exception
			}
			if fd.Text != "" {
				res.Text = append(res.Text, fd.Text)
			}
		}

	case !ac.buildCompletedTime.IsZero():
		res.Results.Result = buildbot.Exception

	default:
		res.Results.Result = buildbot.NoResult
	}

	// annotee never initializes src.Link
	var allLinks []*miloProto.Link
	if src.StdoutStream != nil {
		allLinks = append(allLinks, &miloProto.Link{
			Label: "stdout",
			Value: &miloProto.Link_LogdogStream{src.StdoutStream},
		})
	}
	if src.StderrStream != nil {
		allLinks = append(allLinks, &miloProto.Link{
			Label: "stderr",
			Value: &miloProto.Link_LogdogStream{src.StdoutStream},
		})
	}
	allLinks = append(allLinks, src.OtherLinks...)
	for _, l := range allLinks {
		log, err := ac.log(l)
		if err != nil {
			logging.WithError(err).Errorf(c, "could not convert link %q to buildbot", l.Label)
			continue
		}
		res.Logs = append(res.Logs, *log)
	}

	// Timestamps
	if src.Started != nil {
		var err error
		res.Times.Start.Time, err = ptypes.Timestamp(src.Started)
		if err != nil {
			return nil, errors.Annotate(err, "invalid start time").Err()
		}
		if src.Ended != nil {
			res.Times.Finish.Time, err = ptypes.Timestamp(src.Ended)
			if err != nil {
				return nil, errors.Annotate(err, "invalid end time").Err()
			}
		} else {
			res.Times.Finish.Time = ac.buildCompletedTime
		}
	}

	for _, line := range src.Text {
		// src.Text may contain <br> ;(
		res.Text = append(res.Text, reLineBreak.Split(line, -1)...)
	}
	return res, nil
}
135518
func (b *ApplyGraphBuilder) Steps() []GraphTransformer {
	// Custom factory for creating providers.
	concreteProvider := func(a *NodeAbstractProvider) dag.Vertex {
		return &NodeApplyableProvider{
			NodeAbstractProvider: a,
		}
	}

	concreteResource := func(a *NodeAbstractResource) dag.Vertex {
		return &NodeApplyableResource{
			NodeAbstractResource: a,
		}
	}

	concreteOrphanResource := func(a *NodeAbstractResource) dag.Vertex {
		return &NodeDestroyResource{
			NodeAbstractResource: a,
		}
	}

	concreteResourceInstance := func(a *NodeAbstractResourceInstance) dag.Vertex {
		return &NodeApplyableResourceInstance{
			NodeAbstractResourceInstance: a,
		}
	}

	steps := []GraphTransformer{
		// Creates all the resources represented in the config. During apply,
		// we use this just to ensure that the whole-resource metadata is
		// updated to reflect things such as whether the count argument is
		// set in config, or which provider configuration manages each resource.
		&ConfigTransformer{
			Concrete: concreteResource,
			Config:   b.Config,
		},

		// Creates all the resource instances represented in the diff, along
		// with dependency edges against the whole-resource nodes added by
		// ConfigTransformer above.
		&DiffTransformer{
			Concrete: concreteResourceInstance,
			State:    b.State,
			Changes:  b.Changes,
		},

		// Creates extra cleanup nodes for any entire resources that are
		// no longer present in config, so we can make sure we clean up the
		// leftover empty resource states after the instances have been
		// destroyed.
		// (We don't track this particular type of change in the plan because
		// it's just cleanup of our own state object, and so doesn't effect
		// any real remote objects or consumable outputs.)
		&OrphanResourceTransformer{
			Concrete: concreteOrphanResource,
			Config:   b.Config,
			State:    b.State,
		},

		// Create orphan output nodes
		&OrphanOutputTransformer{Config: b.Config, State: b.State},

		// Attach the configuration to any resources
		&AttachResourceConfigTransformer{Config: b.Config},

		// Attach the state
		&AttachStateTransformer{State: b.State},

		// Destruction ordering
		&DestroyEdgeTransformer{
			Config:  b.Config,
			State:   b.State,
			Schemas: b.Schemas,
		},
		GraphTransformIf(
			func() bool { return !b.Destroy },
			&CBDEdgeTransformer{
				Config:  b.Config,
				State:   b.State,
				Schemas: b.Schemas,
			},
		),

		// Provisioner-related transformations
		&MissingProvisionerTransformer{Provisioners: b.Components.ResourceProvisioners()},
		&ProvisionerTransformer{},

		// Add root variables
		&RootVariableTransformer{Config: b.Config},

		// Add the local values
		&LocalTransformer{Config: b.Config},

		// Add the outputs
		&OutputTransformer{Config: b.Config},

		// Add module variables
		&ModuleVariableTransformer{Config: b.Config},

		// add providers
		TransformProviders(b.Components.ResourceProviders(), concreteProvider, b.Config),

		// Remove modules no longer present in the config
		&RemovedModuleTransformer{Config: b.Config, State: b.State},

		// Must attach schemas before ReferenceTransformer so that we can
		// analyze the configuration to find references.
		&AttachSchemaTransformer{Schemas: b.Schemas},

		// Connect references so ordering is correct
		&ReferenceTransformer{},

		// Handle destroy time transformations for output and local values.
		// Reverse the edges from outputs and locals, so that
		// interpolations don't fail during destroy.
		// Create a destroy node for outputs to remove them from the state.
		// Prune unreferenced values, which may have interpolations that can't
		// be resolved.
		GraphTransformIf(
			func() bool { return b.Destroy },
			GraphTransformMulti(
				&DestroyValueReferenceTransformer{},
				&DestroyOutputTransformer{},
				&PruneUnusedValuesTransformer{},
			),
		),

		// Add the node to fix the state count boundaries
		&CountBoundaryTransformer{
			Config: b.Config,
		},

		// Target
		&TargetsTransformer{Targets: b.Targets},

		// Close opened plugin connections
		&CloseProviderTransformer{},
		&CloseProvisionerTransformer{},

		// Single root
		&RootTransformer{},
	}

	if !b.DisableReduce {
		// Perform the transitive reduction to make our graph a bit
		// more sane if possible (it usually is possible).
		steps = append(steps, &TransitiveReductionTransformer{})
	}

	return steps
}
435715
func (p *parser) parseStep(n node) (opnd node) {
	axeTyp := "child" // default axes value.
	if p.r.typ == itemDot || p.r.typ == itemDotDot {
		if p.r.typ == itemDot {
			axeTyp = "self"
		} else {
			axeTyp = "parent"
		}
		p.next()
		opnd = newAxisNode(axeTyp, "", "", "", n)
		if p.r.typ != itemLBracket {
			return opnd
		}
	} else {
		switch p.r.typ {
		case itemAt:
			p.next()
			axeTyp = "attribute"
		case itemAxe:
			axeTyp = p.r.name
			p.next()
		case itemLParens:
			return p.parseSequence(n)
		}
		opnd = p.parseNodeTest(n, axeTyp)
	}
	for p.r.typ == itemLBracket {
		opnd = newFilterNode(opnd, p.parsePredicate(opnd))
	}
	return opnd
}
729350
func (b *RefreshGraphBuilder) Steps() []GraphTransformer {
	// Custom factory for creating providers.
	concreteProvider := func(a *NodeAbstractProvider) dag.Vertex {
		return &NodeApplyableProvider{
			NodeAbstractProvider: a,
		}
	}

	concreteManagedResource := func(a *NodeAbstractResource) dag.Vertex {
		return &NodeRefreshableManagedResource{
			NodeAbstractResource: a,
		}
	}

	concreteManagedResourceInstance := func(a *NodeAbstractResourceInstance) dag.Vertex {
		return &NodeRefreshableManagedResourceInstance{
			NodeAbstractResourceInstance: a,
		}
	}

	concreteResourceInstanceDeposed := func(a *NodeAbstractResourceInstance, key states.DeposedKey) dag.Vertex {
		// The "Plan" node type also handles refreshing behavior.
		return &NodePlanDeposedResourceInstanceObject{
			NodeAbstractResourceInstance: a,
			DeposedKey:                   key,
		}
	}

	concreteDataResource := func(a *NodeAbstractResource) dag.Vertex {
		return &NodeRefreshableDataResource{
			NodeAbstractResource: a,
		}
	}

	steps := []GraphTransformer{
		// Creates all the managed resources that aren't in the state, but only if
		// we have a state already. No resources in state means there's not
		// anything to refresh.
		func() GraphTransformer {
			if b.State.HasResources() {
				return &ConfigTransformer{
					Concrete:   concreteManagedResource,
					Config:     b.Config,
					Unique:     true,
					ModeFilter: true,
					Mode:       addrs.ManagedResourceMode,
				}
			}
			log.Println("[TRACE] No managed resources in state during refresh; skipping managed resource transformer")
			return nil
		}(),

		// Creates all the data resources that aren't in the state. This will also
		// add any orphans from scaling in as destroy nodes.
		&ConfigTransformer{
			Concrete:   concreteDataResource,
			Config:     b.Config,
			Unique:     true,
			ModeFilter: true,
			Mode:       addrs.DataResourceMode,
		},

		// Add any fully-orphaned resources from config (ones that have been
		// removed completely, not ones that are just orphaned due to a scaled-in
		// count.
		&OrphanResourceInstanceTransformer{
			Concrete: concreteManagedResourceInstance,
			State:    b.State,
			Config:   b.Config,
		},

		// We also need nodes for any deposed instance objects present in the
		// state, so we can check if they still exist. (This intentionally
		// skips creating nodes for _current_ objects, since ConfigTransformer
		// created nodes that will do that during DynamicExpand.)
		&StateTransformer{
			ConcreteDeposed: concreteResourceInstanceDeposed,
			State:           b.State,
		},

		// Attach the state
		&AttachStateTransformer{State: b.State},

		// Attach the configuration to any resources
		&AttachResourceConfigTransformer{Config: b.Config},

		// Add root variables
		&RootVariableTransformer{Config: b.Config},

		// Add the local values
		&LocalTransformer{Config: b.Config},

		// Add the outputs
		&OutputTransformer{Config: b.Config},

		// Add module variables
		&ModuleVariableTransformer{Config: b.Config},

		TransformProviders(b.Components.ResourceProviders(), concreteProvider, b.Config),

		// Must attach schemas before ReferenceTransformer so that we can
		// analyze the configuration to find references.
		&AttachSchemaTransformer{Schemas: b.Schemas},

		// Connect so that the references are ready for targeting. We'll
		// have to connect again later for providers and so on.
		&ReferenceTransformer{},

		// Target
		&TargetsTransformer{
			Targets: b.Targets,

			// Resource nodes from config have not yet been expanded for
			// "count", so we must apply targeting without indices. Exact
			// targeting will be dealt with later when these resources
			// DynamicExpand.
			IgnoreIndices: true,
		},

		// Close opened plugin connections
		&CloseProviderTransformer{},

		// Single root
		&RootTransformer{},
	}

	if !b.DisableReduce {
		// Perform the transitive reduction to make our graph a bit
		// more sane if possible (it usually is possible).
		steps = append(steps, &TransitiveReductionTransformer{})
	}

	return steps
}
1004849
func (s *Range) SetStep(v int64) *Range {
	s.Step = &v
	return s
}
564462
func (r *AutoClaimRunner) step(mctx libkb.MetaContext, i int, trigger gregor.MsgID) (action autoClaimLoopAction, err error) {
	log := func(format string, args ...interface{}) {
		mctx.Debug(fmt.Sprintf("AutoClaimRunnner round[%v] ", i) + fmt.Sprintf(format, args...))
	}
	log("step begin")
	token, err := r.walletState.AcquireAutoClaimLock(mctx.Ctx())
	if err != nil {
		return autoClaimLoopActionSnooze, err
	}
	if len(token) == 0 {
		log("autoclaim lock is busy")
		return autoClaimLoopActionSnooze, nil
	}
	defer func() {
		rerr := r.walletState.ReleaseAutoClaimLock(mctx.Ctx(), token)
		if rerr != nil {
			log("error releasing autoclaim lock: %v", rerr)
		}
	}()
	ac, err := r.walletState.NextAutoClaim(mctx.Ctx())
	if err != nil {
		return autoClaimLoopActionSnooze, err
	}
	if ac == nil {
		log("no more autoclaims")
		if trigger.String() != "" {
			log("dismissing kick: %v", trigger)
			err = mctx.G().GregorState.DismissItem(mctx.Ctx(), nil, trigger)
			if err != nil {
				log("error dismissing gregor kick: %v", err)
				return autoClaimLoopActionHibernate, err
			}
			log("successfully dismissed kick")
		}
		return autoClaimLoopActionHibernate, nil
	}
	log("got next autoclaim: %v", ac.KbTxID)
	err = r.claim(mctx, ac.KbTxID, token)
	if err != nil {
		return autoClaimLoopActionSnooze, err
	}
	log("successfully claimed: %v", ac.KbTxID)
	return autoClaimLoopActionFast, nil
}
1270602
func (b *B) Step(str string) {
	if !AnalysisOn {
		return
	}

	b.stopTimer()
	fmt.Println(str + ":")
	fmt.Println(b.results().toString())

	b.resetTimer()
	b.startTimer()
}
1129314
func sendAnnotations(ctx context.Context, ann *milo.Step) error {
	fullPrefix := fmt.Sprintf("%s/%s", client.Logdog.Prefix, client.Logdog.Namespace)
	steps, err := deprecated.ConvertBuildSteps(ctx, ann.Substep, client.Logdog.CoordinatorHost, fullPrefix)
	if err != nil {
		return errors.Annotate(err, "failed to extra steps from annotations").Err()
	}

	props, err := milo.ExtractProperties(ann)
	if err != nil {
		return errors.Annotate(err, "failed to extract properties from annotations").Err()
	}

	buildMU.Lock()
	defer buildMU.Unlock()
	build.Steps = steps
	build.Output.Properties = props
	return errors.Annotate(client.WriteBuild(build), "failed to write build message").Err()
}
605012
func stateStepsFor20() []Step {
	return []Step{
		&upgradeStep{
			description: "strip @local from local user names",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return context.State().StripLocalUserDomain()
			},
		},
		&upgradeStep{
			description: "rename addmodel permission to add-model",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return context.State().RenameAddModelPermission()
			},
		},
	}
}
1121092
func (m *postgresMigrator) step(fn MigrationFunc) error {
	if fn == nil {
		panic("step called but no function!")
	}
	tx, err := m.db.Begin()
	if err != nil {
		return err
	}
	if err := fn(tx); err != nil {
		fmt.Printf("got an error trying to run a step: %v", err)
		if err := tx.Rollback(); err != nil {
			panic(fmt.Sprintf("unable to rollback migration transaction:%v", err))
		}
		return err
	}
	if err := tx.Commit(); err != nil {
		panic(fmt.Sprintf("unable to commit migration transaction:%v", err))
	}
	return nil
}
693773
func (as *Step) Start(startTime *timestamp.Timestamp) bool {
	if as.Started != nil {
		return false
	}
	as.Started = startTime
	return true
}
701989
func BlockStepPathCtx(next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		stepIdxStr := chi.URLParam(r, "step")
		step, err := strconv.Atoi(stepIdxStr)
		if err != nil {
			apiLog.Infof("No/invalid step value (int64): %v", err)
			http.NotFound(w, r)
			return
		}
		ctx := context.WithValue(r.Context(), ctxBlockStep, step)
		next.ServeHTTP(w, r.WithContext(ctx))
	})
}
596937
func (s *State) LookupStepErr(name string) (*Step, error) {
	if as := s.LookupStep(name); as != nil {
		return as, nil
	}
	return nil, fmt.Errorf("no step named %q", name)
}
863215
func StepmanVersion() (version.Version, error) {
	logLevel := log.GetLevel().String()
	args := []string{"stepman", "--loglevel", logLevel, "--version"}

	versionOut, err := command.RunCommandAndReturnCombinedStdoutAndStderr("bitrise", args...)
	if err != nil {
		return version.Version{}, err
	}

	versionPtr, err := version.NewVersion(versionOut)
	if err != nil {
		return version.Version{}, err
	}
	if versionPtr == nil {
		return version.Version{}, fmt.Errorf("Failed to parse version (%s)", versionOut)
	}

	return *versionPtr, nil
}
192024
func MergeStepWith(step, otherStep stepmanModels.StepModel) (stepmanModels.StepModel, error) {
	if otherStep.Title != nil {
		step.Title = pointers.NewStringPtr(*otherStep.Title)
	}
	if otherStep.Summary != nil {
		step.Summary = pointers.NewStringPtr(*otherStep.Summary)
	}
	if otherStep.Description != nil {
		step.Description = pointers.NewStringPtr(*otherStep.Description)
	}

	if otherStep.Website != nil {
		step.Website = pointers.NewStringPtr(*otherStep.Website)
	}
	if otherStep.SourceCodeURL != nil {
		step.SourceCodeURL = pointers.NewStringPtr(*otherStep.SourceCodeURL)
	}
	if otherStep.SupportURL != nil {
		step.SupportURL = pointers.NewStringPtr(*otherStep.SupportURL)
	}

	if otherStep.PublishedAt != nil {
		step.PublishedAt = pointers.NewTimePtr(*otherStep.PublishedAt)
	}
	if otherStep.Source != nil {
		step.Source = new(stepmanModels.StepSourceModel)

		if otherStep.Source.Git != "" {
			step.Source.Git = otherStep.Source.Git
		}
		if otherStep.Source.Commit != "" {
			step.Source.Commit = otherStep.Source.Commit
		}
	}
	if len(otherStep.AssetURLs) > 0 {
		step.AssetURLs = otherStep.AssetURLs
	}

	if len(otherStep.HostOsTags) > 0 {
		step.HostOsTags = otherStep.HostOsTags
	}
	if len(otherStep.ProjectTypeTags) > 0 {
		step.ProjectTypeTags = otherStep.ProjectTypeTags
	}
	if len(otherStep.TypeTags) > 0 {
		step.TypeTags = otherStep.TypeTags
	}
	if len(otherStep.Dependencies) > 0 {
		step.Dependencies = otherStep.Dependencies
	}
	if otherStep.Toolkit != nil {
		step.Toolkit = new(stepmanModels.StepToolkitModel)
		*step.Toolkit = *otherStep.Toolkit
	}
	if otherStep.Deps != nil && (len(otherStep.Deps.Brew) > 0 || len(otherStep.Deps.AptGet) > 0 || len(otherStep.Deps.CheckOnly) > 0) {
		step.Deps = otherStep.Deps
	}
	if otherStep.IsRequiresAdminUser != nil {
		step.IsRequiresAdminUser = pointers.NewBoolPtr(*otherStep.IsRequiresAdminUser)
	}

	if otherStep.IsAlwaysRun != nil {
		step.IsAlwaysRun = pointers.NewBoolPtr(*otherStep.IsAlwaysRun)
	}
	if otherStep.IsSkippable != nil {
		step.IsSkippable = pointers.NewBoolPtr(*otherStep.IsSkippable)
	}
	if otherStep.RunIf != nil {
		step.RunIf = pointers.NewStringPtr(*otherStep.RunIf)
	}
	if otherStep.Timeout != nil {
		step.Timeout = pointers.NewIntPtr(*otherStep.Timeout)
	}

	for _, input := range step.Inputs {
		key, _, err := input.GetKeyValuePair()
		if err != nil {
			return stepmanModels.StepModel{}, err
		}
		otherInput, found := getInputByKey(otherStep, key)
		if found {
			err := MergeEnvironmentWith(&input, otherInput)
			if err != nil {
				return stepmanModels.StepModel{}, err
			}
		}
	}

	for _, output := range step.Outputs {
		key, _, err := output.GetKeyValuePair()
		if err != nil {
			return stepmanModels.StepModel{}, err
		}
		otherOutput, found := getOutputByKey(otherStep, key)
		if found {
			err := MergeEnvironmentWith(&output, otherOutput)
			if err != nil {
				return stepmanModels.StepModel{}, err
			}
		}
	}

	return step, nil
}
993811
func miloBuildStep(c context.Context, ub URLBuilder, anno *miloProto.Step, includeChildren bool) ui.BuildComponent {

	comp := ui.BuildComponent{
		Label: ui.NewLink(anno.Name, "", anno.Name),
	}
	switch anno.Status {
	case miloProto.Status_RUNNING:
		comp.Status = model.Running

	case miloProto.Status_SUCCESS:
		comp.Status = model.Success

	case miloProto.Status_FAILURE:
		if fd := anno.GetFailureDetails(); fd != nil {
			switch fd.Type {
			case miloProto.FailureDetails_EXCEPTION, miloProto.FailureDetails_INFRA:
				comp.Status = model.InfraFailure

			case miloProto.FailureDetails_EXPIRED:
				comp.Status = model.Expired

			default:
				comp.Status = model.Failure
			}

			if fd.Text != "" {
				comp.Text = append(comp.Text, fd.Text)
			}
		} else {
			comp.Status = model.Failure
		}

	case miloProto.Status_PENDING:
		comp.Status = model.NotRun

		// Missing the case of waiting on unfinished dependency...
	default:
		comp.Status = model.NotRun
	}

	// Main link is a link to the stdout.
	var stdoutLink *miloProto.Link
	if anno.StdoutStream != nil {
		stdoutLink = &miloProto.Link{
			Label: "stdout",
			Value: &miloProto.Link_LogdogStream{
				LogdogStream: anno.StdoutStream,
			},
		}
	}

	if anno.Link != nil {
		comp.MainLink = ui.LinkSet{ub.BuildLink(anno.Link)}

		// If we also have a STDOUT stream, add it to our OtherLinks.
		if stdoutLink != nil {
			anno.OtherLinks = append([]*miloProto.Link{stdoutLink}, anno.OtherLinks...)
		}
	} else if stdoutLink != nil {
		comp.MainLink = ui.LinkSet{ub.BuildLink(stdoutLink)}
	}

	// Add STDERR link, if available.
	if anno.StderrStream != nil {
		anno.OtherLinks = append(anno.OtherLinks, &miloProto.Link{
			Label: "stderr",
			Value: &miloProto.Link_LogdogStream{
				LogdogStream: anno.StderrStream,
			},
		})
	}

	// Sub link is for one link per log that isn't stdout.
	for _, link := range anno.GetOtherLinks() {
		if l := ub.BuildLink(link); l != nil {
			comp.SubLink = append(comp.SubLink, ui.LinkSet{l})
		}
	}

	// This should always be a step.
	comp.Type = ui.StepLegacy

	// Timestamps
	var start, end time.Time
	if t, err := ptypes.Timestamp(anno.Started); err == nil {
		start = t
	}
	if t, err := ptypes.Timestamp(anno.Ended); err == nil {
		end = t
	}
	comp.ExecutionTime = ui.NewInterval(c, start, end)

	// This should be the exact same thing.
	comp.Text = append(comp.Text, anno.Text...)

	if !includeChildren {
		return comp
	}

	ss := anno.GetSubstep()
	comp.Children = make([]*ui.BuildComponent, 0, len(ss))

	// Process nested steps.
	for _, substep := range ss {
		var subanno *miloProto.Step
		switch s := substep.GetSubstep().(type) {
		case *miloProto.Step_Substep_Step:
			subanno = s.Step
		case *miloProto.Step_Substep_AnnotationStream:
			panic("Non-inline substeps not supported")
		default:
			panic(fmt.Errorf("Unknown type %v", s))
		}
		subcomp := miloBuildStep(c, ub, subanno, includeChildren)
		comp.Children = append(comp.Children, &subcomp)
	}

	return comp
}
511698
func (_m *ClusterClient) Step(ctx context.Context, opts ...grpc.CallOption) (orderer.Cluster_StepClient, error) {
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 orderer.Cluster_StepClient
	if rf, ok := ret.Get(0).(func(context.Context, ...grpc.CallOption) orderer.Cluster_StepClient); ok {
		r0 = rf(ctx, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(orderer.Cluster_StepClient)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, ...grpc.CallOption) error); ok {
		r1 = rf(ctx, opts...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}