fix: logical groups from terravision.yml work when drawing from Terraform - #224
Merged
Merged
Conversation
…form An annotation that declared aws_group.<name> and connected resources to it drew an empty, squashed box. Three steps undid the user's group: - auto_group_by_type moved the Lambdas out of every group node, the user's included, into aws_group.aws_lambda_function and nested that inside it - reverse_relations treated the group's containment of the state machine (a FORCED_ORIGIN type) as an arrow and reversed it - on Azure, members also stayed in the resource group, which is drawn first and claims them, so the group box was empty Fix: - reverse_relations skips container nodes: their lists are containment - group_shared_services and auto_group_by_type leave alone resources that already sit in another group of the same type (a user group) - new graphmaker.place_annotation_groups, run last in the pipeline, takes members out of automatic groups (removing any left empty), nests the group in the innermost container its members share, and drops a member that also sits in a container outside the group, with a warning - LOGICAL_GROUP_NODES per provider names the generic box: aws_group, azurerm_group, tv_gcp_logical_group No expected-*.json changes. Docs: annotations guide gains a Group Resources section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrickchugh
added a commit
that referenced
this pull request
Oct 2, 2026
…-groups) Logical groups from terravision.yml in Terraform mode (PR #224), and rendering fixes: networks nest in region and account boxes, the title clears top-level boxes, labels keep repeated words the author chose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
A group added in
terravision.yml(aws_group,azurerm_grouportv_gcp_logical_group) is now drawn around its resources when drawing from Terraform. Before, the log said the group was applied, but the diagram showed an empty, squashed box and the resources stayed where they were.Root cause
Three later pipeline steps undid the annotation:
auto_group_by_type) took the Lambdas out of the user's group.reverse_relationstreated the group's containment of a Step Functions state machine (a "forced origin") as an arrow, and reversed it.Changes
reverse_relationsskips container nodes.auto_group_by_typeandgroup_shared_servicesleave alone resources that already sit in a user group.graphmaker.place_annotation_groups: it puts the group inside the innermost container its members share, and takes the members out of automatic groups. An automatic group left empty is not drawn. If a member also sits in a box the group is not inside, it stays there and a warning names it.<P>_LOGICAL_GROUP_NODES.docs/annotations.md: new "Group Resources" section with an example.Tests
tests/test_annotation_groups.py: 20 tests (unit tests, debug replays, and one slow test running a realterraform planon the Step Functions fixture with mock credentials).tests/json/expected-*.jsonchanged, and nothing underskills/changed.🤖 Generated with Claude Code