Restructure Airlock requests & add createdBy field#2779
Conversation
…s://github.com/microsoft/AzureTRE into jjgriff93/2765-bug-airlock_incorrect_initiator
|
/test |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3313797214 (with refid (in response to this comment from @jjgriff93) |
|
I understand the approach but if the longer term plan is to add an initiator field - shall we not just do that now? I'm also nervous about coupling any logic to the History array as we've previously discussed moving that out to a separate Cosmos collection, so this would have to be updated in that case. |
I don't think there's any plan to add an initiator field to all resource objects - what I discussed with Stuart was the potential of all resources having the field renamed from user to last_updated_by to avoid any confusion, but that's something that needs to be discussed as a bigger group as it affects the whole TRE API On the history array front yes that's true - the logic could be updated at a later date to fetch the history item but would involve a second call to the db by the API (although I imagine it would need to do this anyway) @damoodamoo Happy to go down the initiator field route if you think that backwards compatibility isn't an issue? i.e. requests created before this won't have an initiator field |
|
Not sure why we'd need to update all Resource types - as the Airlock Request is it's own model? The shape of it is very similar to a For existing requests we could add a migration which would move the top history item user to the initiator field - or we could not worry about it as I can't imagine there are many inflight requests that we need to worry about at this stage? @marrobi ? |
It's an extension of the Resource model (in the UI models) so inherits user from that - however discussed this on the standup this morning and have decided to go ahead and add the additional |
Added migrations to rename several airlock fields Migrate history[0].user to createdBy
|
Have reworked this as per our discussions:
|
|
/test |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3322722949 (with refid (in response to this comment from @jjgriff93) |
|
/test |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3324592277 (with refid (in response to this comment from @jjgriff93) |
damoodamoo
left a comment
There was a problem hiding this comment.
looks great + a much better shape of the object :)
|
/test |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3329913926 (with refid (in response to this comment from @jjgriff93) |
Resolves #2765
What is being addressed
This PR fixes the querying of airlock requests by the initiator of the request by adding a createdBy field to the requests as well as reworking several fields to be more descriptive
How is this addressed