Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/cli/tui/screens/deploy/useDeployFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
const identityKmsKeyArn = preSynthesized?.identityKmsKeyArn ?? preflight.identityKmsKeyArn;
const allCredentials = preSynthesized?.allCredentials ?? preflight.allCredentials;

const [preDeployDiffStep, setPreDeployDiffStep] = useState<Step>({
label: 'Computing diff changes...',
status: 'pending',
});
const [publishAssetsStep, setPublishAssetsStep] = useState<Step>({ label: 'Publish assets', status: 'pending' });
const [deployStep, setDeployStep] = useState<Step>({ label: 'Deploy to AWS', status: 'pending' });
const [diffStep, setDiffStep] = useState<Step>({ label: 'Run CDK diff', status: 'pending' });
Expand All @@ -144,6 +148,7 @@
const streamOutputsRef = useRef<Record<string, string> | null>(null);

const startDeploy = useCallback(() => {
setPreDeployDiffStep({ label: 'Computing diff changes...', status: 'pending' });
setPublishAssetsStep({ label: 'Publish assets', status: 'pending' });
setDeployStep({ label: 'Deploy to AWS', status: 'pending' });
setDeployOutput(null);
Expand Down Expand Up @@ -327,6 +332,8 @@
if (!isDiffRunningRef.current) {
isDiffRunningRef.current = true;
setIsDiffLoading(true);
setPreDeployDiffStep(prev => ({ ...prev, status: 'running' }));
logger.startStep('Computing diff changes...');
switchableIoHost?.setOnRawMessage((code, _level, message, data) => {
logger.logDiff(code, message);
if (code === 'CDK_TOOLKIT_I4002') {
Expand All @@ -345,6 +352,8 @@
switchableIoHost?.setOnRawMessage(null);
isDiffRunningRef.current = false;
setIsDiffLoading(false);
logger.endStep('success');
setPreDeployDiffStep(prev => ({ ...prev, status: 'success' }));
}
}

Expand Down Expand Up @@ -478,7 +487,7 @@
};

void run();
}, [

Check warning on line 490 in src/cli/tui/screens/deploy/useDeployFlow.ts

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'context?.projectSpec.agentCoreGateways?.length'. Either include it or remove the dependency array
preflight.phase,
cdkToolkitWrapper,
stackNames,
Expand Down Expand Up @@ -569,8 +578,10 @@
if (diffMode) {
return skipPreflight ? [diffStep] : [...preflight.steps, diffStep];
}
return skipPreflight ? [publishAssetsStep, deployStep] : [...preflight.steps, publishAssetsStep, deployStep];
}, [preflight.steps, publishAssetsStep, deployStep, diffStep, skipPreflight, diffMode]);
return skipPreflight
? [preDeployDiffStep, publishAssetsStep, deployStep]
: [...preflight.steps, preDeployDiffStep, publishAssetsStep, deployStep];
}, [preflight.steps, preDeployDiffStep, publishAssetsStep, deployStep, diffStep, skipPreflight, diffMode]);

const phase: DeployPhase = useMemo(() => {
const activeStep = diffMode ? diffStep : deployStep;
Expand Down
Loading