Skip to content

fix: handle extra workspace name case #17549

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

f0ssel
Copy link
Contributor

@f0ssel f0ssel commented Apr 23, 2025

Fixes issue introduced here: #17154

This fixes an issue that came up in jetbrains-toolbox development where we do not properly handle the workspace.agent format.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the incorrect normalization of workspace names when using the "workspace.agent" format, addressing an issue discovered with JetBrains Toolbox.

  • Added a new test case in cli/ssh_test.go to validate the "workspace.agent" input format.
  • Modified the normalization logic in cli/ssh.go to correctly differentiate between "owner/workspace" and "workspace.agent" inputs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cli/ssh_test.go Added a test case to cover workspace names in the "workspace.agent" format.
cli/ssh.go Updated normalization logic to support the new workspace name format.
Comments suppressed due to low confidence (2)

cli/ssh.go:1472

  • [nitpick] Consider refactoring this condition to more explicitly differentiate between 'owner/workspace' and 'workspace.agent' formats. For instance, checking for a '.' could improve readability for inputs meant as 'workspace.agent'.
if strings.Contains(input, "/") || strings.Contains(input, "--") {

cli/ssh_test.go:109

  • [nitpick] Consider adding additional test cases covering edge cases such as workspace names with multiple dots or unexpected characters to ensure comprehensive input normalization.
"myworkspace.dev",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant