pulumi/pkg
Will Jones bad2d9f6c2
Better handle property dependencies and `deletedWith` (#16088)
A resource `A` depends on a resource `B` if:

1. `B` is `A`'s `Provider`.
2. `B` is `A`'s `Parent`.
3. `B` appears in `A`'s `Dependencies`.
4. `B` appears in one or more of `A`'s `PropertyDependencies`.
5. `B` is referenced by `A`'s `DeletedWith` field.

While cases 1, 2, and 3 (providers, parents, and dependencies) are
handled fairly consistently, there have been a number of cases where the
newer features of `PropertyDependencies` (case 4) and `DeletedWith`
(case 5) have been neglected. This commit addresses some of these
omissions. Specifically:

* When refreshing state, it's important that we remove URNs that point
to resources that we've identified as deleted. Presently we check
pointers to parents and dependencies, but not property dependencies or
`deletedWith`. This commit fixes these gaps where dangling URNs could
lurk.

* Linked to the above, this commit extends snapshot integrity checks to
include property dependencies and `deletedWith`. Some tests that
previously used now invalid states have to be repaired or removed as a
  result of this.

* Fixing snapshot integrity checking reveals that dependency graph
checks also fail to consider property dependencies and `deletedWith`.
This probably hasn't bitten us since property dependencies are currently
rolled up into dependencies (for temporary backwards compatibility) and
`deletedWith` is typically an optimisation (moreover, one that only
matters during deletes), so operations being parallelised due a
perceived lack of dependency still succeed. However, tests that
previously passed now fail as we can spot these races with our better
integrity checks. This commit thus fixes up dependency graph
construction and bulks out its test suite to cover the new cases.

These bugs were discovered as part of the investigation into #16052,
though they may not be directly responsible for it (though the issues
with dependency graphs are certainly a candidate).
2024-05-03 17:08:06 +00:00
..
asset Move some asset code to pkg (#15162) 2024-01-17 11:30:37 +00:00
authhelpers Add tests for gcpauth pkg (#13926) 2023-09-13 11:27:03 +00:00
backend reenable parallelism in httpstate snapshot_test (#16114) 2024-05-03 11:49:14 +00:00
cmd/pulumi The `--expect-no-changes` flag checks for output diffs (#15903) 2024-05-01 18:30:49 +00:00
codegen Sort `requirements.txt` files when generating Python code (#16115) 2024-05-03 15:07:56 +00:00
display Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
engine Better handle property dependencies and `deletedWith` (#16088) 2024-05-03 17:08:06 +00:00
graph Adds a flag to graph command to insert fragment (#14858) 2024-01-08 22:03:08 +00:00
importer Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
operations Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
resource Better handle property dependencies and `deletedWith` (#16088) 2024-05-03 17:08:06 +00:00
secrets skip GCP tests if credentials are not set (#16032) 2024-04-23 08:25:14 +00:00
testing/integration upgrade to latest version of golangci-lint (#15977) 2024-04-19 06:20:33 +00:00
util Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +00:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
workspace Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +00:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod Changelog and go.mod updates for v3.115.0 (#16111) 2024-05-03 08:23:43 +00:00
go.sum Upgrade pulumi-yaml to 1.7.0 (#16082) 2024-04-30 11:32:16 +00:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.