-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[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
[Container App] Support SessionPool for API version 2025-02-02-preview #8800
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
Hi @yitaopan, |
Thank you for your contribution! We will review the pull request and get back to you soon. |
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>
|
CodeGen Tools Feedback CollectionThank 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 |
There was a problem hiding this 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 removedlive_only
decorators - Extended test assertions to validate
lifecycleType
andcooldownPeriodInSeconds
underdynamicPoolConfiguration.lifecycleConfiguration
- Refactored
set_up_dynamic_configuration
methods in the decorator to build a nestedlifecycleConfiguration
object instead of directly settingcooldownPeriodInSeconds
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):
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 | ||
|
There was a problem hiding this comment.
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.
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.
Hi @yitaopan Release SuggestionsModule: containerapp
Notes
|
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Commenter does not have sufficient privileges for PR 8800 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). |
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
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally? (pip install wheel==0.30.0
required)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
.