-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activate step executable #334
base: master
Are you sure you want to change the base?
Conversation
|
||
"github.com/bitrise-io/go-utils/command" | ||
"github.com/bitrise-io/go-utils/pathutil" | ||
"github.com/bitrise-io/stepman/models" | ||
"github.com/bitrise-io/stepman/stepman" | ||
) | ||
|
||
var errStepNotAvailableOfflineMode error = fmt.Errorf("step not available in offline mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inlined this error handling into activateStepSource()
because offline mode needs to be reworked for step executables anyway (we only cache the step source now, we'll need to cache the executables themselves)
} | ||
|
||
if destinationStepYML != "" { | ||
if err := copyStepYML(stepLibURI, id, version, destinationStepYML); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this into both activateStepSource()
and activateStepExecutable()
@@ -75,46 +69,6 @@ func queryStep(stepLib models.StepCollectionModel, stepLibURI string, id, versio | |||
return step, version, nil | |||
} | |||
|
|||
func activateStep(stepLib models.StepCollectionModel, stepLibURI, id, version string, step models.StepModel, log stepman.Logger, isOfflineMode bool) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
➡️ activate_source.go
@@ -138,8 +92,14 @@ func copyStepYML(libraryURL, id, version, dest string) error { | |||
func ListCachedStepVersions(log stepman.Logger, stepLib models.StepCollectionModel, stepLibURI, stepID string) []string { | |||
versions := []models.Semver{} | |||
|
|||
for version, step := range stepLib.Steps[stepID].Versions { | |||
_, err := activateStep(stepLib, stepLibURI, stepID, version, step, log, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was doing a full step activation just to check the error. I replaced this with a proper stepman call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it is not a full update, as there is an offline flag set in the last parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, true. The reason I had to replace this is the circular dependency between the activateStep()
function that now calls this function.
210db1e
to
3b3418a
Compare
No description provided.