Skip to content

[Container App] Support SessionPool for API version 2025-02-02-preview #8800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

yitaopan
Copy link
Member

@yitaopan yitaopan commented May 28, 2025

Client api version for Azure Container Apps was updated to 2025-02-02-preview, where ACA session pool feature had a breaking change in the api payload.

This is to fix the payload, and no functionality changes in the CLI itself.


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

Related command

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 Copilot AI review requested due to automatic review settings May 28, 2025 11:29
Copy link

azure-client-tools-bot-prd bot commented May 28, 2025

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

Copy link

Hi @yitaopan,
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.

@yonzhan
Copy link
Collaborator

yonzhan commented May 28, 2025

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

Copy link

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

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

Copy link
Contributor

@Copilot 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 adds support for the new lifecycleConfiguration object in session pools for API version 2025-02-02-preview.

  • Updated tests to use SubnetPreparer instead of hard-coded regions and removed live_only decorators
  • Extended test assertions to validate lifecycleType and cooldownPeriodInSeconds under dynamicPoolConfiguration.lifecycleConfiguration
  • Refactored set_up_dynamic_configuration methods in the decorator to build a nested lifecycleConfiguration object instead of directly setting cooldownPeriodInSeconds

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

File Description
src/containerapp/azext_containerapp/tests/latest/test_containerapp_sessionpool.py Swapped hard-coded regions for TEST_LOCATION, removed live_only, and added new JMESPath checks for lifecycleConfiguration
src/containerapp/azext_containerapp/containerapp_sessionpool_decorator.py Replaced flat cooldownPeriodInSeconds and executionType keys with a nested lifecycleConfiguration structure
Comments suppressed due to low confidence (1)

src/containerapp/azext_containerapp/containerapp_sessionpool_decorator.py:255

  • There are two methods named set_up_dynamic_configuration in this class; the second definition will override the first, causing the initial implementation to be discarded. Consolidate or rename to prevent the shadowing.
def set_up_dynamic_configuration(self):

Comment on lines +260 to 266
lifecycle_config_def = {}
lifecycle_config_def["lifecycleType"] = "Timed"
lifecycle_config_def["cooldownPeriodInSeconds"] = self.get_argument_cooldown_period_in_seconds()
dynamic_pool_def["lifecycleConfiguration"] = lifecycle_config_def

return dynamic_pool_def

Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The logic for building the lifecycleConfiguration object is duplicated between methods. Extract it into a shared helper to reduce duplication and ensure consistency.

Suggested change
lifecycle_config_def = {}
lifecycle_config_def["lifecycleType"] = "Timed"
lifecycle_config_def["cooldownPeriodInSeconds"] = self.get_argument_cooldown_period_in_seconds()
dynamic_pool_def["lifecycleConfiguration"] = lifecycle_config_def
return dynamic_pool_def
dynamic_pool_def["lifecycleConfiguration"] = self._build_lifecycle_configuration(
cooldown_period_in_seconds=self.get_argument_cooldown_period_in_seconds()
)
return dynamic_pool_def
def _build_lifecycle_configuration(self, cooldown_period_in_seconds):
lifecycle_config_def = {}
lifecycle_config_def["lifecycleType"] = "Timed"
lifecycle_config_def["cooldownPeriodInSeconds"] = cooldown_period_in_seconds
return lifecycle_config_def

Copilot uses AI. Check for mistakes.

Copy link

Hi @yitaopan

Release Suggestions

Module: containerapp

  • Please log updates into to src/containerapp/HISTORY.rst
  • Update VERSION to 1.1.0b6 in src/containerapp/setup.py

Notes

@yonzhan yonzhan requested a review from zhoxing-ms May 28, 2025 14:13
@yonzhan yonzhan requested a review from yanzhudd May 28, 2025 14:14
@yitaopan yitaopan changed the title Support SessionPool for API version 2025-02-02-preview [Container App] Support SessionPool for API version 2025-02-02-preview May 29, 2025
@Greedygre
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@yitaopan
Copy link
Member Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 8800 in repo Azure/azure-cli-extensions

@Greedygre
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Greedygre
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 1ceafea into Azure:main May 29, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants