-
Notifications
You must be signed in to change notification settings - Fork 174
Filter deleted resources in get_by_id repository methods #4793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Updated get_workspace_by_id to exclude deleted workspaces - Updated get_workspace_service_by_id to exclude deleted services - Updated get_user_resource_by_id to exclude deleted user resources - Updated get_shared_service_by_id to exclude deleted shared services - Added/updated unit tests to verify deleted resources are filtered - Updated CHANGELOG.md with bug fix entry Co-authored-by: marrobi <[email protected]>
api_app/tests_ma/test_db/test_repositories/test_shared_service_repository.py
Fixed
Show fixed
Hide fixed
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Unit Test Results668 tests 668 ✅ 7s ⏱️ Results for commit 71593ab. ♻️ This comment has been updated with latest results. |
|
@copilot update the API version |
Incremented API version from 0.25.6 to 0.25.7 for bug fix release. Added version update entry to CHANGELOG.md COMPONENTS section. Co-authored-by: marrobi <[email protected]>
|
api version will need upping again |
…ithub.com/microsoft/AzureTRE into copilot/fix-deleted-workspaces-url-access
JC-wk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this and deleted workspaces are no longer visible @marrobi
|
@tamirkamara are you able to look at this one? Thanks. |
|
🤖 pr-bot 🤖
(in response to this comment from @marrobi) |
|
/test-extended a3fc372 |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20956292168 (with refid (in response to this comment from @marrobi) |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20956292168 (with refid (in response to this comment from @marrobi) |
|
/test-extended a3fc372 |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20989307837 (with refid (in response to this comment from @marrobi) |
1 similar comment
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20989307837 (with refid (in response to this comment from @marrobi) |
|
/test-destroy-env |
|
Destroying branch test environment (RG: rg-tre0a48c21f)... (run: https://github.com/microsoft/AzureTRE/actions/runs/20994544513) |
|
Branch test environment destroy complete (RG: rg-tre0a48c21f) |
|
Destroying PR test environment (RG: rg-tre95c03b79)... (run: https://github.com/microsoft/AzureTRE/actions/runs/20994544513) |
|
PR test environment destroy complete (RG: rg-tre95c03b79) |
|
/test-extended f4febb0 |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20995310765 (with refid (in response to this comment from @marrobi) |
2 similar comments
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20995310765 (with refid (in response to this comment from @marrobi) |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/20995310765 (with refid (in response to this comment from @marrobi) |
|
/test-destroy-env |
|
Destroying branch test environment (RG: rg-tre0a48c21f)... (run: https://github.com/microsoft/AzureTRE/actions/runs/21032942381) |
|
Branch test environment destroy complete (RG: rg-tre0a48c21f) |
|
Destroying PR test environment (RG: rg-tre95c03b79)... (run: https://github.com/microsoft/AzureTRE/actions/runs/21032942381) |
|
PR test environment destroy complete (RG: rg-tre95c03b79) |
|
/test-extended 71593ab |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/21108169623 (with refid (in response to this comment from @tamirkamara) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marrobi I believe something not right here as the E2E consistently fail to delete workspaces.
What is being addressed
The
get_*_by_idmethods in repository classes return deleted resources, while list methods filter them out. This allows accessing deleted workspaces, workspace services, user resources, and shared services via direct URL after deletion.How is this addressed
Added
deploymentStatus != Status.Deletedfilter to allget_by_idqueries:WorkspaceRepository.get_workspace_by_id()WorkspaceServiceRepository.get_workspace_service_by_id()UserResourceRepository.get_user_resource_by_id()SharedServiceRepository.get_shared_service_by_id()Query pattern:
Updated unit tests to verify deleted resources raise
EntityDoesNotExist.Updated CHANGELOG.md with bug fix entry and component version update.
Incremented API version from 0.25.6 to 0.25.7.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.