-
Notifications
You must be signed in to change notification settings - Fork 1.3k
skip binary provisioning for run command #4731
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
skip binary provisioning for run command #4731
Conversation
Signed-off-by: Pablo Chacin <[email protected]>
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.
Binary provisioning feature is enabled. If one of the commands between `cloud run`, `cloud run --local-exeuction`, `archive` or `inspect` is used then k6 will try to provision a new k6 binary.
I think we need a better UX, because if someone now tries k6 run
it won't be able to get why it doesn't work as expected.
Signed-off-by: Pablo Chacin <[email protected]>
internal/cmd/launcher.go
Outdated
|
||
deps, err := analyze(l.gs, l.gs.CmdArgs[1:]) | ||
if err != nil { | ||
l.gs.Logger. | ||
WithError(err). | ||
Error("Failed to analyze the required dependencies. Please, make sure to report this issue by" + | ||
Error("Binary provisioning enabled but failed to analyze dependencies. Please, make sure to report this issue by" + |
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.
Error("Binary provisioning enabled but failed to analyze dependencies. Please, make sure to report this issue by" + | |
Error("Binary provisioning is enabled but it failed to analyze the dependencies. Please, make sure to report this issue by" + |
internal/cmd/launcher.go
Outdated
@@ -76,22 +77,21 @@ func (l *Launcher) Launch() { | |||
// if the command does not have dependencies or a custom build | |||
if !customBuildRequired(build.Version, deps) { | |||
l.gs.Logger. | |||
Debug("The current k6 binary already satisfies all the required dependencies," + | |||
" it isn't required to provision a new binary.") | |||
Debug("Binary provisioning is not required to execute this command.") |
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.
I find the previous message better because it explains the why. Can we restore it?
internal/cmd/launcher.go
Outdated
@@ -194,7 +194,7 @@ func k6buildProvision(gs *state.GlobalState, deps k6deps.Dependencies) (commandE | |||
} | |||
|
|||
if config.BuildServiceAuth == "" { | |||
return nil, errors.New("k6 cloud token is required when Binary provisioning feature is enabled." + | |||
return nil, errors.New("k6 cloud token is required when the binary provisioning feature is enabled." + |
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.
return nil, errors.New("k6 cloud token is required when the binary provisioning feature is enabled." + | |
return nil, errors.New("k6 cloud token is required when the binary provisioning feature is enabled." + |
I'm using Binary provisioning because it is the name of the feature. So, any name requires to be capitalized.
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.
I think it should be "Binary Provisioning"
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.
It is fine to me, go for it 👍
internal/cmd/launcher.go
Outdated
@@ -249,6 +249,8 @@ func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) | |||
} | |||
|
|||
if !isScriptRequired(args) { | |||
gs.Logger. | |||
Debug("command does not require binary provisioning") |
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.
Debug("command does not require binary provisioning") | |
Debug("The command to execute does not require binary provisioning") |
A follow-up improvement might be to return the identified command from isScriptRequired
function and log it here. However, it can be a low priority improvement for the future.
Signed-off-by: Pablo Chacin <[email protected]>
Signed-off-by: Pablo Chacin <[email protected]>
What?
skip binary provisioning for
k6 run
commandWhy?
Binary provisioning is currently supported only for users who have a cloud account, because it requires authenticating to GCK6.
Enabling binary provisioning only for cloud command (e.g.
k6 cloud run
) offers a more consistent user experience. The exception to this are thek6 archive
andk6 inspect
commands that are require for the users to upload tests to the cloud.Checklist
make check
) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)