Skip to content
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

Add filtering to list Airlock requests #2433

Conversation

yuvalyaron
Copy link
Collaborator

@yuvalyaron yuvalyaron commented Aug 9, 2022

Resolves #2332

What is being addressed

  • Added the following filters to the "get all Airlock requests" endpoint:

    • initiator - ID of the user that created the request
    • type - Airlock request type
    • status - Airlock request status
    • awaiting_my_review - when sent, will return requests that are pending the user's review
  • Added a list of allowed actions (out of 'cancel' and 'review') that the user can do on the request, to every request in the response.

How is this addressed

  • Added the specified filters to the endpoint as query parameters
  • Attached a list with the allowed actions to every request. The values in the list are affected by the requesting user and the state of the request - for instance, a user might be able to cancel a 'draft' request, but not review it, even if their role allows reviewing

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

Unit Test Results

500 tests  +498   498 ✔️ +498   11s ⏱️ -11s
    1 suites ±    0       2 💤 +    2 
    1 files   ±    0       0  -     2 

Results for commit 118b7b2. ± Comparison against base commit 22545c4.

This pull request removes 2 and adds 500 tests. Note that renamed tests count towards both.
test_workspace_airlock ‑ test_airlock_import_flow
test_workspace_services ‑ test_create_guacamole_service_into_base_workspace
tests_ma.test_api.test_errors.test_422_error ‑ test_frw_validation_error_format
tests_ma.test_api.test_errors.test_error ‑ test_frw_validation_error_format
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireAirlockManagerRights ‑ test_post_create_airlock_review_approves_airlock_request_returns_200
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireAirlockManagerRights ‑ test_post_create_airlock_review_input_is_malformed_returns_400
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireAirlockManagerRights ‑ test_post_create_airlock_review_with_event_grid_not_responding_returns_503
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireAirlockManagerRights ‑ test_post_create_airlock_review_with_illegal_status_change_returns_400
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireAirlockManagerRights ‑ test_post_create_airlock_review_with_state_store_endpoint_not_responding_returns_503
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireOwnerOrResearcherRights ‑ test_get_airlock_container_link_cancelled_request_returns_400
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireOwnerOrResearcherRights ‑ test_get_airlock_container_link_in_progress_request_returns_400
tests_ma.test_api.test_routes.test_airlock.TestAirlockRoutesThatRequireOwnerOrResearcherRights ‑ test_get_airlock_container_link_no_airlock_request_found_returns_404
…

♻️ This comment has been updated with latest results.

…t can also send 'awaiting_my_review' parameter to 'get_airlock_requests_by_user_and_workspace'
…alyaron-feature/2271-add-filtering-to-list-airlock-requests
@yuvalyaron yuvalyaron marked this pull request as ready for review August 10, 2022 15:12
@yuvalyaron yuvalyaron requested review from ross-p-smith, jjgriff93 and anatbal and removed request for ross-p-smith August 10, 2022 15:13
Copy link
Contributor

@anatbal anatbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe it's a little too complicated - I am not following we we need to add that much new models and modify existing ones...

api_app/api/routes/airlock.py Outdated Show resolved Hide resolved
api_app/api/routes/airlock_resource_helpers.py Outdated Show resolved Hide resolved
api_app/api/routes/airlock.py Outdated Show resolved Hide resolved
api_app/api/routes/airlock.py Show resolved Hide resolved
@guybartal guybartal requested review from anatbal and guybartal August 11, 2022 10:20
api_app/api/routes/airlock_resource_helpers.py Outdated Show resolved Hide resolved
api_app/models/schemas/airlock_request.py Outdated Show resolved Hide resolved
@yuvalyaron yuvalyaron requested a review from guybartal August 14, 2022 13:26
api_app/models/domain/airlock_request.py Show resolved Hide resolved
api_app/models/schemas/airlock_request.py Show resolved Hide resolved
api_app/models/schemas/airlock_request.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@guybartal guybartal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuvalyaron
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/2856171128 (with refid 551bb0b6)

(in response to this comment from @yuvalyaron)

1 similar comment
@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/2856171128 (with refid 551bb0b6)

(in response to this comment from @yuvalyaron)

@yuvalyaron
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/2859122482 (with refid 551bb0b6)

(in response to this comment from @yuvalyaron)

@yuvalyaron
Copy link
Collaborator Author

/help

@github-actions
Copy link

🤖 pr-bot 🤖

Hello!

You can use the following commands:
    /test - build, deploy and run smoke tests on a PR
    /test-extended - build, deploy and run smoke & extended tests on a PR
    /test-extended-aad - build, deploy and run smoke & extended AAD tests on a PR
    /test-shared-services - test the deployment of shared services on a PR build
    /test-force-approve - force approval of the PR tests (i.e. skip the deployment checks)
    /test-destroy-env - delete the validation environment for a PR (e.g. to enable testing a deployment from a clean start after previous tests)
    /help - show this help

(in response to this comment from @yuvalyaron)

@yuvalyaron
Copy link
Collaborator Author

/test-destroy-env

@github-actions
Copy link

Destroying PR test environment (RG: rg-tre551bb0b6)... (run: https://github.com/microsoft/AzureTRE/actions/runs/2859834075)

@github-actions
Copy link

PR test environment destroy complete (RG: rg-tre551bb0b6)

@yuvalyaron
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/2860336725 (with refid 551bb0b6)

(in response to this comment from @yuvalyaron)

@yuvalyaron yuvalyaron merged commit 2eeab96 into microsoft:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filtering to list airlock requests API
4 participants