Skip to content

fix: clarify cluster-stack listing behavior - #471

Open
shin0343 wants to merge 1 commit into
aws:mainfrom
shin0343:fix/348-cluster-stack-listing
Open

shin0343 wants to merge 1 commit into
aws:mainfrom
shin0343:fix/348-cluster-stack-listing

Conversation

@shin0343

Copy link
Copy Markdown

What's changing and why?

hyp list cluster-stack and HpClusterStack.list() return every CloudFormation stack in the account and Region, not only HyperPod-related stacks. The CLI help text, output header, and documentation incorrectly described the results as HyperPod-only (see #348).

This PR implements the minimal short-term fix suggested in the issue:

  • Corrects the CLI help text and usage examples
  • Updates the SDK docstring to document the actual behavior
  • Changes the output header from HyperPod Cluster Stacks to CloudFormation Stacks
  • Aligns the README, Read the Docs, and example notebooks
  • Fixes the invalid help example hyp list hyp-cluster → hyp list cluster-stack
  • Adds regression tests covering mixed HyperPod and unrelated stacks, plus help/behavior consistency

Tag-based filtering is intentionally not included:

  • CloudFormation ListStacks does not return stack tags
  • CLI-created stacks only carry user-provided tags, while Console-created and legacy stacks may be untagged
  • Stack-name-prefix filtering would miss valid HyperPod stacks and would silently change existing behavior

Existing behavior is unchanged: --region, --status, pagination, and the default exclusion of DELETE_COMPLETE stacks all work as before.

Before/After UX

Before:

$ hyp list cluster-stack
📋 HyperPod Cluster Stacks (2 found)
...

Help text claimed: "List all HyperPod cluster stacks."

After:

$ hyp list cluster-stack
📋 CloudFormation Stacks (2 found)
...

Help text now says: "List CloudFormation stacks in the current AWS account and Region." and explicitly notes that results are not filtered to HyperPod stacks.

How was this change tested?

  • tox -e unit (Python 3.11.15): 1249 passed, 19 warnings, coverage 80.11%
  • Targeted regression tests:
    pytest test/unit_tests/cli/test_cluster_stack.py test/unit_tests/cluster_management/test_hp_cluster_stack.py
    → 64 passed
  • Mocked CLI invocation verified that an unrelated CloudFormation stack appears in the output and that region_name and StackStatusFilter are still passed through to CloudFormation
  • git diff --check, notebook JSON validation, and a scoped git-secrets scan of the changed files passed

Not run in this environment:

  • Integration tests (require real AWS credentials and resources)
  • Sphinx documentation build (Sphinx is not installed locally)
  • Python 3.8/3.9/3.10 unit tests (only Python 3.11 is available locally)

Are unit tests added?

Yes.

  • test_list_cluster_stacks_includes_unrelated_cloudformation_stacks verifies that non-HyperPod stacks are returned and displayed.
  • test_list_cluster_stacks_help_describes_all_stacks verifies that the help text no longer claims HyperPod-only results.
  • The existing success test now asserts the corrected output header.

Are integration tests added?

No. This change only updates user-facing text, documentation, and unit tests; it does not change AWS API calls or filtering behavior.

Refs #348

hyp list cluster-stack and HpClusterStack.list() return all CloudFormation stacks in the account and Region, but the help text, output header, and documentation described them as HyperPod-only.

Clarify the behavior in the CLI help, SDK docstring, output header, README, Read the Docs, and example notebooks. Also fix the invalid `hyp list hyp-cluster` usage example and add regression tests covering mixed HyperPod and unrelated stacks plus help/behavior consistency.

Refs aws#348
@shin0343
shin0343 requested a review from a team as a code owner October 20, 2026 02:51
@shin0343
shin0343 deployed to manual-approval October 20, 2026 02:52 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
manual-approval — 52a971ea Deployed Oct 20, 2026 by shin0343 via wait-for-approval #823
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant