-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[LocalCLI] add completion for --class
and --editor
flags
#19019
Conversation
--class
and --editor
flags
@filiptronicek if you can take a look |
@@ -13,3 +13,13 @@ packages: | |||
image: | |||
- ${imageRepoBase}/local-app:${version} | |||
- ${imageRepoBase}/local-app:commit-${__git_commit} | |||
|
|||
scripts: | |||
- name: install-cli |
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.
Could we do this automatically in the .gitpod.yml
file for the initial install? Would maybe help with testing.
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.
We could add this to the README as well
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.
Yep, will do 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.
@filiptronicek Updated README.md feel free to update it again XD
@@ -143,10 +143,53 @@ var workspaceCreateOpts struct { | |||
Editor string | |||
} | |||
|
|||
func classCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
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.
@mustard-mh could we decouple this from here and move into the helpers
package 🙏?
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.
@filiptronicek completion (api call + simple fmt.Sprintf) will only be used in cmd, if we move them to helpers
, we need to move getGitpodClient
and rootTestingOpts (using in unit test)
out too. Not that worth to do it.
We can call classCompletionFunc
any where in cmd package, so it's reusable now (i.e. add them to workspace up
cmd 07ef7b7 )
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 we could follow the approach of OpenWorkspaceInPreferredEditor
, where we pass in the client (easier for testing with client mocks). Feel like it's good to avoid coupling commands together through functions.
I think like this it's also alright. Leaving it up to ya
|
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.
Thank you!
Description
Add completion for
--class
and--editor
flags ofworkspace create
commandSummary generated by Copilot
🤖 Generated by Copilot at 1eb2534
Fix a typo in the
README.md
file that breaks the HTML syntax. Reject the pull request as it does not follow the contribution guidelines and does not address any issue or feature request.Related Issue(s)
Fixes #
How to test
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold