diff --git a/changelog/pending/20240410--cli-engine--fixes-15564-expect-no-changes-now-causes-pulumi-cli-to-fail-if-the-only-changes-are-output-changes.yaml b/changelog/pending/20240410--cli-engine--fixes-15564-expect-no-changes-now-causes-pulumi-cli-to-fail-if-the-only-changes-are-output-changes.yaml index a586af96b20f..319c443c50f6 100644 --- a/changelog/pending/20240410--cli-engine--fixes-15564-expect-no-changes-now-causes-pulumi-cli-to-fail-if-the-only-changes-are-output-changes.yaml +++ b/changelog/pending/20240410--cli-engine--fixes-15564-expect-no-changes-now-causes-pulumi-cli-to-fail-if-the-only-changes-are-output-changes.yaml @@ -1,4 +1,4 @@ changes: - type: fix scope: cli/engine - description: "Fixes #15564, --expect-no-changes now causes pulumi cli to fail if the only changes are output changes" + description: "Make --expect-no-changes fail even if the only changes are output changes" diff --git a/pkg/cmd/pulumi/stack_history.go b/pkg/cmd/pulumi/stack_history.go index 7830e8e2fb70..c651f6ebadb0 100644 --- a/pkg/cmd/pulumi/stack_history.go +++ b/pkg/cmd/pulumi/stack_history.go @@ -163,6 +163,8 @@ func displayUpdatesJSON(updates []backend.UpdateInfo, decrypter config.Decrypter info.EndTime = makeStringRef(time.Unix(update.EndTime, 0).UTC().Format(timeFormat)) resourceChanges := make(map[string]int) for k, v := range update.ResourceChanges { + // Filter out the the OpOutputChange events because they are pseudo + // events that shouldn't be included in the stack history if k != deploy.OpOutputChange { resourceChanges[string(k)] = v } diff --git a/pkg/engine/lifecycletest/pulumi_test.go b/pkg/engine/lifecycletest/pulumi_test.go index aff71d57f0dc..574a6052b3e4 100644 --- a/pkg/engine/lifecycletest/pulumi_test.go +++ b/pkg/engine/lifecycletest/pulumi_test.go @@ -5720,10 +5720,10 @@ func TestOutputChanges(t *testing.T) { "frob": "baz", }) programF := deploytest.NewLanguageRuntimeF(func(_ plugin.RunInfo, monitor *deploytest.ResourceMonitor) error { - urn, _, _, _, err := monitor.RegisterResource("pkgA:m:typA", "resA", true, deploytest.ResourceOptions{}) + rrResp, err := monitor.RegisterResource("pkgA:m:typA", "resA", true, deploytest.ResourceOptions{}) assert.NoError(t, err) - err = monitor.RegisterResourceOutputs(urn, outs) + err = monitor.RegisterResourceOutputs(rrResp.URN, outs) assert.NoError(t, err) return nil