Skip to content

Comments

fix: improve stack error detection and prevent verbose mode hang#13196

Merged
czubocha merged 3 commits intomainfrom
sc-3709
Jan 7, 2026
Merged

fix: improve stack error detection and prevent verbose mode hang#13196
czubocha merged 3 commits intomainfrom
sc-3709

Conversation

@czubocha
Copy link
Contributor

@czubocha czubocha commented Dec 22, 2025

Closes #12770
Closes #13181


Summary

This Pull Request enhances the monitoring logic of AWS CloudFormation stacks in the monitor-stack.js file and adds comprehensive unit tests for various stack monitoring scenarios in monitor-stack.test.js.

Main Changes:

  • Enhanced stack monitoring logic:
    • Detects an additional error scenario for DELETE_IN_PROGRESS under specific conditions (e.g., when it's not a delete action).
    • Improved handling of CloudFormation stack statuses like CREATE_FAILED, UPDATE_FAILED, and ROLLBACK_COMPLETE, along with validation for nested stack updates.
  • New unit tests:
    • Introduced detailed test cases for monitorStack to verify correct behavior in various scenarios (e.g., CREATE_FAILED, DELETE_COMPLETE, and nested stack status handling).
    • Validates behavior under verbose mode and with exceptional cases (e.g., stack not found or resource-level errors).
    • Mocked external dependencies to ensure test isolation.

@Mmarzex
Copy link
Contributor

Mmarzex commented Dec 22, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances AWS CloudFormation stack monitoring to fix hanging issues in verbose mode and improve error detection. It adds logic to detect DELETE_IN_PROGRESS as an error condition during create/update actions and expands terminal status checks to include CREATE_FAILED and UPDATE_FAILED.

  • Adds detection of stack-level DELETE_IN_PROGRESS as an error during non-delete operations
  • Expands verbose mode terminal status checks to include CREATE_FAILED and UPDATE_FAILED
  • Adds comprehensive unit tests covering various stack monitoring scenarios including error cases and verbose mode behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/serverless/lib/plugins/aws/lib/monitor-stack.js Enhanced error detection logic and expanded terminal status checks for verbose mode
packages/serverless/test/unit/lib/plugins/aws/lib/monitor-stack.test.js Added comprehensive unit tests for various stack monitoring scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@czubocha czubocha requested a review from eahefnawy December 22, 2025 23:09
eahefnawy
eahefnawy previously approved these changes Dec 24, 2025
@czubocha czubocha merged commit c3aa88a into main Jan 7, 2026
10 checks passed
@czubocha czubocha deleted the sc-3709 branch January 7, 2026 15:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

3 participants