pulumi/pkg/backend
Fraser Waters 6f21cac6f3
Make `engine.NewEvent` type safe (#14590)
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
Small refactor I noticed while writing a test with engine events. We
always had to call `NewEvent` with the tag and payload value for an
event and these _had_ to match up else the engine panics. But we can
just pass the payload and type switch to work out the tag. Means one
less parameter to pass to `NewEvent` and pretty much no chance of it
going wrong. To ensure there's really no chance I've added a generic
union type so you can only pass payload types to this method now.

Cancel had to be handled separately because it doesn't have a payload
type, it's just nil.
2023-11-16 16:54:03 +00:00
..
display Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
filestate Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
httpstate Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
state [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
apply.go Policy remediations feature (#14080) 2023-10-09 18:31:17 +00:00
apply_test.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
backend.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
backend_test.go Replace PropertyValue type casts with method calls (#14538) 2023-11-12 20:10:47 +00:00
cancellation_scope.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go Add a link to docs for the 409 Conflict error message (#3207) 2019-09-10 13:25:08 -07:00
mock.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
policypack.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
query.go Replace result.Result in Query with error (#13939) 2023-09-20 15:43:46 +00:00
snapshot.go SameSteps can fail (#14076) 2023-10-13 11:13:22 +00:00
snapshot_test.go SameSteps can fail (#14076) 2023-10-13 11:13:22 +00:00
stack.go Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
updates.go Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
watch.go Don't pass a second SecretsProvider to backend.Watch 2023-05-08 20:38:40 +01:00