Skip to content

Conversation

tgross
Copy link
Member

@tgross tgross commented Jul 24, 2025

The computeUpdate method returns 4 different values, some of which are just different shapes of the same data and only ever get used to be applied to the result in the caller. Move the mutation of the result into computeUpdates to match the work done in #26325. Clean up the return signature so that only slices we need downstream are returned, and fix the incorrect docstring.

Also fix a silent bug where the inplace set includes the original alloc and not the updated version. This has no functional change because all existing callers only ever look at the length of this slice, but it will prevent future bugs if that ever changes.

Ref: #26325
Ref: https://hashicorp.atlassian.net/browse/NMD-819

The `computeUpdate` method returns 4 different values, some of which are just
different shapes of the same data and only ever get used to be applied to the
result in the caller. Move the mutation of the result into `computeUpdates` to
match the work done in #26325. Clean up the return signature so that only slices
we need downstream are returned, and fix the incorrect docstring.

Also fix a silent bug where the `inplace` set includes the original alloc and
not the updated version. This has no functional change because all existing
callers only ever look at the length of this slice, but it will prevent future
bugs if that ever changes.

Ref: #26325
Ref: https://hashicorp.atlassian.net/browse/NMD-819
@tgross tgross added this to the 1.11.0 milestone Jul 24, 2025
@tgross tgross marked this pull request as ready for review July 24, 2025 14:51
@tgross tgross requested review from a team as code owners July 24, 2025 14:51
Copy link
Member

@mismithhisler mismithhisler left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgross tgross merged commit 26554e5 into main Jul 25, 2025
42 checks passed
@tgross tgross deleted the reconciler-mutation-computeUpdates branch July 25, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants