fix(cluster): exclude deleted instances from the overview instance count#1434
Open
dawsontoth wants to merge 1 commit into
Open
fix(cluster): exclude deleted instances from the overview instance count#1434dawsontoth wants to merge 1 commit into
dawsontoth wants to merge 1 commit into
Conversation
The managed-cluster overview header counted every entry in cluster.instances, including TERMINATING/TERMINATED/REMOVED ones. Filter with deletedClusterStatuses like the self-hosted overview and the Instances table already do, and pluralize to match. Closes #1432 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates ClusterHome.tsx to calculate the instance count by filtering out deleted instances and formats the output string to support singular and plural forms. The reviewer identified an issue where instances with an undefined status would be incorrectly excluded from the count and provided a code suggestion to fix this, while also advising that the same pattern be updated consistently across other components like SelfHostedClusterHome.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1432.
The managed-cluster overview header (
ClusterHome) renderedcluster.instances?.length, counting every instance including ones inTERMINATING/TERMINATED/REMOVEDstates. The self-hosted overview in the same file and the Instances table both already filter those out viadeletedClusterStatuses.This applies the same filter to the managed header's count, and pluralizes ("1 instance" vs "n instances") to match the self-hosted branch.
Verification: ran the worktree dev server against stage and opened the Anvils cluster overview. Injected two fake instances (
TERMINATED,REMOVED) into the react-query cache alongside the two realRUNNINGones (with a sentinel cluster name to prove the re-render happened from the mutated data): the header kept showing 2 instances while the sentinel name rendered — the old code would have shown 4. Full test suite (1240 tests), oxlint, and dprint pass.🤖 Generated with Claude Code