From ea87bd9fe86e759353e2ac88c988044c929e0437 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Fri, 1 May 2026 19:05:40 +0300 Subject: [PATCH 1/2] fix: service detection in `vip dev-env logs` --- src/lib/dev-environment/dev-environment-core.ts | 12 ++++++------ src/lib/dev-environment/dev-environment-lando.ts | 2 +- types/lando/plugins/lando-core/lib/utils.d.ts | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/lib/dev-environment/dev-environment-core.ts b/src/lib/dev-environment/dev-environment-core.ts index 5a1d4db75..ea7767b1d 100644 --- a/src/lib/dev-environment/dev-environment-core.ts +++ b/src/lib/dev-environment/dev-environment-core.ts @@ -29,6 +29,7 @@ import { LandoExecOptions, getProxyContainer, removeProxyCache, + getLandoApplication, } from './dev-environment-lando'; import { AppEnvironment } from '../../graphqlTypes'; import app from '../api/app'; @@ -344,15 +345,14 @@ export async function showLogs( const instancePath = getEnvironmentPath( slug ); - debug( 'Instance path for', slug, 'is:', instancePath ); + debug( 'Instance path for %s is %s', slug, instancePath ); if ( options.service ) { - const appInfo = await landoInfo( lando, instancePath ); - if ( ! appInfo.services.includes( options.service ) ) { + const application = await getLandoApplication( lando, instancePath ); + const services = application.info.map( service => service.service ); + if ( ! services.includes( options.service ) ) { throw new UserError( - `Service '${ - options.service - }' not found. Please choose from one: ${ appInfo.services.toString() }` + `Service '${ options.service }' not found. Please choose from: ${ services.join( ', ' ) }` ); } } diff --git a/src/lib/dev-environment/dev-environment-lando.ts b/src/lib/dev-environment/dev-environment-lando.ts index f566d1408..aeaa81fad 100644 --- a/src/lib/dev-environment/dev-environment-lando.ts +++ b/src/lib/dev-environment/dev-environment-lando.ts @@ -341,7 +341,7 @@ async function landoRecovery( lando: Lando, instancePath: string, error: unknown } } -async function getLandoApplication( lando: Lando, instancePath: string ): Promise< App > { +export async function getLandoApplication( lando: Lando, instancePath: string ): Promise< App > { const started = new Date(); try { if ( appMap.has( instancePath ) ) { diff --git a/types/lando/plugins/lando-core/lib/utils.d.ts b/types/lando/plugins/lando-core/lib/utils.d.ts index d0e6b06f3..731c35045 100644 --- a/types/lando/plugins/lando-core/lib/utils.d.ts +++ b/types/lando/plugins/lando-core/lib/utils.d.ts @@ -1,10 +1,9 @@ import App from 'lando/lib/app'; -export interface AppInfo { +export interface AppInfo extends Record< string, unknown > { name: string; location: string; - services: string[]; - [ key: string ]: unknown; + services: string; } export function getHostPath( mount: any ): any; From d17ec4cf4d6f28ba514519b36137e8ec5b7f6032 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Fri, 1 May 2026 19:11:29 +0300 Subject: [PATCH 2/2] test: update tests --- __tests__/devenv-e2e/011-logs.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/devenv-e2e/011-logs.spec.js b/__tests__/devenv-e2e/011-logs.spec.js index dcd44b58a..4180b3693 100644 --- a/__tests__/devenv-e2e/011-logs.spec.js +++ b/__tests__/devenv-e2e/011-logs.spec.js @@ -93,7 +93,7 @@ describe( 'vip dev-env logs', () => { ); expect( result.rc ).toBeGreaterThan( 0 ); expect( result.stderr ).toContain( - "Error: Service 'foobar' not found. Please choose from one:" + "Error: Service 'foobar' not found. Please choose from:" ); } );