Skip to content
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

{ServiceBus} Change expiration version to next breaking change window #25344

Merged
merged 3 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/src/azure-cli/azure/cli/command_modules/resource/ @zhoxing-ms @jsntcy @yanzhudd
/src/azure-cli/azure/cli/command_modules/role/ @jiasli @evelyn-ys @calvinhzy
/src/azure-cli/azure/cli/command_modules/search/ @huangbolun @kairu-ms
/src/azure-cli/azure/cli/command_modules/servicebus/ @v-ajnava @zhoxing-ms @jsntcy
/src/azure-cli/azure/cli/command_modules/servicebus/ @v-ajnava @zhoxing-ms @jsntcy @evelyn-ys
/src/azure-cli/azure/cli/command_modules/serviceconnector/ @yungezz @houk-ms @xfz11 @yanzhudd @kairu-ms
/src/azure-cli/azure/cli/command_modules/servicefabric/ @QingChenmsft @zhoxing-ms @jsntcy @yanzhudd
/src/azure-cli/azure/cli/command_modules/sql/ @jaredmoo @evelyn-ys @calvinhzy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def load_arguments_sb(self, _):

with self.argument_context('servicebus queue update') as c:
c.argument('enable_partitioning', arg_type=get_three_state_flag(),
help='A boolean value that indicates whether the queue is to be partitioned across multiple message brokers.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0'))
c.argument('requires_session', options_list=['--enable-session'], arg_type=get_three_state_flag(), help='A boolean value indicating whether the queue supports the concept of sessions.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0'))
help='A boolean value that indicates whether the queue is to be partitioned across multiple message brokers.', deprecate_info=c.deprecate(hide=True, expiration='2.49.0'))
c.argument('requires_session', options_list=['--enable-session'], arg_type=get_three_state_flag(), help='A boolean value indicating whether the queue supports the concept of sessions.', deprecate_info=c.deprecate(hide=True, expiration='2.49.0'))
Copy link
Member

@jiasli jiasli Feb 3, 2023

Choose a reason for hiding this comment

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

This expiration was introduced by #24937.

Same issue happened multiple times before, such as #21892

Setting expiration is like setting a timebomb for ourselves. Maybe we can remove totally expiration, otherwise it can trigger failure again in 2.49.0 release.

c.argument('requires_duplicate_detection', options_list=['--enable-duplicate-detection'],
arg_type=get_three_state_flag(),
help='A boolean value indicating if this queue requires duplicate detection.', deprecate_info=c.deprecate(hide=True, expiration='2.45.0'))
help='A boolean value indicating if this queue requires duplicate detection.', deprecate_info=c.deprecate(hide=True, expiration='2.49.0'))

with self.argument_context('servicebus queue list') as c:
c.argument('namespace_name', id_part=None, options_list=['--namespace-name'], help='Name of Namespace')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# pylint: disable=too-many-locals
# pylint: disable=too-many-return-statements
import re
from knack.log import get_logger
from azure.cli.core.profiles import ResourceType

logger = get_logger(__name__)


# Namespace Region
def cli_namespace_create(cmd, client, resource_group_name, namespace_name, location=None, tags=None, sku='Standard',
Expand Down Expand Up @@ -638,7 +641,6 @@ def return_valid_duration(update_value, current_value=None):
from isodate import Duration
from azure.cli.core.azclierror import InvalidArgumentValueError
from azure.cli.command_modules.servicebus.constants import DURATION_SECS, DURATION_MIN, DURATION_DAYS
from argcomplete import warn
if update_value is not None:
value_toreturn = update_value
else:
Expand All @@ -662,7 +664,7 @@ def return_valid_duration(update_value, current_value=None):
return value_toreturn

if timedeltapattern.match(value_toreturn):
warn('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.45.0.')
logger.warning('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.49.0.')
day, minute, seconds = value_toreturn.split(":")
if timedelta(days=int(day), minutes=int(minute), seconds=int(seconds)) <= timedelta(days=DURATION_DAYS,
minutes=DURATION_MIN,
Expand All @@ -678,7 +680,6 @@ def return_valid_duration_create(update_value):
from datetime import timedelta
from isodate import parse_duration
from knack.util import CLIError
import warnings
from azure.cli.command_modules.servicebus.constants import DURATION_SECS, DURATION_MIN, DURATION_DAYS
if update_value is not None:
if iso8601pattern.match(update_value):
Expand All @@ -687,7 +688,7 @@ def return_valid_duration_create(update_value):
'duration value should be less than (days:min:secs) 10675199:10085:477581')

if timedeltapattern.match(update_value):
warnings.warn('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.45.0.')
logger.warning('Please use ISO8601 duration for timespan inputs. Timespan inputs of format (days:min:seconds) would be deprecated from version 2.49.0.')
day, minute, seconds = update_value.split(":")
if timedelta(days=int(day), minutes=int(minute), seconds=int(seconds)) <= timedelta(days=DURATION_DAYS, minutes=DURATION_MIN, seconds=DURATION_SECS):
update_value = timedelta(days=int(day), minutes=int(minute), seconds=int(seconds))
Expand Down