You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(planpreview): aggregate NoChange across plugin results in pipedv1 - #7673
Fixes buildApp in pkg/app/pipedv1/planpreview/builder.go to aggregate r.GetNoChange() across all plugin results using a local noChange := true variable and assign result.NoChange = noChange on success.
Adds unit tests (TestBuilder_buildApp_NoChange) covering:
all plugins reporting NoChange: true
mixed plugin NoChange results
plugin returning an error
Why we need it:
Previously, builder.go mutated r.NoChange = r.NoChange && result.GetNoChange() instead of updating result.NoChange. Because MakeApplicationPlanPreviewResult defaults NoChange to false, the application-level NoChange flag was always false.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unsupported-only or empty plugin responses can incorrectly report no resource changes despite no targets being previewed; the logic needs correction and regression coverage.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The builder can incorrectly mark an application as unchanged when another resource-changing plugin returns an unsupported or empty preview, hiding unpreviewed changes.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Unpreviewed resource changes can be reported as unchanged
pkg/app/pipedv1/planpreview/builder.go:319
If an unchanged preview is combined with Unimplemented or an empty response from another resource-changing plugin, this marks the whole application as unchanged without previewing all of its resources. For example, Cloud Run registers no preview service (pkg/app/pipedv1/plugin/cloudrun/main.go:26–31), so a mixed application can appear under “No resource changes were detected” despite unpreviewed Cloud Run changes. Keep NoChange false when resource-changing plugins lack preview results, and add mixed unchanged/unsupported and unchanged/empty tests.
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
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.
What this PR does:
buildAppinpkg/app/pipedv1/planpreview/builder.goto aggregater.GetNoChange()across all plugin results using a localnoChange := truevariable and assignresult.NoChange = noChangeon success.TestBuilder_buildApp_NoChange) covering:NoChange: trueNoChangeresultsWhy we need it:
Previously,
builder.gomutatedr.NoChange = r.NoChange && result.GetNoChange()instead of updatingresult.NoChange. BecauseMakeApplicationPlanPreviewResultdefaultsNoChangetofalse, the application-levelNoChangeflag was alwaysfalse.Which issue(s) this PR fixes:
Fixes #7672
Does this PR introduce a user-facing change?: