Skip to content

Commit 4fdb3e6

Browse files
pjcdawkinsclaude
andcommitted
Fix service selection to support internal storage services.
Internal storage services like 'site---internal---storage' appear in metrics data but not in the deployment structure. This change adds derived internal storage service names for each webapp to the list of selectable services, allowing them to be filtered with --service option while maintaining strict validation. Fixes CLI-60. Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 1cbec9c commit 4fdb3e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Command/Metrics/MetricsCommandBase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ protected function fetchMetrics(InputInterface $input, TimeSpec $timeSpec, Envir
247247
$servicesInput = ArrayArgument::getOption($input, 'service');
248248
$selectedServiceNames = [];
249249
if (!empty($servicesInput)) {
250-
$selectedServiceNames = Wildcard::select(array_merge(array_keys($allServices), ['router']), $servicesInput);
250+
// Build a list of selectable service names, including internal storage services.
251+
$selectableServiceNames = array_merge(array_keys($allServices), ['router']);
252+
// Add internal storage services for each webapp.
253+
foreach (array_keys($deployment->webapps) as $appName) {
254+
$selectableServiceNames[] = $appName . '---internal---storage';
255+
}
256+
$selectedServiceNames = Wildcard::select($selectableServiceNames, $servicesInput);
251257
if (!$selectedServiceNames) {
252258
$this->stdErr->writeln('No services were found matching the name(s): <error>' . implode(', ', $servicesInput) . '</error>');
253259
return false;

0 commit comments

Comments
 (0)