From 6a6adc2d978c2772582248197733865bd307478f Mon Sep 17 00:00:00 2001 From: kuntal1461 Date: Fri, 28 Aug 2026 02:08:10 +0530 Subject: [PATCH] fix: correct fire-and-forget example in apify push --help The --help example showed `apify push --no-wait-for-finish`, but that flag was never registered. The framework strips the no- prefix at parseArgs registration time, so a boolean no-wait-for-finish flag would conflict with the existing wait-for-finish string flag and cannot exist alongside it. The correct fire-and-forget form -- already documented in the flag description -- is --wait-for-finish=0. Adds a regression test that asserts the working form appears in the rendered help and the broken form does not. Closes #1342 --- src/commands/actors/push.ts | 4 ++-- test/local/lib/command-framework/help.test.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index d2d2c546a..2bd0ddecc 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -145,8 +145,8 @@ export class ActorsPushCommand extends ApifyCommand { command: 'apify push E2jjCZBezvAZnX8Rb --force', }, { - description: 'Deploy without waiting for the build to finish.', - command: 'apify push --no-wait-for-finish', + description: 'Deploy without waiting for the build to finish (fire-and-forget).', + command: 'apify push --wait-for-finish=0', }, ]; diff --git a/test/local/lib/command-framework/help.test.ts b/test/local/lib/command-framework/help.test.ts index 778f407b4..8bc3eb2d0 100644 --- a/test/local/lib/command-framework/help.test.ts +++ b/test/local/lib/command-framework/help.test.ts @@ -1,6 +1,7 @@ /* eslint-disable max-classes-per-file */ import stripAnsi from 'strip-ansi'; +import { ActorsPushCommand } from '../../../../src/commands/actors/push.js'; import { ApifyCommand, type BuiltApifyCommand as _BuiltApifyCommand, @@ -139,6 +140,14 @@ describe('Help rendering', () => { expect(output).toContain('# Abort a running Actor gracefully.'); expect(output).toContain('$ apify runs abort '); }); + + test('renders a valid fire-and-forget example for apify push', () => { + registerCommandForHelpGeneration('apify', ActorsPushCommand); + const output = stripAnsi(renderHelpForCommand(ActorsPushCommand)); + + expect(output).toContain('$ apify push --wait-for-finish=0'); + expect(output).not.toContain('--no-wait-for-finish'); + }); }); describe('CommandWithSubcommandsHelp.render()', () => {