Skip to content

Commit

Permalink
Fix docs to reflect new codegate workspace subcommand (#635)
Browse files Browse the repository at this point in the history
this was introduced by #633

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
  • Loading branch information
JAORMX authored Jan 17, 2025
1 parent eddccbb commit 801fcc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/codegate/pipeline/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ async def _add_workspace(self, args: List[str]) -> str:
Add a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegate workspace add your_workspace_name`"

new_workspace_name = args[0]
if not new_workspace_name:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegate workspace add your_workspace_name`"

workspace_created = await self.workspace_crud.add_workspace(new_workspace_name)
if not workspace_created:
Expand All @@ -83,17 +83,17 @@ async def _activate_workspace(self, args: List[str]) -> str:
Activate a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegate workspace activate workspace_name`"

workspace_name = args[0]
if not workspace_name:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegate workspace activate workspace_name`"

was_activated = await self.workspace_crud.activate_workspace(workspace_name)
if not was_activated:
return (
f"Workspace **{workspace_name}** does not exist or was already active. "
f"Use `codegate-workspace add {workspace_name}` to add it"
f"Use `codegate workspace add {workspace_name}` to add it"
)
return f"Workspace **{workspace_name}** has been activated"

Expand Down
4 changes: 2 additions & 2 deletions tests/pipeline/workspace/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ async def test_list_workspaces(mock_workspaces, expected_output):
"args, existing_workspaces, expected_message",
[
# Case 1: No workspace name provided
([], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
# Case 2: Workspace name is empty string
([""], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([""], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
# Case 3: Successful add
(["myworkspace"], [], "Workspace **myworkspace** has been added"),
],
Expand Down

0 comments on commit 801fcc3

Please sign in to comment.