[fleet] add support for inline json to --stages argument in CLI#9000
[fleet] add support for inline json to --stages argument in CLI#9000kairu-ms merged 8 commits intoAzure:mainfrom
Conversation
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| fleet updaterun create | cmd fleet updaterun create update parameter stages: removed property type=file_type |
||
| fleet updatestrategy create | cmd fleet updatestrategy create update parameter stages: removed property type=file_type |
|
Hi @serbrech, |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for inline JSON strings to the --stages argument in Azure fleet CLI commands, allowing users to provide stage configuration either as a file path or as inline JSON content.
Key Changes
- Modified parameter handling to accept both file paths and inline JSON strings for the
--stagesargument - Updated the core parsing logic to detect whether input is a file path or JSON string
- Added comprehensive test coverage for the new inline JSON functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/fleet/azext_fleet/_params.py |
Updated parameter definitions to remove file type restrictions and clarify help text for inline JSON support |
src/fleet/azext_fleet/custom.py |
Modified get_update_run_strategy function to handle both file paths and inline JSON strings |
src/fleet/azext_fleet/tests/latest/test_stages_json.py |
Added comprehensive test suite covering file path, inline JSON, and error scenarios |
Comments suppressed due to low confidence (1)
src/fleet/azext_fleet/tests/latest/test_stages_json.py:252
- [nitpick] Consider adding test cases for other error scenarios such as missing required fields (e.g., missing 'stages' key, missing 'name' in stage/group) to ensure robust error handling.
invalid_json = '{"stages": [{"name": "test", invalid_syntax}]}'
|
Hi @serbrech
|
|
@kairu-ms happy to merge this after your review |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 9000 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Co-authored-by: serbrech <315853+serbrech@users.noreply.github.com>
Co-authored-by: serbrech <315853+serbrech@users.noreply.github.com>
Co-authored-by: serbrech <315853+serbrech@users.noreply.github.com>
… enhancement Co-authored-by: serbrech <315853+serbrech@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
[Release] Update index.json for extension [ fleet-1.6.1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=132232791&view=results |
fixes #8979
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az fleet
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.