Skip to content

[ManagedCleanroom] Add --subdirectory parameter for dataset publish#9852

Merged
necusjz merged 1 commit intoAzure:mainfrom
imddanish:feature/managedcleanroom-blobfuse-subdirectory
May 8, 2026
Merged

[ManagedCleanroom] Add --subdirectory parameter for dataset publish#9852
necusjz merged 1 commit intoAzure:mainfrom
imddanish:feature/managedcleanroom-blobfuse-subdirectory

Conversation

@imddanish
Copy link
Copy Markdown
Contributor

@imddanish imddanish commented May 6, 2026

Related command

az managedcleanroom frontend analytics dataset publish

Description

Adds a new --subdirectory parameter to the dataset publish command, providing parity with the upstream cleanroom extension's blobfuse subdirectory feature. The new field lets data owners restrict the mounted blobfuse view to a subtree of the storage container (e.g. year=2026/month=05) instead of mounting the entire container.

Changes

  • _params.py — Adds the --subdirectory argument to the managedcleanroom frontend analytics dataset publish argument context.
  • _frontend_custom.py — Accepts the new parameter and propagates it into the request body's store.subdirectory property when set. Encryption-mode compatibility is enforced by the service, so no CLI-side restriction is added — this keeps the CLI forward-compatible with future service-side relaxations without requiring an extension update.
  • _help.py — Documents the new parameter and adds an example showing dataset publish with --subdirectory.
  • analytics_frontend_api/operations/_operations.py + aio/operations/_operations.py — Auto-generated SDK updated to include subdirectory in the store JSON dict templates (sync + async). The change matches what a fresh autorest regen produces from the updated upstream frontend.yaml; only the substantive subdirectory delta is included to avoid unrelated cosmetic churn from the team's SDK post-processing.
  • tests/latest/test_frontend_dataset.py — Two new unit tests:
    test_publish_dataset_with_subdirectory — verifies subdirectory propagation into the request body's store.
    test_publish_dataset_subdirectory_default_omitted — verifies the field is omitted when not provided.
  • HISTORY.rst — Added 1.0.0b6 changelog entry.
  • setup.py — Bumped extension version 1.0.0b51.0.0b6.

Validation

  • azdev style managedcleanroom — Pylint + Flake8 PASSED
  • python scripts/ci/test_index.py -q — OK
  • ✅ All 56 unit tests pass (54 existing + 2 new)

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)

About CLI version requirement

  • Does the PR requires a new CLI core version? (No — uses existing analytics_frontend_api SDK with raw JSON request body path)
  • If yes, do you have a label of CLI Version Required and have you updated azext_metadata.json in your extension to refer to a new CLI core version?

About Extension Publish

  • Have you updated the version of setup.py?
  • Have you updated HISTORY.rst?
  • Note: src/index.json is auto-updated post-merge — not modified in this PR.

Copilot AI review requested due to automatic review settings May 6, 2026 16:06
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 6, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️managedcleanroom
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd managedcleanroom frontend analytics dataset publish cmd managedcleanroom frontend analytics dataset publish added parameter subdirectory

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 6, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

@yonzhan yonzhan requested a review from necusjz May 6, 2026 22:12
)
raise CLIError(f"CPK encryption mode requires: {missing_cpk_params}")

# Validate subdirectory is not used with CPK encryption mode
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Dont add this check here. service side validation is sufficient

--collaboration-id my-collab-123 \
--document-id my-dataset \
--body @dataset-config.json
- name: Publish a dataset using SSE encryption mounted at a subdirectory
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lets not make it SSE explicit here.

'subdirectory',
options_list=['--subdirectory'],
help='Optional subdirectory/prefix inside the storage container '
'to mount. Not supported with CPK encryption mode.')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Keep it generic, when the limitation is removed then we can just update the service code and az cli need not change.

@imddanish imddanish force-pushed the feature/managedcleanroom-blobfuse-subdirectory branch from f1b4d3a to 8f8266c Compare May 7, 2026 07:01
@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 7, 2026
@imddanish imddanish force-pushed the feature/managedcleanroom-blobfuse-subdirectory branch from 8f8266c to 413154b Compare May 7, 2026 09:37
@github-actions github-actions Bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 7, 2026
Adds support for mounting a subdirectory/prefix inside the storage
container when publishing analytics datasets, providing parity with the
upstream cleanroom extension's blobfuse subdirectory feature.

Changes:
* Added --subdirectory parameter to
  `az managedcleanroom frontend analytics dataset publish`.
* The new field is propagated into the request body's `store.subdirectory`
  property only when set.
* Added validation: --subdirectory combined with --encryption-mode CPK
  raises a CLIError, matching the service-side restriction in the
  cleanroom-side schema and reference CLI.
* Updated the auto-generated `analytics_frontend_api` SDK JSON dict
  templates (sync + async operations) to include `subdirectory` after
  `awsCgsSecretId`. The change matches what a fresh autorest regen
  produces from the updated frontend.yaml; only the substantive subdirectory
  delta is included to avoid unrelated cosmetic churn from the team's SDK
  post-processing.
* Added unit tests covering: subdirectory propagation in SSE mode,
  default omission when not provided, and CPK rejection.
* Updated _help.py with the new parameter doc entry and an example
  showing SSE publish with --subdirectory.
* Bumped extension version 1.0.0b5 -> 1.0.0b6 and added HISTORY.rst entry.

Validation:
* azdev style managedcleanroom: PASSED (pylint + flake8)
* python scripts/ci/test_index.py -q: OK
* All 57 unit tests pass (3 new subdirectory tests included).
@imddanish imddanish force-pushed the feature/managedcleanroom-blobfuse-subdirectory branch from 413154b to 264b44b Compare May 7, 2026 09:56
@anantshankar17
Copy link
Copy Markdown

@necusjz please review

@necusjz
Copy link
Copy Markdown
Member

necusjz commented May 8, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz necusjz merged commit 19b6b04 into Azure:main May 8, 2026
23 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented May 8, 2026

[Release] Update index.json for extension [ managedcleanroom-1.0.0b7 ] : https://dev.azure.com/msazure/One/_build/results?buildId=163371162&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants