Skip to content

use the same containment rules for concrete addresses (6/8) - #39353

Merged
jbardin merged 1 commit into
mainfrom
jbardin/target-patterns-F
Oct 9, 2026
Merged

jbardin merged 1 commit into
mainfrom
jbardin/target-patterns-F

Conversation

@jbardin

@jbardin jbardin commented Oct 7, 2026

Copy link
Copy Markdown
Member

Every Targetable address type now implements Contains with the same rules as target patterns. A concrete address only contains the instances it refers to, so a step without an instance key only contains the instance of a module call without count or for_each, rather than sometimes being treated as every instance. Containment is also consistent between address types, so a ModuleInstance can contain a ConfigAction, and AbsAction and AbsActionInstance only contain a ConfigAction when they select every instance of it, matching resources.

Targets given by users are always patterns now, so the special cases which interpreted concrete addresses as targets are no longer needed.

Nothing outside the package uses Targetable.AddrType any more, so AddrType and TargetableAddrType are removed. MoveEndpoint had borrowed TargetableAddrType to classify its endpoints, and now has its own private moveEndpointKind instead.

@jbardin jbardin added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Oct 7, 2026
@jbardin jbardin changed the title use the same containment rules for concrete addresses use the same containment rules for concrete addresses (6/8) Oct 7, 2026
@jbardin
jbardin force-pushed the jbardin/target-patterns-E branch from 3af93a7 to 1560520 Compare October 8, 2026 15:47
Every Targetable address type now implements Contains with the same
rules as target patterns. A concrete address only contains the instances
it refers to, so a step without an instance key only contains the
instance of a module call without count or for_each, rather than
sometimes being treated as every instance. Containment is also
consistent between address types, so a ModuleInstance can contain a
ConfigAction, and AbsAction and AbsActionInstance only contain a
ConfigAction when they select every instance of it, matching resources.

Targets given by users are always patterns now, so the special cases
which interpreted concrete addresses as targets are no longer needed.

Nothing outside the package uses Targetable.AddrType any more, so
AddrType and TargetableAddrType are removed. MoveEndpoint had borrowed
TargetableAddrType to classify its endpoints, and now has its own
private moveEndpointKind instead.
@jbardin
jbardin force-pushed the jbardin/target-patterns-F branch from cd2e048 to 321391d Compare October 8, 2026 15:56
@jbardin
jbardin marked this pull request as ready for review October 8, 2026 15:57
@jbardin
jbardin requested a review from a team as a code owner October 8, 2026 15:57
mildwonkey
mildwonkey previously approved these changes Oct 8, 2026

@mildwonkey mildwonkey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oooh, this is a shiny one ✨

Base automatically changed from jbardin/target-patterns-E to main October 9, 2026 13:06
@jbardin
jbardin dismissed mildwonkey’s stale review October 9, 2026 13:06

The base branch was changed.

@jbardin
jbardin merged commit 2503938 into main Oct 9, 2026
17 checks passed
@jbardin
jbardin deleted the jbardin/target-patterns-F branch October 9, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants