Commit Graph

2 Commits

Author SHA1 Message Date
Fraser Waters 6f21cac6f3
Make `engine.NewEvent` type safe ()
<!--- 
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
Fraser Waters 4d05b4c648 Move cancellation_scope to backend
This is needed for matrix testing where we need a cancellation scope
like a normal `up` but we don't want the matrix testing code to live in
cmd.
2023-05-09 13:01:42 +01:00