fixing issue: min/max executions not accepting 0 values in az containerapp job update#9030
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
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>
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in Azure Container Apps job update command where --min-executions 0 and --max-executions 0 were not being applied correctly due to improper boolean evaluation. The fix changes the condition to explicitly check for None values instead of relying on truthy evaluation.
- Fixed boolean evaluation logic for min/max executions parameters
- Updated version from 1.2.0b3 to 1.2.0b4
- Added changelog entry documenting the bug fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/containerapp/setup.py | Bumped version to 1.2.0b4 |
| src/containerapp/azext_containerapp/containerapp_job_decorator.py | Fixed boolean evaluation for min/max executions to properly handle zero values |
| src/containerapp/HISTORY.rst | Added changelog entry for the bug fix |
| or self.get_argument_min_executions() is not None \ | ||
| or self.get_argument_max_executions() is not None | ||
|
|
||
| def set_up_trigger_configurations(self): |
There was a problem hiding this comment.
The fix correctly addresses the boolean evaluation issue, but consider whether negative values should also be handled. If min_executions can only be non-negative, add validation to prevent invalid values.
| or self.get_argument_min_executions() is not None \ | |
| or self.get_argument_max_executions() is not None | |
| def set_up_trigger_configurations(self): | |
| or (self.get_argument_min_executions() is not None and self.get_argument_min_executions() >= 0) \ | |
| or self.get_argument_max_executions() is not None | |
| def set_up_trigger_configurations(self): | |
| if self.get_argument_min_executions() is not None and self.get_argument_min_executions() < 0: | |
| raise InvalidArgumentValueError("min_executions must be a non-negative integer.") |
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 |
Release SuggestionsModule: containerapp
Notes
|
@microsoft-github-policy-service agree company="Microsoft" |
az containerapp job update
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
049396d to
ce0e8bf
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
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 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.