diff --git a/api_app/api/routes/airlock_resource_helpers.py b/api_app/api/routes/airlock_resource_helpers.py index e311a53345..f3ae0a8387 100644 --- a/api_app/api/routes/airlock_resource_helpers.py +++ b/api_app/api/routes/airlock_resource_helpers.py @@ -35,7 +35,7 @@ async def save_and_publish_event_airlock_request(airlock_request: AirlockRequest try: logging.debug(f"Sending status changed event for airlock request item: {airlock_request.id}") await send_status_changed_event(airlock_request) - await send_airlock_notification_event(airlock_request, role_assignment_details["researcher_emails"], role_assignment_details["owner_emails"]) + await send_airlock_notification_event(airlock_request, role_assignment_details) except Exception as e: airlock_request_repo.delete_item(airlock_request.id) logging.error(f"Failed sending status_changed message: {e}") @@ -58,7 +58,7 @@ async def update_and_publish_event_airlock_request(airlock_request: AirlockReque await send_status_changed_event(updated_airlock_request) access_service = get_access_service() role_assignment_details = access_service.get_workspace_role_assignment_details(workspace) - await send_airlock_notification_event(updated_airlock_request, role_assignment_details["researcher_emails"], role_assignment_details["owner_emails"]) + await send_airlock_notification_event(updated_airlock_request, role_assignment_details) return updated_airlock_request except Exception as e: logging.error(f"Failed sending status_changed message: {e}") @@ -70,12 +70,12 @@ def get_timestamp() -> float: def check_email_exists(role_assignment_details: defaultdict(list)): - if "researcher_emails" not in role_assignment_details or not role_assignment_details["researcher_emails"]: + if "WorkspaceResearcher" not in role_assignment_details or not role_assignment_details["WorkspaceResearcher"]: logging.error('Creating an airlock request but the researcher does not have an email address.') raise HTTPException(status_code=status.HTTP_417_EXPECTATION_FAILED, detail=strings.AIRLOCK_NO_RESEARCHER_EMAIL) - if "owner_emails" not in role_assignment_details or not role_assignment_details["owner_emails"]: - logging.error('Creating an airlock request but the workspace owner does not have an email address.') - raise HTTPException(status_code=status.HTTP_417_EXPECTATION_FAILED, detail=strings.AIRLOCK_NO_OWNER_EMAIL) + if "AirlockManager" not in role_assignment_details or not role_assignment_details["AirlockManager"]: + logging.error('Creating an airlock request but the airlock manager does not have an email address.') + raise HTTPException(status_code=status.HTTP_417_EXPECTATION_FAILED, detail=strings.AIRLOCK_NO_AIRLOCK_MANAGER_EMAIL) def get_airlock_requests_by_user_and_workspace(user: User, workspace: Workspace, airlock_request_repo: AirlockRequestRepository, diff --git a/api_app/event_grid/event_sender.py b/api_app/event_grid/event_sender.py index 6b3ed6b5ec..7fba8bcd0c 100644 --- a/api_app/event_grid/event_sender.py +++ b/api_app/event_grid/event_sender.py @@ -1,4 +1,6 @@ import logging +import re +from typing import Dict from azure.eventgrid import EventGridEvent from models.domain.events import StatusChangedData, AirlockNotificationData from event_grid.helpers import publish_event @@ -22,14 +24,15 @@ async def send_status_changed_event(airlock_request: AirlockRequest): await publish_event(status_changed_event, config.EVENT_GRID_STATUS_CHANGED_TOPIC_ENDPOINT) -async def send_airlock_notification_event(airlock_request: AirlockRequest, researchers_emails, owners_emails): +async def send_airlock_notification_event(airlock_request: AirlockRequest, emails: Dict): request_id = airlock_request.id status = airlock_request.status.value short_workspace_id = airlock_request.workspaceId[-4:] + snake_case_emails = {re.sub(r'(? + 1. Go to https://github.com/microsoft/AzureTRE/releases/new + 1. Click on `Choose a tag` and type a new one for you version. It should be in the form of `v0.9.2` - note the "v" in the begining. + 1. The release title should be just the version number "0.9.2" in the example above. + 1. Copy the text from the CHANGELOG.md file and paste in the release description. + 1. Include a final line with a link to the full changelog similar to this: + + **Full Changelog**: https://github.com/microsoft/AzureTRE/compare/v0.9.1...v0.9.2 diff --git a/mkdocs.yml b/mkdocs.yml index 0a0de4fa03..f564b5d67d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -128,6 +128,8 @@ nav: - GitHub Actions: tre-admins/setup-instructions/workflows.md - Azure DevOps: coming-soon.md + - Releases: tre-developers/release.md + - Troubleshooting FAQ: # General Troubleshooting Section for Development - troubleshooting-faq/index.md - Enabling Debugging for the API: troubleshooting-faq/debug-api.md diff --git a/templates/shared_services/airlock_notifier/app/AirlockNotifier/workflow.json b/templates/shared_services/airlock_notifier/app/AirlockNotifier/workflow.json index a224dfd31c..4752883022 100644 --- a/templates/shared_services/airlock_notifier/app/AirlockNotifier/workflow.json +++ b/templates/shared_services/airlock_notifier/app/AirlockNotifier/workflow.json @@ -47,25 +47,32 @@ "event_value": { "type": "string" }, - "owners_emails": { - "items": [ - { - "type": "string" - } - ], - "type": "array" - }, "request_id": { "type": "string" }, - "researchers_emails": { - "items": [ - { - "type": "string" - } - ], - "type": "array" - }, + "emails": { + "type": "object", + "properties": { + "workspace_researcher": { + "type": "array", + "items": { + "type": "string" + } + }, + "workspace_owner": { + "type": "array", + "items": { + "type": "string" + } + }, + "airlock_manager": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "workspace_id": { "type": "string" } @@ -132,7 +139,7 @@ "Set_recipients_as_researchers_emails": { "inputs": { "name": "recipients", - "value": "@body('Parse_JSON')?['data']?['researchers_emails']" + "value": "@body('Parse_JSON')?['data']?['emails']?['workspace_researcher']" }, "runAfter": {}, "type": "SetVariable" @@ -157,7 +164,7 @@ "Set_recipients_as_owners_emails": { "inputs": { "name": "recipients", - "value": "@body('Parse_JSON')?['data']?['owners_emails']" + "value": "@body('Parse_JSON')?['data']?['emails']?['airlock_manager']" }, "runAfter": {}, "type": "SetVariable"