arcade-services icon indicating copy to clipboard operation
arcade-services copied to clipboard

Add guardrails around classes like VmrInfo for their usage before initialization

Open dkurepa opened this issue 1 year ago • 1 comments

PCS supports multiple vmrs (dotnet/dotnet, dotnet-dotnet, maestro-test-vmr...). We create a scope for every job PCS processes. The issue with these two facts is that, at the time of creating the scope, we don't know which VMR the subscription wants to use. Because of this, we have classes like VmrCloneManager which are reponsible for making sure we use the correct VMR, and refreshing the metadata classes (VmrInfo, SourceManifest, etc..) with the current VMR data. The issue with this approach is that these metadata classes shouldn't be used before they're refreshed with the latest VMR data.

We want to add some kind of exception throwing guardrails that will help prevent incorrect usage of these classes

dkurepa avatar Nov 28 '24 15:11 dkurepa

@dkurepa I remember when we created this one but I am not sure what is the solution to this one. The only proper solution would be to do the VMR cloning at the same time when we're creating the DI scope for the work item. But I am not sure it will do more good than harm since figuring out what to clone and how already requires quite a bit of stuff to happen before then.

But I am open to ideas if you have any.

I'd say time box it and give the refactoring a go but also not a lot of priority on this one.

premun avatar Feb 14 '25 13:02 premun