Skip to content

[Synapse] az synapse workspace create: /update: Fix repository argument validation and warning message formatting - #34313

Merged
mansoor sarfraz (msarfraz) merged 3 commits into
Azure:devfrom
austinaviv:fix-synapse-repository-validation
Nov 5, 2026
Merged

mansoor sarfraz (msarfraz) merged 3 commits into
Azure:devfrom
austinaviv:fix-synapse-repository-validation

Conversation

@austinaviv

@austinaviv Abhishek Kumar (austinaviv) commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests Suppressions
⚠️ None ️✔️ 130/130 ⚠️ 1 added
⚠️AzureCLI-BreakingChangeTest
⚠️synapse
rule cmd_name rule_message suggest_message
⚠️ 1009 - ParaPropRemove synapse workspace create cmd synapse workspace create update parameter root_folder: removed property default=/

This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.

1 added suppression
File Line Kind Code
src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_validators.py 10 pylint import azure.mgmt.cdn # pylint: disable=unused-import

Related command
az synapse workspace create
az synapse workspace update

Description
Fixes #34312

In src/azure-cli/azure/cli/command_modules/synapse/manual/_validators.py, validate_repository_type had two issues:

  1. Missing comma between '--root-folder' and '--project-name' in repository_config_args, which caused Python to concatenate them into '--root-folder--project-name'. Also fixed the delimiter formatting from ' ,' to ', '.
  2. The validator checked if namespace.repository_type is None:, which caused the warning to be printed on every workspace create/update invocation even when no repository arguments were passed. Updated the check so the warning is only logged when repository configuration arguments are actually provided without --repository-type.

Added unit tests in test_validators.py to cover all scenarios.

Testing Guide
Run unit tests:

python -m unittest azure.cli.command_modules.synapse.tests.latest.test_validators

History Notes
[Synapse] az synapse workspace create: /update: Fix repository argument validation and warning message formatting


This checklist is used to make sure that common guidelines for a pull request are followed.

… validation and warning message formatting

- Fix missing comma between '--root-folder' and '--project-name' in repository_config_args that caused string concatenation.
- Fix warning message formatting by replacing ' ,' with ', '.
- Only log warning when repository configuration arguments are provided without --repository-type, avoiding false warnings on standard workspace create/update commands.
- Add unit tests for validate_repository_type.
Copilot AI balanced review requested due to automatic review settings October 31, 2026 10:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@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 Oct 31, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Abhishek Kumar (@austinaviv)! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The repository-option warning still fires on workspace creation’s inherited root-folder default, while omitting --last-commit-id from the check leaves an ignored update option without a warning.

2 open issues
What changed in this PR

This PR addresses #34312 by refining repository-configuration warnings for az synapse workspace create/update.

Changes:

  • Fixes concatenated argument names and comma spacing in warning messages.
  • Adds a repository-argument presence check to limit unnecessary warnings.
  • Adds unit tests for warning suppression, triggering, and formatting.
File Description
src/​azure-cli/​azure/​cli/​command_modules/​synapse/​tests/​latest/​test_validators.py Adds repository-validator warning tests.
src/​azure-cli/​azure/​cli/​command_modules/​synapse/​manual/​_validators.py Updates warning conditions and argument-list formatting.

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@austinaviv

Copy link
Copy Markdown
Contributor Author

Yong Zhang (@yonzhan) The review feedback has been addressed:

  • Added --last-commit-id to repository_config_args and the presence check in validate_repository_type.
  • Set root_folder=None in create_workspace so the parser default remains unset when no Git parameters are passed, while defaulting to '/' when constructing WorkspaceRepositoryConfiguration.
  • Added unit test cases covering --last-commit-id warning behavior and create_workspace root folder defaulting.

Could you please trigger /azp run when convenient? Thanks!

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@yonzhan
Yong Zhang (yonzhan) requested a review from a team November 2, 2026 22:14
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@x-engineering-agent

x-engineering-agent Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

X Engineering Agent Pull request review: Comments

Abhishek Kumar (@austinaviv) At f57ff7c, the inspected create/update paths address #34312's warning conditions and comma-space formatting. Both pending Copilot comments are addressed: --last-commit-id participates in validation, and creation applies / only when constructing repository configuration. No production correctness defect was confirmed; command-level regression evidence remains incomplete.

Check Status Detail
Agent live tests Not run This is a review-only PR.
Regression coverage Unverified For synapse: 1 focused test file(s) changed.
Findings 1 medium findings 1 medium
Risk Risk 26/100 Medium Medium; owner review required

To address

Tick each item as you address it.

  • Medium Parser-default regression is not asserted

    Details and fix

    src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_validators.py:42 constructs an all-None namespace instead of using command argument defaults. The separate handler tests at lines 76–101 never invoke the validator or inspect warnings. Reverting only manual/operations/workspace.py:24 to root_folder='/' would therefore retain these assertions while restoring the original spurious create warning through manual/_params.py:88–104 → manual/_validators.py:66–73.

    Exercise registered create/update argument parsing and capture the warning output: no repository arguments must produce no repository warning; arguments without a type, including --last-commit-id alone, must produce the formatted warning. Preserve the create request assertions for default / and explicit root folders. Focused verification should detect a reverted parser default, not just a changed request object.

Review details

Test validation

  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: For synapse: 1 focused test file(s) changed. Scenario coverage is unverified; review the issue's required conditions, test setup, and assertions before approval. No linked issue was found in the PR timeline; inspect the source issue and its required scenario manually.

Upstream CI passed (50/50, per handoff), but regression coverage for the required issue conditions/output is not verified. Safe inspection of #34312 confirmed the two expectations above. The submitted unit tests provide direct validator and request-object assertions; they are not Agent execution evidence. No tests were run during this review, and the handoff supplied no separate author execution result.

The inspected scenario src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py:1107–1143 checks workspace lifecycle/JSON results, not these warnings. Its existing src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_workspaces.yaml contains HTTP interactions, not CLI warning assertions. Focused rerun: synapse.tests.latest.test_validators.SynapseValidatorsTest and synapse.tests.latest.test_synapse_scenario.SynapseScenarioTests.test_workspaces, with explicit create/update warning assertions covering both issue conditions. A passing playback recording alone would not verify the warning output.

Risk assessment

26/100 · Medium

The Medium rating is driven by security-sensitive behavior.

  • Change scope: 3 changed files, 129 changed lines (+122 / -7), including 2 production files.
  • Affected components: synapse
  • Risk drivers: security-sensitive behavior (+28)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is required for synapse before merge.

Ask the Agent

Tick a box to queue an action. Requires write access to this repository.

  • Re-review this PR
  • Run Agent live tests on this PR

X Engineering Agent · Reviewer · React with +1 or -1 to train the agent

@x-engineering-agent x-engineering-agent Bot changed the title [Synapse] az synapse workspace create/update: Fix repository argument validation and warning message formatting [Synapse] az synapse workspace create: /update: Fix repository argument validation and warning message formatting Nov 3, 2026

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review comments are inline on the changed lines. See the X Engineering Agent Report.

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Nov 3, 2026
@austinaviv

Copy link
Copy Markdown
Contributor Author

Thanks Yong Zhang (@yonzhan) for running the pipeline. All 50 checks are green now. Please let me know if any further changes are needed or if this looks ready to merge.

@yonzhan

Copy link
Copy Markdown
Collaborator

Adding mansoor sarfraz (@msarfraz) to help review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@msarfraz
mansoor sarfraz (msarfraz) merged commit 55493d2 into Azure:dev Nov 5, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-experience-enablement-squad customer-reported Issues that are reported by GitHub users external to the Azure organization. Request X Engineering Agent Ask the agent to triage this issue or review this PR Synapse X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Synapse] az synapse workspace create/update: false warning and malformed argument string in repository validation

7 participants