Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into friel/block-reverse…
Browse files Browse the repository at this point in the history
…-merge
  • Loading branch information
AaronFriel committed Nov 8, 2022
2 parents d14f084 + 83c9dfc commit d9460b9
Show file tree
Hide file tree
Showing 154 changed files with 311,510 additions and 1,571 deletions.
2 changes: 1 addition & 1 deletion .version
@@ -1 +1 @@
3.46.0
3.46.1
26 changes: 26 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,31 @@
# Changelog

## 3.46.0 (2022-11-02)


### Features

- [programgen/{dotnet,go,java,nodejs,python}] Support a logical name for config vars
[#11231](https://github.com/pulumi/pulumi/pull/11231)

- [sdk/dotnet] Make the `LocalSerializer` class public.
[#11106](https://github.com/pulumi/pulumi/pull/11106)

- [sdk/yaml] [Updates Pulumi YAML to v1.0.0](https://github.com/pulumi/pulumi-yaml/releases/tag/v1.0.0) containing runtime support for external config.
[#11222](https://github.com/pulumi/pulumi/pull/11222)


### Bug Fixes

- [engine] Fix a bug in update plans handling resources being replaced due to other resources being deleted before replacement.
[#11009](https://github.com/pulumi/pulumi/pull/11009)

- [engine] Pending deletes are no longer executed before everything else. This correctly handles dependencies for resource graphs that were partially deleted.
[#11027](https://github.com/pulumi/pulumi/pull/11027)

- [engine] Expand duplicate URN checks across direct URNs and aliases.
[#11212](https://github.com/pulumi/pulumi/pull/11212)

## 3.45.0 (2022-10-31)


Expand Down
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -33,7 +33,7 @@ ensure: .ensure.phony go.ensure $(SUB_PROJECTS:%=%_ensure)
@touch .ensure.phony

.PHONY: build-proto
PROTO_FILES := $(sort $(wildcard proto/**/*.proto) proto/generate.sh $(wildcard proto/build-container/**/*))
PROTO_FILES := $(sort $(shell find proto/ -type f -name '*.proto') proto/generate.sh proto/build-container/Dockerfile $(wildcard proto/build-container/scripts/*))
build-proto:
@printf "Protobuffer interfaces are ....... "
@if [ "$$(cat proto/.checksum.txt)" = "$$(cksum $(PROTO_FILES))" ]; then \
Expand Down Expand Up @@ -171,6 +171,7 @@ schema-%: curl.ensure jq.ensure
# As a courtesy to reviewers, please make changes to this list and the committed schema files in a
# separate commit from other changes, as online code review tools may balk at rendering these diffs.
get_schemas: \
schema-aws!4.15.0 \
schema-aws!4.26.0 \
schema-aws!4.36.0 \
schema-aws!4.37.1 \
Expand Down
4 changes: 0 additions & 4 deletions changelog/pending/20221013--engine--update-plan-dbr.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/pending/20221014--engine--pending-deletes.yaml

This file was deleted.

@@ -0,0 +1,4 @@
changes:
- type: feat
scope: pkg
description: Add `DeletedWith` as a resource option.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdk/python
description: Handle None being passed to register_resource_outputs.

This file was deleted.

@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdkgen/go
description: Allow resource names that conflict with additional types.
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdkgen/go
description: Guard against conflicting field names.
9 changes: 7 additions & 2 deletions pkg/backend/apply.go
Expand Up @@ -220,12 +220,14 @@ func PreviewThenPromptThenExecute(ctx context.Context, kind apitype.UpdateKind,
return changes, res
}

// If we had an original plan use it, else use the newly generated plan (might be nil if we've turned
// If we had an original plan use it, else if experimental use the newly generated plan (might be nil if we've turned
// plan generation off)
if originalPlan != nil {
op.Opts.Engine.Plan = originalPlan
} else {
} else if op.Opts.Engine.Experimental {
op.Opts.Engine.Plan = plan
} else {
op.Opts.Engine.Plan = nil
}
}

Expand All @@ -235,6 +237,9 @@ func PreviewThenPromptThenExecute(ctx context.Context, kind apitype.UpdateKind,
DryRun: false,
ShowLink: true,
}
// No need to generate a plan at this stage, there's no way for the system or user to extract the plan
// after here.
op.Opts.Engine.GeneratePlan = false
_, changes, res := apply(ctx, kind, stack, op, opts, nil /*events*/)
return changes, res
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/backend/backend.go
Expand Up @@ -258,8 +258,6 @@ type UpdateOptions struct {
AutoApprove bool
// SkipPreview, when true, causes the preview step to be skipped.
SkipPreview bool
// GeneratePlan when true cause plans to be generated.
GeneratePlan bool
}

// QueryOptions configures a query to operate against a backend and the engine.
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/display/json.go
Expand Up @@ -85,7 +85,7 @@ func stateForJSONOutput(s *resource.State, opts Options) *resource.State {
return resource.NewState(s.Type, s.URN, s.Custom, s.Delete, s.ID, inputs,
outputs, s.Parent, s.Protect, s.External, s.Dependencies, s.InitErrors, s.Provider,
s.PropertyDependencies, s.PendingReplacement, s.AdditionalSecretOutputs, s.Aliases, &s.CustomTimeouts,
s.ImportID, s.RetainOnDelete)
s.ImportID, s.RetainOnDelete, s.DeletedWith)
}

// ShowJSONEvents renders incremental engine events to stdout.
Expand Down
6 changes: 6 additions & 0 deletions pkg/backend/snapshot.go
Expand Up @@ -231,6 +231,12 @@ func (ssm *sameSnapshotMutation) mustWrite(step *deploy.SameStep) bool {
return true
}

// If the DeletedWith attribute of this resource has changed, we must write the checkpoint.
if old.DeletedWith != new.DeletedWith {
logging.V(9).Infof("SnapshotManager: mustWrite() true because of DeletedWith")
return true
}

// If the protection attribute of this resource has changed, we must write the checkpoint.
if old.Protect != new.Protect {
logging.V(9).Infof("SnapshotManager: mustWrite() true because of Protect")
Expand Down
8 changes: 4 additions & 4 deletions pkg/backend/snapshot_test.go
Expand Up @@ -603,7 +603,7 @@ func TestDeletion(t *testing.T) {
})

manager, sp := MockSetup(t, snap)
step := deploy.NewDeleteStep(nil, resourceA)
step := deploy.NewDeleteStep(nil, map[resource.URN]bool{}, resourceA)
mutation, err := manager.BeginMutation(step)
if !assert.NoError(t, err) {
t.FailNow()
Expand All @@ -629,7 +629,7 @@ func TestFailedDelete(t *testing.T) {
})

manager, sp := MockSetup(t, snap)
step := deploy.NewDeleteStep(nil, resourceA)
step := deploy.NewDeleteStep(nil, map[resource.URN]bool{}, resourceA)
mutation, err := manager.BeginMutation(step)
if !assert.NoError(t, err) {
t.FailNow()
Expand Down Expand Up @@ -802,7 +802,7 @@ func TestRecordingDeleteSuccess(t *testing.T) {
resourceA,
})
manager, sp := MockSetup(t, snap)
step := deploy.NewDeleteStep(nil, resourceA)
step := deploy.NewDeleteStep(nil, map[resource.URN]bool{}, resourceA)
mutation, err := manager.BeginMutation(step)
if !assert.NoError(t, err) {
t.FailNow()
Expand Down Expand Up @@ -834,7 +834,7 @@ func TestRecordingDeleteFailure(t *testing.T) {
resourceA,
})
manager, sp := MockSetup(t, snap)
step := deploy.NewDeleteStep(nil, resourceA)
step := deploy.NewDeleteStep(nil, map[resource.URN]bool{}, resourceA)
mutation, err := manager.BeginMutation(step)
if !assert.NoError(t, err) {
t.FailNow()
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/pulumi/destroy.go
Expand Up @@ -246,6 +246,7 @@ func newDestroyCmd() *cobra.Command {
DisableProviderPreview: disableProviderPreview(),
DisableResourceReferences: disableResourceReferences(),
DisableOutputValues: disableOutputValues(),
Experimental: hasExperimentalCommands(),
}

_, res := s.Destroy(ctx, backend.UpdateOperation{
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/pulumi/import.go
Expand Up @@ -513,6 +513,7 @@ func newImportCmd() *cobra.Command {
Parallel: parallel,
Debug: debug,
UseLegacyDiff: useLegacyDiff(),
Experimental: hasExperimentalCommands(),
}

_, res := s.Import(ctx, backend.UpdateOperation{
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/pulumi/preview.go
Expand Up @@ -231,6 +231,7 @@ func newPreviewCmd() *cobra.Command {
// If we're trying to save a plan then we _need_ to generate it. We also turn this on in
// experimental mode to just get more testing of it.
GeneratePlan: hasExperimentalCommands() || planFilePath != "",
Experimental: hasExperimentalCommands(),
},
Display: displayOpts,
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/pulumi/query.go
Expand Up @@ -66,7 +66,9 @@ func newQueryCmd() *cobra.Command {
return result.FromError(err)
}

opts.Engine = engine.UpdateOptions{}
opts.Engine = engine.UpdateOptions{
Experimental: hasExperimentalCommands(),
}

res := b.Query(ctx, backend.QueryOperation{
Proj: proj,
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/pulumi/refresh.go
Expand Up @@ -257,6 +257,7 @@ func newRefreshCmd() *cobra.Command {
DisableResourceReferences: disableResourceReferences(),
DisableOutputValues: disableOutputValues(),
RefreshTargets: deploy.NewUrnTargets(targetUrns),
Experimental: hasExperimentalCommands(),
}

changes, res := s.Refresh(ctx, backend.UpdateOperation{
Expand Down
8 changes: 5 additions & 3 deletions pkg/cmd/pulumi/up.go
Expand Up @@ -157,9 +157,10 @@ func newUpCmd() *cobra.Command {
DisableOutputValues: disableOutputValues(),
UpdateTargets: deploy.NewUrnTargets(targetURNs),
TargetDependents: targetDependents,
// If we're in experimental mode then we trigger a plan to be generated during the preview phase
// which will be constrained to during the update phase.
GeneratePlan: hasExperimentalCommands(),
// Trigger a plan to be generated during the preview phase which can be constrained to during the
// update phase.
GeneratePlan: true,
Experimental: hasExperimentalCommands(),
}

if planFilePath != "" {
Expand Down Expand Up @@ -362,6 +363,7 @@ func newUpCmd() *cobra.Command {
// If we're in experimental mode then we trigger a plan to be generated during the preview phase
// which will be constrained to during the update phase.
GeneratePlan: hasExperimentalCommands(),
Experimental: hasExperimentalCommands(),
}

// TODO for the URL case:
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/pulumi/watch.go
Expand Up @@ -137,6 +137,7 @@ func newWatchCmd() *cobra.Command {
DisableProviderPreview: disableProviderPreview(),
DisableResourceReferences: disableResourceReferences(),
DisableOutputValues: disableOutputValues(),
Experimental: hasExperimentalCommands(),
}

res := s.Watch(ctx, backend.UpdateOperation{
Expand Down
8 changes: 4 additions & 4 deletions pkg/codegen/docs/templates/function.tmpl
Expand Up @@ -94,10 +94,10 @@ func </span>{{ .FunctionName.go }}Output<span class="p">(</span>{{ htmlSafe .Fun
<!-- YAML -->
<div>
<pulumi-choosable type="language" values="yaml">
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="k">Fn::Invoke:</span>
<span class="k">&nbsp;&nbsp;Function:</span> {{ .FunctionName.yaml }}
<span class="k">&nbsp;&nbsp;Arguments:</span>
<span class="c">&nbsp;&nbsp;&nbsp;&nbsp;# Arguments dictionary</span></code></pre></div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="k">fn::invoke:</span>
<span class="k">&nbsp;&nbsp;function:</span> {{ .FunctionName.yaml }}
<span class="k">&nbsp;&nbsp;arguments:</span>
<span class="c">&nbsp;&nbsp;&nbsp;&nbsp;# arguments dictionary</span></code></pre></div>
</pulumi-choosable>
</div>

Expand Down

0 comments on commit d9460b9

Please sign in to comment.