Skip to content

{Spring} Remove DATA_COSMOS_TABLE and DATA_STORAGE references#9085

Merged
calvinhzy merged 7 commits intoAzure:mainfrom
calvinhzy:spring-etc-remove-multiapi
Sep 1, 2025
Merged

{Spring} Remove DATA_COSMOS_TABLE and DATA_STORAGE references#9085
calvinhzy merged 7 commits intoAzure:mainfrom
calvinhzy:spring-etc-remove-multiapi

Conversation

@calvinhzy
Copy link
Copy Markdown
Member

@calvinhzy calvinhzy commented Aug 25, 2025


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

Related command

As main repo has removed all DATA_COSMOS_TABLE and DATA_STORAGE usage, removing it here as well. Not fixing style issues as the module is planned to be deprecated soon.

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.

@calvinhzy calvinhzy self-assigned this Aug 25, 2025
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @calvinhzy,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 25, 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

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>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

Hi @calvinhzy

⚠️ Release Requirements

Module: spring

  • ⚠️ Please update VERSION to be 1.0.0b1 in src/spring/setup.py
  • ⚠️ Set azext.isPreview to true in azext_metadata.json for spring

Notes

@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 Aug 25, 2025
@calvinhzy calvinhzy removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Aug 25, 2025
@yonzhan yonzhan requested a review from jsntcy August 26, 2025 00:43
…ure Spring Apps service instance. For more details, please refer to the retirement announcement https://aka.ms/asaretirement.
@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 Aug 27, 2025
@calvinhzy calvinhzy added skip-cal-version and removed release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. labels Aug 28, 2025
@calvinhzy calvinhzy marked this pull request as ready for review August 28, 2025 09:09
Copilot AI review requested due to automatic review settings August 28, 2025 09:09
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 Spring extension to remove dependencies on deprecated DATA_COSMOS_TABLE and DATA_STORAGE resource types, migrating to newer Azure Storage SDK implementations. The changes modernize the storage client usage patterns throughout the codebase.

  • Migrates from legacy AppendBlobService and FileService to modern BlobClient and ShareFileClient APIs
  • Updates test decorators to use @live_only() for proper test execution
  • Removes deprecated storage SDK references and helper utilities

Reviewed Changes

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

Show a summary per file
File Description
src/spring/setup.py Version bump to 1.28.2
src/spring/HISTORY.md Release notes documenting the storage reference removal
src/spring/azext_spring/_stream_utils.py Major refactor replacing legacy blob service with modern BlobClient API
src/spring/azext_spring/_deployment_uploadable_factory.py Updates file upload to use ShareFileClient instead of FileService
src/spring/azext_spring/_deployment_deployable_factory.py Adds cmd parameter to stream_logs call
src/spring/azext_spring/custom.py Adds cmd parameter to stream_logs call
Test files Adds @live_only() decorators and time.sleep() calls for test reliability
Recording file Updates API version from 2022-09-01 to 2024-11-01

Comment on lines 66 to 67
logger_level_func):

Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

The function signature has changed but the docstring and parameter documentation are missing. The removal of container_name and blob_name parameters should be documented, and the new blob_service parameter (now a BlobClient) should be clearly documented.

Suggested change
logger_level_func):
logger_level_func):
"""
Streams logs from an Azure Blob storage using the provided BlobClient.
Note: The function signature has changed. The parameters `container_name` and `blob_name` have been removed.
Instead, the `blob_service` parameter should be provided as an instance of BlobClient.
Args:
no_format (bool): If True, disables color formatting of logs.
byte_size (int): The chunk size in bytes to read from the blob.
timeout_in_seconds (int): The maximum time in seconds to stream logs before timing out.
blob_service (BlobClient): The Azure BlobClient instance pointing to the log blob.
raise_error_on_failure (bool): If True, raises an error when log streaming fails.
logger_level_func (function): The logger function to use for warnings and errors.
"""

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +117
downloader = blob_service.download_blob(offset=start, length=byte_size, max_concurrency=1)
downloader.readinto(stream)
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

The readinto method may not behave as expected with BytesIO streams. The modern BlobClient API typically returns a StorageStreamDownloader that should use readall() or iterate over chunks. Consider using stream.write(downloader.readall()) instead.

Suggested change
downloader = blob_service.download_blob(offset=start, length=byte_size, max_concurrency=1)
downloader.readinto(stream)
stream.write(downloader.readall())

Copilot uses AI. Check for mistakes.
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 30, 2025

Please fix CI issues

@calvinhzy calvinhzy merged commit 0541178 into Azure:main Sep 1, 2025
23 of 25 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented Sep 1, 2025

[Release] Update index.json for extension [ spring-1.28.2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=135648816&view=results

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants