Skip to content
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

Filter out "init-ssh-agent" from Che Code's Devfile task lists #23144

Closed
AObuchow opened this issue Sep 12, 2024 · 6 comments
Closed

Filter out "init-ssh-agent" from Che Code's Devfile task lists #23144

AObuchow opened this issue Sep 12, 2024 · 6 comments
Assignees
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@AObuchow
Copy link

Describe the bug

We recently added support in DWO for having the ssh-agent initialized as a postStart event, allowing users to have their ssh passphrase automatically inputed when performing git operations in their workspace terminals, see devfile/devworkspace-operator#1295

However, a side effect of this postStart event (which includes a DevWorkspace command) is that the command is shown in the editor. We should filter out this command from the editor, similar to what was done for #22098.

Che version

7.91@latest

Steps to reproduce

  1. Create a workspace on a Che install that's using DWO nightly (e.g. the Che Dogfooding cluster). For my testing, I created a workspace from the Che Dashboard
  2. Open the list of tasks in CheCode: Terminal -> Run Task...
  3. See that there's a task shown called init-ssh-agent even though this task/command is not defined in the devfile:

Expected behavior

The init-ssh-agent command/task should not be shown as a devfile command IMO as it's confusing to users as to where it's coming from.

Runtime

OpenShift

Screenshots

image

Installation method

OperatorHub

Environment

Linux

Eclipse Che Logs

No response

Additional context

The command has the hard-coded id of init-ssh-agent. You can check this postStart command by checking the flattened devfile in your workspace:
image

@AObuchow AObuchow added kind/bug Outline of a bug - must adhere to the bug report template. area/editor/vscode Issues related to the Code OSS editor of Che labels Sep 12, 2024
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Sep 12, 2024
@dkwon17 dkwon17 added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Sep 17, 2024
@RomanNikitenko
Copy link
Member

@AObuchow @dkwon17
so, if I understand correctly, the suggestion is - exclude the command from the devfile task list using hard-coded id.
correct?

@AObuchow
Copy link
Author

@AObuchow @dkwon17 so, if I understand correctly, the suggestion is - exclude the command from the devfile task list using hard-coded id. correct?

@RomanNikitenko Correct :) I think this would be the simplest approach to resolving this issue.

@dkwon17
Copy link
Contributor

dkwon17 commented Oct 21, 2024

With this PR: devfile/devworkspace-operator#1329, the command ids are now: init-ssh-agent-command-1, init-ssh-agent-command-2, ..., etc.

Please see: https://github.com/devfile/devworkspace-operator/pull/1329/files#r1809335501

@AObuchow
Copy link
Author

With this PR: devfile/devworkspace-operator#1329, the command ids are now: init-ssh-agent-command-1, init-ssh-agent-command-2, ..., etc.

Please see: https://github.com/devfile/devworkspace-operator/pull/1329/files#r1809335501

@RomanNikitenko With these changes, maybe a regex should be used to determine which events should be filtered out? Alternatively, you can determine the number of init-ssh-agent-command-x commands by counting the number of container components in a devworkspace, and then building the list of commands to filter out.

@RomanNikitenko RomanNikitenko added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 25, 2024
@RomanNikitenko
Copy link
Member

@AObuchow @dkwon17
I created PR to fix current issue: che-incubator/che-code#445
Currently it uses a regex to filter out init-ssh-agent-command-x commands.
I think the next time we have a similar need - we could consider adding an attribute for commands that should not be displayed on the UI.
This way we could avoid hard-coded ids and provide more flexible and clear approach.
wdyt?

@RomanNikitenko RomanNikitenko removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 25, 2024
@AObuchow
Copy link
Author

I think the next time we have a similar need - we could consider adding an attribute for commands that should not be displayed on the UI. This way we could avoid hard-coded ids and provide more flexible and clear approach. wdyt?

I think this is a great idea, the command attribute could be something like controller.devfile.io/internal-command: true. I've opened devfile/devworkspace-operator#1333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants