-
Notifications
You must be signed in to change notification settings - Fork 310
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
fix: use specific terminal #3019
Conversation
Signed-off-by: Javier López Barba <javier@okteto.com>
Codecov Report
@@ Coverage Diff @@
## master #3019 +/- ##
==========================================
- Coverage 32.73% 32.73% -0.01%
==========================================
Files 188 188
Lines 19748 19750 +2
==========================================
Hits 6465 6465
- Misses 12518 12520 +2
Partials 765 765
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I guess this is how it should've been from the start, but I'm also concerned if the wrapping around Also, I don't know if someone was using this as a kind of a "feature". i.e. using another terminal like |
The e2e tests run on both Windows and Linux, the tests will catch some errors, but because the cases are common (deploy with helm, kubectl, or stack) I don't think we can get any errors from them.
I don't think people used it as a feature since it changed both the OS and the working directory from which the command was launched. |
cmd/utils/executor/executor.go
Outdated
@@ -61,7 +61,7 @@ func NewExecutor(output string) *Executor { | |||
// Execute executes the specified command adding `env` to the execution environment | |||
func (e *Executor) Execute(cmdInfo model.DeployCommand, env []string) error { | |||
|
|||
cmd := exec.Command("bash", "-c", cmdInfo.Command) | |||
cmd := exec.Command(cmdInfo.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.
This is going to change how commands are executed. Could we set this as a flag, announce deprecation, then do the full switch in a version or two? (Or announce it as a breaking change).
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.
@rberrelleza what do you mean by setting this as a flag? the new behavior under the flag? If we do that, we'll be throwing a warning every time a user runs okteto deploy/destroy
to use a file flag that is going to be deprecated.
If we set the old behavior under the flag, are we going to release a flag that is already deprecated? I prefer this idea and show the users a way of getting back the old behavior(via flag). We should also track how many people are having errors vs previous versions and see if we are having more errors after this change, WDYT?
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.
Setting as default the new behavior could break customers' scripts/pipelines which ideally we should try to avoid unless we announce it as a breaking change and update the versions accordingly.
If I understand correctly one of the issues, does this prevent the okteto deploy
command to work on Windows? If so, we might enforce the new behavior just when the OS is windows. I mean, if for those cases it's not working, we won't break anything changing the behavior. For the rest of OS we can include a flag defaulting to the old behavior
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.
@ifbyol The problem is that windows bash runs on an auxiliary operating system, which does not run on the same path or with the same user. Being an auxiliary operating system it does not correctly pair absolute paths.
We can activate it only for Windows, although I would like that there is no difference between different operating systems, since it is more difficult to maintain it.
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.
@jLopezbarb I know, but one of our main goals is stability in the CLI, so a breaking change I don't think is a good option right now.
My point is, if in Windows this was never working as expected, doing this breaking change only for Windows would fix the issue. Now, if this wasn't working properly on some situations, then, maybe we have to rethink it because we could be broken other scenarios
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.
What if we add a feature flag to remove the bach -c
? In this case we wouldn't do a breaking change and we'd also allow for the "correct" behavior with a flag like --execute-without-bash
. We could incentivize the use of this flag and postpone it as the default behavior in some future big release
WDYT @ifbyol @jLopezbarb ?
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
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 this is a sweet spot between usability and backwards compatibility. We have to bear in mind we are adding another flag to the cli, which is something we are keeping an eye on since we are aiming for more stability
Signed-off-by: Javier López Barba <javier@okteto.com>
@RinkiyaKeDad @ralamana I don't like the fact of having a flag with a negative preposition |
Agree with Javi. This is a very typical problem when running commands, what do other tools or platforms do? |
This is a very good point. I don't recall why it was added, but we didn't have -c from day 1; it was added to fix error conditions (maybe with env var injection?). Has someone gone through the commit history to see if there are any clues? |
What if we rename the flag |
@rberrelleza "Has someone gone through the commit history to see if there are any clues?" I've tried a bit and didn't find any clue. I used the vscode extension GitLens which helped find the PR, if anyone is interested in looking for something |
+1 for this suggestion. We could also then simplify the name of the flag to just |
@rberrelleza @AgustinRamiroDiaz @jLopezbarb I think that the In the installer, we always had control on the terminal and platform where the command was being run and we didn't consider that when we moved the code to the CLI.
That could work, but it would be also interesting to see how other CLI tools do it |
I don't like too much the idea of
I can see that the |
@jLopezbarb @ifbyol regarding the naming, a common convention is to shorten the wording with expressions like |
+1 to |
I couldn't find any. I think we should do both:
|
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba javier@okteto.com
Fixes #2592 #2820
Proposed changes
Concerns
Since this is running remote and local I want to make sure it doesn't have any other implications.
I have been testing in Windows on different terminals and it returns the correct user and we don't have the problem of absolute paths anymore.
I have also tested on Linux machines and there seems to be no problem, but as this is a change that affects one of the main okteto commands I would like to know your opinion regarding this change.