Skip to content

Commit

Permalink
Remove steplib-independent-step activator (#980)
Browse files Browse the repository at this point in the history
* Remove steplib-independent-step activator

* *

* Remove dead code

* Even more dead code

* Revert "Remove dead code"

This reverts commit 43a00c1.

* *

* Fix
  • Loading branch information
ofalvai authored Jun 28, 2024
1 parent a8f85fc commit 290559e
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 29 deletions.
12 changes: 5 additions & 7 deletions cli/run_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,9 @@ func (r WorkflowRunner) activateStep(
stepInfoPtr := stepmanModels.StepInfoModel{}

compositeStepIDStr := stepID
workflowStep := step

stepInfoPtr.ID = compositeStepIDStr
if workflowStep.Title != nil && *workflowStep.Title != "" {
stepInfoPtr.Step.Title = pointers.NewStringPtr(*workflowStep.Title)
if step.Title != nil && *step.Title != "" {
stepInfoPtr.Step.Title = pointers.NewStringPtr(*step.Title)
} else {
stepInfoPtr.Step.Title = pointers.NewStringPtr(compositeStepIDStr)
}
Expand Down Expand Up @@ -312,7 +310,7 @@ func (r WorkflowRunner) activateStep(
}

activator := newStepActivator()
stepYMLPth, origStepYMLPth, didStepLibUpdate, err := activator.activateStep(stepIDData, isStepLibUpdated, stepDir, configs.BitriseWorkDirPath, &workflowStep, &stepInfoPtr, isStepLibOfflineMode)
stepYMLPth, origStepYMLPth, didStepLibUpdate, err := activator.activateStep(stepIDData, isStepLibUpdated, stepDir, configs.BitriseWorkDirPath, &stepInfoPtr, isStepLibOfflineMode)
if didStepLibUpdate {
buildRunResults.StepmanUpdates[stepIDData.SteplibSource]++
}
Expand All @@ -321,7 +319,7 @@ func (r WorkflowRunner) activateStep(
}

// Fill step info with default step info, if exist
mergedStep := workflowStep
mergedStep := step
if stepYMLPth != "" {
specStep, err := bitrise.ReadSpecStep(stepYMLPth)
log.Debugf("Spec read from YML: %#v", specStep)
Expand All @@ -336,7 +334,7 @@ func (r WorkflowRunner) activateStep(
return newActivateStepResult(stepmanModels.StepModel{}, stepInfoPtr, stepIDData, stepDir, err)
}

mergedStep, err = models.MergeStepWith(specStep, workflowStep)
mergedStep, err = models.MergeStepWith(specStep, step)
if err != nil {
return newActivateStepResult(stepmanModels.StepModel{}, stepInfoPtr, stepIDData, stepDir, err)
}
Expand Down
18 changes: 0 additions & 18 deletions cli/step_activator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/bitrise-io/bitrise/log"
"github.com/bitrise-io/bitrise/tools"
"github.com/bitrise-io/go-utils/command/git"
"github.com/bitrise-io/go-utils/pointers"
"github.com/bitrise-io/stepman/activator"
stepmanModels "github.com/bitrise-io/stepman/models"
Expand All @@ -25,7 +24,6 @@ func (a stepActivator) activateStep(
isStepLibUpdated bool,
stepDir string, // $TMPDIR/bitrise/step_src
workDir string, // $TMPDIR/bitrise
workflowStep *stepmanModels.StepModel,
stepInfoPtr *stepmanModels.StepInfoModel,
isSteplibOfflineMode bool,
) (stepYMLPth string, origStepYMLPth string, didStepLibUpdate bool, err error) {
Expand Down Expand Up @@ -62,22 +60,6 @@ func (a stepActivator) activateStep(

stepYMLPth = activatedStep.StepYMLPath
origStepYMLPth = activatedStep.OrigStepYMLPath
} else if stepIDData.SteplibSource == "_" {
log.Debugf("[BITRISE_CLI] - Steplib independent step, with direct git uri: (uri:%s) (tag-or-branch:%s)", stepIDData.IDorURI, stepIDData.Version)

// StepLib independent steps are completely defined in the workflow
stepYMLPth = ""
if err := workflowStep.FillMissingDefaults(); err != nil {
return "", "", false, err
}

repo, err := git.New(stepDir)
if err != nil {
return "", "", false, err
}
if err := repo.CloneTagOrBranch(stepIDData.IDorURI, stepIDData.Version).Run(); err != nil {
return "", "", false, err
}
} else if stepIDData.SteplibSource != "" {
stepInfo, didUpdate, err := activateStepLibStep(stepIDData, stepDir, stepYMLPth, isStepLibUpdated, isSteplibOfflineMode)
didStepLibUpdate = didUpdate
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/bitrise-io/go-utils v1.0.13
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.21
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef
github.com/bitrise-io/stepman v0.0.0-20240628133929-e1775d705289
github.com/bitrise-io/stepman v0.0.0-20240628140527-5e941cdb67a1
github.com/gofrs/uuid v4.3.1+incompatible
github.com/hashicorp/go-version v1.4.0
github.com/ryanuber/go-glob v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.21 h1:iwNnwOGg8VP8eqhse68Fxt5ZnfE
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.21/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ=
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef h1:R5FOa8RHjqZwMN9g1FQ8W7nXxQAG7iwq1Cw+mUk5S9A=
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef/go.mod h1:27ldH2bkCdYN5CEJ6x92EK+gkd5EcDBkA7dMrSKQFYU=
github.com/bitrise-io/stepman v0.0.0-20240628133929-e1775d705289 h1:XOD5XCMKz0l6ScKLOVHknrXxiPV4GTD6Vd4w6viaYJk=
github.com/bitrise-io/stepman v0.0.0-20240628133929-e1775d705289/go.mod h1:netRLDQD95IzWZbzmn7CBolzNqH1tErRKS31BrZKt9s=
github.com/bitrise-io/stepman v0.0.0-20240628140527-5e941cdb67a1 h1:/hVIftPENx0k6JuXDgPbpWXCx1Lm4GbvsUVfgr6618A=
github.com/bitrise-io/stepman v0.0.0-20240628140527-5e941cdb67a1/go.mod h1:netRLDQD95IzWZbzmn7CBolzNqH1tErRKS31BrZKt9s=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/bitrise-io/stepman/activator/activator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions vendor/github.com/bitrise-io/stepman/activator/steplib_ref.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ github.com/bitrise-io/go-utils/v2/retryhttp
# github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef
## explicit; go 1.18
github.com/bitrise-io/goinp/goinp
# github.com/bitrise-io/stepman v0.0.0-20240628133929-e1775d705289
# github.com/bitrise-io/stepman v0.0.0-20240628140527-5e941cdb67a1
## explicit; go 1.18
github.com/bitrise-io/stepman/activator
github.com/bitrise-io/stepman/cli
Expand Down

0 comments on commit 290559e

Please sign in to comment.