Skip to content

frigg doctor: Remove StackStatusFilter to show all stacks in interactive selection #504

@seanspeaks

Description

@seanspeaks

Problem

The frigg doctor command filters stacks by status when showing the interactive selection list, but this prevents users from diagnosing the stacks that need it most.

Current Filter (frigg-cli/doctor-command/index.js:180-185):

StackStatusFilter: [
    'CREATE_COMPLETE',
    'UPDATE_COMPLETE',
    'UPDATE_ROLLBACK_COMPLETE',
    'ROLLBACK_COMPLETE',
],

Issue: Stacks in failed/unhealthy states like UPDATE_ROLLBACK_FAILED, UPDATE_FAILED, CREATE_FAILED, etc. are filtered out of the interactive list, even though these are exactly the stacks that need health diagnostics.

Real-World Impact

When running frigg doctor without a stack name (to trigger interactive selection), a stack with status UPDATE_ROLLBACK_FAILED doesn't appear in the list. The user must already know the exact stack name to diagnose it, defeating the purpose of the interactive selection.

This is counterintuitive for a health-check tool designed to diagnose infrastructure problems.

Proposed Solution

Remove the StackStatusFilter entirely from the listStacks() function to show all stacks regardless of status.

Rationale:

  1. The doctor command is specifically designed to diagnose unhealthy infrastructure
  2. Failed stacks are the primary candidates for health checks
  3. Users should be able to interactively select any deployed stack
  4. The filter provides no real benefit - if a stack exists, it should be diagnosable
  5. Filtering by status creates a catch-22: unhealthy stacks can't be easily diagnosed

Alternative (if filtering is desired):

If status filtering is needed for some use case, consider:

  • Adding a --all flag to show all stacks including failed ones (default behavior)
  • Or inverting the logic: only filter out DELETE_COMPLETE stacks (which are gone)

Code Change Required

async function listStacks(region) {
    const client = new CloudFormationClient({ region });

    try {
-       const command = new ListStacksCommand({
-           StackStatusFilter: [
-               'CREATE_COMPLETE',
-               'UPDATE_COMPLETE',
-               'UPDATE_ROLLBACK_COMPLETE',
-               'ROLLBACK_COMPLETE',
-           ],
-       });
+       // Show all stacks - if it exists, it should be diagnosable
+       const command = new ListStacksCommand({});

        const response = await client.send(command);
        // ... rest of code

Or if you want to exclude only deleted stacks:

const command = new ListStacksCommand({
    StackStatusFilter: [
        // Include all states except DELETE_COMPLETE (stack is gone)
        'CREATE_IN_PROGRESS',
        'CREATE_FAILED',
        'CREATE_COMPLETE',
        'ROLLBACK_IN_PROGRESS',
        'ROLLBACK_FAILED',
        'ROLLBACK_COMPLETE',
        'DELETE_IN_PROGRESS',
        'DELETE_FAILED',
        'UPDATE_IN_PROGRESS',
        'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS',
        'UPDATE_COMPLETE',
        'UPDATE_ROLLBACK_IN_PROGRESS',
        'UPDATE_ROLLBACK_FAILED',
        'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS',
        'UPDATE_ROLLBACK_COMPLETE',
        'REVIEW_IN_PROGRESS',
        'IMPORT_IN_PROGRESS',
        'IMPORT_COMPLETE',
        'IMPORT_ROLLBACK_IN_PROGRESS',
        'IMPORT_ROLLBACK_FAILED',
        'IMPORT_ROLLBACK_COMPLETE',
    ],
});

Related Files

  • packages/devtools/frigg-cli/doctor-command/index.js (lines 175-199)

Environment

  • Frigg version: 2.0.0-next.0 (local link)
  • AWS SDK: @aws-sdk/client-cloudformation

Note: This issue was discovered when trying to diagnose a stack in UPDATE_ROLLBACK_FAILED state, which required manually typing the stack name instead of selecting it from the interactive list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions