Skip to content

Fix review comments from Copilot code review on PR #4964 (airlock v2)#4995

Closed
rudolphjacksonm with Copilot wants to merge 9 commits into
mainfrom
copilot/fix-comments-review-thread-4964
Closed

Fix review comments from Copilot code review on PR #4964 (airlock v2)#4995
rudolphjacksonm with Copilot wants to merge 9 commits into
mainfrom
copilot/fix-comments-review-thread-4964

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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_account data source and azurerm_role_assignment in airlock_v2/storage_accounts.tf lacked provider = azurerm.core, causing failures in split-subscription deployments where workspace and core run in different subscriptions.
  • get_in_flight_v1_airlock_request_ids() passed AirlockRequestStatus enum objects as the @finalStatuses Cosmos SDK parameter — enums are not JSON-serializable, breaking the legacy airlock guard at startup.
  • docs/azure-tre-overview/airlock-legacy.md described airlock_version: 1 as "the default", contradicting the Terraform variable default of 2.
  • A CHANGELOG.md bug fix entry was missing its required PR reference link.
  • Comments in airlock.py incorrectly 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.core to data "azurerm_storage_account" and azurerm_role_assignment in airlock_v2/storage_accounts.tf.

  • Cosmos enum serialization — Converted enum list to string values before passing to the SDK:

    # Before
    {"name": "@finalStatuses", "value": self.FINAL_AIRLOCK_STATUSES}
    
    # After
    {"name": "@finalStatuses", "value": [s.value for s in self.FINAL_AIRLOCK_STATUSES]}
  • Docs correction — Removed "(the default)" from airlock-legacy.md; added a note clarifying that airlock_version: 2 is 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_stage comments; updated the SAS URL return comment to accurately state it is a direct blob service endpoint URL.

Copilot AI requested review from Copilot and removed request for Copilot July 23, 2026 10:26
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 requested review from Copilot and removed request for Copilot July 23, 2026 10:30
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
Copilot AI requested a review from rudolphjacksonm July 23, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants