Closed TheIronDev closed 2 years ago
Generated CloudEvents will use user-provided Partial
bucket
will update:
data.bucket
source
, data.selfLink
, data.id
data.message.json
will:
data.message.data
data.message.data
still takes priority)If you called the wrap handler with {bucket: 'bucket2'}
...
Previously the returned CloudEvent
would look like:
{
bucket: 'bucket2',
data: {
bucket: 'bucket', // 'bucket' because the user never explicitly overwrote it
// ...
},
// ...
}
With this PR, it will look like:
{
bucket: 'bucket2',
data: {
bucket: 'bucket2', // inferred from the bucket
// ...
},
// ...
}
Description
The goal of this commit is to incorporate the user's partial into the generated CloudEvent.
All the AbstractFactories for Partial Cloud Events now return Cloud Events, and they all incorporate the user provided partial when creating the Mock Cloud Event..
Theres a few key benefits to this:
Although this is a "larger" change, the end-user contract remains intact.
This does fix several bugs. Output is different for PubSub, EventArc, and Storage.