From 51712fff4664502669d98098fbe85100c20281b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:37:42 +0000 Subject: [PATCH 1/2] Initial plan From 31a6ff0d3a60142e5de306ac33c985130fcdfdfa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:42:17 +0000 Subject: [PATCH 2/2] Fix as never casts in tests and normalize pageName flag Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com> --- src/commands/org/commerce/troubleshoot/deploy.ts | 7 ++++++- test/commands/org/commerce/troubleshoot/deploy.test.ts | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/commands/org/commerce/troubleshoot/deploy.ts b/src/commands/org/commerce/troubleshoot/deploy.ts index 01cbd69..9f9e4d0 100644 --- a/src/commands/org/commerce/troubleshoot/deploy.ts +++ b/src/commands/org/commerce/troubleshoot/deploy.ts @@ -189,6 +189,7 @@ export default class CommerceTroubleshootDeploy extends Command { const environment = readString(flags.environment) ?? readString(resolvedConfiguration.environment); const hostedPageId = readString(flags.pageId); const trackingId = readString(flags.trackingId); + const hostedPageName = readString(flags.pageName); if (!organizationId) { this.error('Missing organization ID. Provide --organization or set it with coveo config:set organization .'); @@ -198,6 +199,10 @@ export default class CommerceTroubleshootDeploy extends Command { this.error('Missing access token. Provide --access-token or set it with coveo config:set accessToken .'); } + if (!hostedPageName) { + this.error('Missing page name. Provide a non-empty value for --page-name.'); + } + const keyStrategy = this.resolveKeyStrategy(flags); const request: DeployTroubleshootRequest = { @@ -216,7 +221,7 @@ export default class CommerceTroubleshootDeploy extends Command { viewUrl: flags.viewUrl, }, target: { - hostedPageName: flags.pageName, + hostedPageName, organizationId, ...(hostedPageId ? {hostedPageId} : {}), ...(region ? {region} : {}), diff --git a/test/commands/org/commerce/troubleshoot/deploy.test.ts b/test/commands/org/commerce/troubleshoot/deploy.test.ts index 45ba565..27ee4bf 100644 --- a/test/commands/org/commerce/troubleshoot/deploy.test.ts +++ b/test/commands/org/commerce/troubleshoot/deploy.test.ts @@ -1,5 +1,6 @@ import { DefaultConfig, + type Configuration, } from '@coveo/cli-commons/config/config'; import {captureOutput} from '@oclif/test'; import {expect} from 'chai'; @@ -40,7 +41,7 @@ describe('org:commerce:troubleshoot:deploy', () => { environment: 'prod', organization: 'cfg-org', region: 'us', - }) as never); + }) as Configuration); commerceTroubleshootDeployTestHooks.setLoadDeployerModule(async () => ({ async deployTroubleshootConsole(request) { @@ -115,7 +116,7 @@ describe('org:commerce:troubleshoot:deploy', () => { environment: 'prod', organization: 'ignored-org', region: 'us', - }) as never); + }) as Configuration); commerceTroubleshootDeployTestHooks.setLoadDeployerModule(async () => ({ async deployTroubleshootConsole(request) {