Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions inc/Tools/WorkspaceTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,7 @@ public function getListDefinition(): array
*/
public function getShowDefinition(): array
{
return $this->repeatableDefinition(
array(
return array(
'class' => __CLASS__,
'method' => 'handleShow',
'description' => 'Show detailed information about a workspace repository (branch, remote, latest commit, dirty count).',
Expand All @@ -923,7 +922,6 @@ public function getShowDefinition(): array
),
'required' => array( 'name' ),
),
)
);
}

Expand Down
8 changes: 7 additions & 1 deletion tests/smoke-workspace-policy-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static function ( array $tools ) use ( $tool_id, $definition_callback, $contexts

echo "Workspace policy tools - smoke\n";

new \DataMachineCode\Tools\WorkspaceTools();
$workspace_tools = new \DataMachineCode\Tools\WorkspaceTools();
$tools = apply_filters('datamachine_tools', array());

$default_pipeline_tools = array(
Expand All @@ -94,6 +94,12 @@ static function ( array $tools ) use ( $tool_id, $definition_callback, $contexts
$assert("{$tool} remains default pipeline-visible", array( 'chat', 'pipeline' ) === ( $tools[ $tool ]['modes'] ?? null ));
}

$show_definition = $workspace_tools->getShowDefinition();
$assert('workspace_show does not allow duplicate repeat calls', 'repeatable' !== ( $show_definition['runtime']['duplicate_policy'] ?? null ));

$ls_definition = $workspace_tools->getLsDefinition();
$assert('workspace_ls still allows intentional repeat calls', 'repeatable' === ( $ls_definition['runtime']['duplicate_policy'] ?? null ));

$policy_tools = array(
'workspace_write',
'workspace_edit',
Expand Down
Loading