Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.53k stars 296 forks source link

Enable DTFx.AzureStorage v1.x backward compatibility support #1120

Closed nytian closed 5 months ago

nytian commented 5 months ago

DTFx.AzureStorage v1.x and v2.x use different Azure Storage SDK versions, each with its own encoding method. This PR adds backward compatibility to DTFx.AzureStorage v1.x, ensuring that queue messages created with DTFx.AS v2 remain readable after downgrading to DTFx.AS v1.

The RawProperty is an internal attribute of CloudQueueMessage, and we use System.Reflection to access it. The included catch block should only be triggered in the scenario described above.

End-to-End tests have been done.

nytian commented 5 months ago

Some minor feedback. @nytian - Given this created an outage, I think we should have an automated test for this, either a unit test, or an E2E test. I think an E2E test, written as a github action, might be simplest. We just need to populate a DTFx. v1 queue with a DTFx v2 message, and see that it is able to be processed by DTFx.AS v1

@davidmrdavid Thanks for the review! I wonder what do you mean by a E2E test within GitHub actions? You want me to add a new folder/file that include the e2e test and add it to our workflow?

davidmrdavid commented 5 months ago

@nytian - actually, let me take that back - I just realized that writing this E2E test will be difficult for DTFx.AS V1 since DTFx.AS V1 doesn't work well with Azurite.

For now - don't worry about this. I trust your manual test, let's just make a note to perform another one right before release.