Fix review comments from Copilot code review on PR #4964 (airlock v2)#4995
Closed
rudolphjacksonm with Copilot wants to merge 9 commits into
Closed
Fix review comments from Copilot code review on PR #4964 (airlock v2)#4995rudolphjacksonm with Copilot wants to merge 9 commits into
rudolphjacksonm with Copilot wants to merge 9 commits into
Conversation
…rlock-storage-accounts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| from shared_code import constants | ||
|
|
||
|
|
||
| def get_storage_account_name_for_request(request_type: str, status: str, short_workspace_id: str, airlock_version: int = 1) -> str: |
| try: | ||
| full_review_ws_id = workspace.properties["airlock_review_config"]["import"]["import_vm_workspace_id"] | ||
| review_workspace_id = full_review_ws_id if airlock_request.airlock_version >= 2 else full_review_ws_id[-4:] | ||
| except (KeyError, TypeError): |
- Add provider = azurerm.core to data source and role assignment in airlock_v2/storage_accounts.tf to fix split-subscription deployments - Fix @finalStatuses enum serialization: convert to string values for Cosmos SDK JSON compatibility in airlock_requests.py - Fix incorrect 'default' claim in airlock-legacy.md (default is v2) - Add missing PR reference to CHANGELOG.md bug fix entry - Remove inaccurate 'via App GW/SAS' comments in airlock.py and update SAS URL comment to accurately describe direct storage account URLs
Copilot
AI
changed the title
[WIP] Fix code based on review comments for PR #4964
Fix review comments from Copilot code review on PR #4964 (airlock v2)
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses all 7 comments from the Copilot review thread on PR #4964, which introduced the consolidated airlock storage architecture.
What is being addressed
Several bugs and inaccuracies introduced by PR #4964:
azurerm_storage_accountdata source andazurerm_role_assignmentinairlock_v2/storage_accounts.tflackedprovider = azurerm.core, causing failures in split-subscription deployments where workspace and core run in different subscriptions.get_in_flight_v1_airlock_request_ids()passedAirlockRequestStatusenum objects as the@finalStatusesCosmos SDK parameter — enums are not JSON-serializable, breaking the legacy airlock guard at startup.docs/azure-tre-overview/airlock-legacy.mddescribedairlock_version: 1as "the default", contradicting the Terraform variable default of2.CHANGELOG.mdbug fix entry was missing its required PR reference link.airlock.pyincorrectly implied the SAS URL used an App Gateway FQDN for publicly accessible stages; the implementation returns a direct storage account blob URL.How is this addressed
Terraform provider pinning — Added
provider = azurerm.coretodata "azurerm_storage_account"andazurerm_role_assignmentinairlock_v2/storage_accounts.tf.Cosmos enum serialization — Converted enum list to string values before passing to the SDK:
Docs correction — Removed "(the default)" from
airlock-legacy.md; added a note clarifying thatairlock_version: 2is the default for new deployments.CHANGELOG — Added missing
([#4964](https://github.com/microsoft/AzureTRE/pull/4964))reference to the airlock import-review bug fix entry.Accurate comments — Removed misleading "via App GW/SAS" references from
is_publicly_accessible_stagecomments; updated the SAS URL return comment to accurately state it is a direct blob service endpoint URL.