Skip to content

Quantum: -o output breaks when newer extension version exists + test updates#9046

Merged
kairu-ms merged 5 commits intoAzure:mainfrom
kikomiss:main
Aug 11, 2025
Merged

Quantum: -o output breaks when newer extension version exists + test updates#9046
kairu-ms merged 5 commits intoAzure:mainfrom
kikomiss:main

Conversation

@kikomiss
Copy link
Copy Markdown
Contributor

@kikomiss kikomiss commented Aug 7, 2025


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

Related command

az quantum

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)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

Copilot AI review requested due to automatic review settings August 7, 2025 23:43
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 7, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 7, 2025

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 Aug 7, 2025

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>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Azure Quantum CLI extension to version 1.0.0b8, addressing an issue where the version advertisement message was interfering with formatted output when using the -o flag. The fix ensures version checks only display when formatted output options are not specified.

  • Version bump from 1.0.0b7 to 1.0.0b8 with corresponding CLI reported version update
  • Fix for output formatting interference by conditional version check logic
  • Test configuration updates for workspace location and provider SKU

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
setup.py Version bump to 1.0.0b8
init.py CLI reported version update and conditional version check fix
utils.py Test workspace location change from westus2 to westus
test_quantum_jobs.py Provider SKU update for test configuration
HISTORY.rst Release notes for version 1.0.0b8

Comment thread src/quantum/azext_quantum/__init__.py Outdated

# Only when formatted output (https://learn.microsoft.com/en-us/cli/azure/format-output-azure-cli?view=azure-cli-latest&tabs=bash) is NOT requested,
# we can produce the "new version is available" tip as it may interfere with the output format (ex. JSON).
if "--output" not in args and "--out" not in args and "-o" not in args:
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The string-based argument checking is fragile and may not correctly handle all cases. For example, it would incorrectly match arguments like --output-file or commands where -o appears in a parameter value. Consider using the CLI's built-in argument parsing or a more robust method to detect output format options.

Suggested change
if "--output" not in args and "--out" not in args and "-o" not in args:
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('--output', dest='output', nargs='?', default=None)
parser.add_argument('--out', dest='output', nargs='?', default=None)
parser.add_argument('-o', dest='output', nargs='?', default=None)
# parse_known_args returns a tuple (Namespace, list of unknown args)
parsed_args, _ = parser.parse_known_args(args)
if parsed_args.output is None:

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The args is not a string but an array so matching with in should match an entry exactly

Comment thread src/quantum/azext_quantum/__init__.py
@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Aug 7, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 7, 2025

@yonzhan yonzhan requested a review from kairu-ms August 7, 2025 23:56
@yonzhan yonzhan requested a review from jsntcy August 7, 2025 23:57
@kikomiss
Copy link
Copy Markdown
Contributor Author

kikomiss commented Aug 8, 2025

@kairu-ms @jsntcy This change needs an extension release

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 8, 2025

Please fix CI issues

Comment thread src/quantum/azext_quantum/tests/latest/test_quantum_jobs.py
@kairu-ms kairu-ms merged commit 9c02b39 into Azure:main Aug 11, 2025
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

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

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

Labels

Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants