From 8a13150f56519483c69a41c72f74b1fc57e15c96 Mon Sep 17 00:00:00 2001 From: Paul Roberts Date: Fri, 12 Apr 2024 11:11:14 -0700 Subject: [PATCH] Fixes from review comments --- ...mi-cli-to-fail-if-the-only-changes-are-output-changes.yaml | 2 +- pkg/cmd/pulumi/stack_history.go | 2 ++ pkg/engine/lifecycletest/pulumi_test.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) 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