Skip to content

Commit 69cf8a3

Browse files
martzoukosclaude
andauthored
fix(cli): polish deploy delete-guard output and copy (#1399)
- Add a "Verifying deployed state" progress indicator around the pre-deploy dry-run so users know the CLI is checking for deletions. - Remove the double blank line before the delete warning. - Replace "detach" jargon with plain language: resources are kept in your Checkly account and managed from the web app. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9a1ea9d commit 69cf8a3

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

packages/cli/src/commands/deploy.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum ResourceDeployStatus {
2828
CREATE = 'CREATE',
2929
DELETE = 'DELETE',
3030
// Returned by newer backends for resources removed from code that are kept in
31-
// the account (detached, now managed in the Checkly Webapp) instead of deleted.
31+
// the account (now managed from the Checkly web app) instead of deleted.
3232
DETACHED = 'DETACHED',
3333
}
3434

@@ -79,7 +79,7 @@ export default class Deploy extends AuthCommand {
7979
allowNo: true,
8080
}),
8181
'preserve-resources': Flags.boolean({
82-
description: 'Detach resources removed from code (keep them and their run history) instead of deleting them.',
82+
description: 'Keep resources removed from code (and their run history) in your Checkly account instead of deleting them.',
8383
default: false,
8484
}),
8585
'force': forceFlag(),
@@ -142,8 +142,8 @@ export default class Deploy extends AuthCommand {
142142
? 'Schedule checks after deploy'
143143
: 'Checks will NOT be scheduled after deploy',
144144
preserveResources
145-
? 'Detach any resources removed from code, keeping them and their run history for management in the Checkly Webapp'
146-
: 'Delete any resources removed from code, losing their run history. Pass --preserve-resources to detach and keep them instead',
145+
? 'Keep any resources removed from code (and their run history) in your Checkly account, where you can manage them from the Checkly web app'
146+
: 'Delete any resources removed from code, losing their run history. Pass --preserve-resources to keep them in your Checkly account instead',
147147
],
148148
flags,
149149
classification: {
@@ -286,23 +286,26 @@ export default class Deploy extends AuthCommand {
286286
// would be permanently deleted and require an explicit confirmation.
287287
if (!preview && !preserveResources && !force) {
288288
let deletions: Array<{ resourceType: string, logicalId: string }> = []
289+
this.style.actionStart('Verifying deployed state')
289290
try {
290291
const { data: dryRunData } = await api.projects.deploy(
291292
{ ...projectPayload, repoInfo },
292293
{ dryRun: true, scheduleOnDeploy, preserveResources },
293294
)
294295
deletions = this.collectDeletions(dryRunData)
296+
this.style.actionSuccess()
295297
} catch (err: any) {
298+
this.style.actionFailure()
296299
this.style.longError(`Your project could not be deployed.`, err)
297300
this.exit(1)
298301
}
299302

300303
if (deletions.length) {
301-
this.log(chalk.bold.red('\nThe following resources were removed from code and will be DELETED, losing their run history:'))
304+
this.log(chalk.bold.red('The following resources were removed from code and will be DELETED, losing their run history:'))
302305
for (const { resourceType, logicalId } of deletions) {
303306
this.log(chalk.red(` ${PRETTY_RESOURCE_TYPES[resourceType] ?? resourceType}: ${logicalId}`))
304307
}
305-
this.log(chalk.yellow('\nPass --preserve-resources to detach and keep them (and their run history) instead.\n'))
308+
this.log(chalk.yellow('\nPass --preserve-resources to keep them (and their run history) in your Checkly account instead.\n'))
306309

307310
await this.confirmOrAbort({
308311
command: 'deploy',
@@ -497,7 +500,7 @@ export default class Deploy extends AuthCommand {
497500
output.push('')
498501
}
499502
if (sortedDetaching.length) {
500-
output.push(chalk.bold.yellow('Detached (kept in account, now managed in the Checkly Webapp):'))
503+
output.push(chalk.bold.yellow('Kept in your Checkly account (removed from code, now managed from the Checkly web app):'))
501504
for (const { resourceType, logicalId } of sortedDetaching) {
502505
output.push(` ${PRETTY_RESOURCE_TYPES[resourceType] ?? resourceType}: ${logicalId}`)
503506
}

packages/cli/src/rest/projects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class Projects {
389389
dryRun?: boolean
390390
scheduleOnDeploy?: boolean
391391
/**
392-
* Detach resources removed from code (keep them and their run history)
392+
* Keep resources removed from code (and their run history) in the account
393393
* instead of deleting them.
394394
*/
395395
preserveResources?: boolean

0 commit comments

Comments
 (0)