From 5300c219fb63810dafeb3acff60cad37b9db5eef Mon Sep 17 00:00:00 2001 From: aemous Date: Thu, 9 Oct 2025 10:51:05 -0400 Subject: [PATCH 01/15] Add tests and pagination updates. --- tests/unit/customizations/test_paginate.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/unit/customizations/test_paginate.py b/tests/unit/customizations/test_paginate.py index 03eed8e45f30..aa0ef41f9d56 100644 --- a/tests/unit/customizations/test_paginate.py +++ b/tests/unit/customizations/test_paginate.py @@ -234,6 +234,31 @@ def test_should_not_enable_pagination(self): # user specified --bar 10 self.assertFalse(self.parsed_globals.paginate) + def test_should_not_enable_pagination_call_parameters(self): + # Here the user has specified a manual pagination argument, + # via CLI Input JSON and specified v2-debug, so a + # migration warning should printed. + # From setUp(), the limit_key is 'Bar' + input_tokens = ['Foo', 'Bar'] + self.parsed_globals.v2_debug = True + self.parsed_globals.paginate = True + # Corresponds to --bar 10 + self.call_parameters['Foo'] = None + self.call_parameters['Bar'] = 10 + with capture_output() as output: + paginate.check_should_enable_pagination_call_parameters( + input_tokens, self.call_parameters, {}, self.parsed_globals + ) + # We should have printed the migration warning + # because the user specified {Bar: 10} in the input JSON + self.assertIn( + 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, if you specify ' + 'pagination parameters by using a file with the ' + '`--cli-input-json` parameter, automatic pagination will be ' + 'turned off.', + output.stdout.getvalue() + ) + def test_should_enable_pagination_with_no_args(self): input_tokens = ['foo', 'bar'] self.parsed_globals.paginate = True From 5c865bd440e4cff494d3dac0f0799d66d52a9a5b Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 10 Oct 2025 14:08:19 -0400 Subject: [PATCH 02/15] Switch migration warnings to use stderr. --- tests/unit/customizations/test_paginate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/customizations/test_paginate.py b/tests/unit/customizations/test_paginate.py index aa0ef41f9d56..959bf3276d4c 100644 --- a/tests/unit/customizations/test_paginate.py +++ b/tests/unit/customizations/test_paginate.py @@ -234,7 +234,7 @@ def test_should_not_enable_pagination(self): # user specified --bar 10 self.assertFalse(self.parsed_globals.paginate) - def test_should_not_enable_pagination_call_parameters(self): + def test_v2_debug_call_parameters(self): # Here the user has specified a manual pagination argument, # via CLI Input JSON and specified v2-debug, so a # migration warning should printed. @@ -256,7 +256,7 @@ def test_should_not_enable_pagination_call_parameters(self): 'pagination parameters by using a file with the ' '`--cli-input-json` parameter, automatic pagination will be ' 'turned off.', - output.stdout.getvalue() + output.stderr.getvalue() ) def test_should_enable_pagination_with_no_args(self): From 0e4b4e9597c2b8e773be47aca4236170f62fe034 Mon Sep 17 00:00:00 2001 From: aemous Date: Tue, 14 Oct 2025 14:47:57 -0400 Subject: [PATCH 03/15] Revise based on feedback. --- tests/unit/customizations/test_paginate.py | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/tests/unit/customizations/test_paginate.py b/tests/unit/customizations/test_paginate.py index 959bf3276d4c..03eed8e45f30 100644 --- a/tests/unit/customizations/test_paginate.py +++ b/tests/unit/customizations/test_paginate.py @@ -234,31 +234,6 @@ def test_should_not_enable_pagination(self): # user specified --bar 10 self.assertFalse(self.parsed_globals.paginate) - def test_v2_debug_call_parameters(self): - # Here the user has specified a manual pagination argument, - # via CLI Input JSON and specified v2-debug, so a - # migration warning should printed. - # From setUp(), the limit_key is 'Bar' - input_tokens = ['Foo', 'Bar'] - self.parsed_globals.v2_debug = True - self.parsed_globals.paginate = True - # Corresponds to --bar 10 - self.call_parameters['Foo'] = None - self.call_parameters['Bar'] = 10 - with capture_output() as output: - paginate.check_should_enable_pagination_call_parameters( - input_tokens, self.call_parameters, {}, self.parsed_globals - ) - # We should have printed the migration warning - # because the user specified {Bar: 10} in the input JSON - self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, if you specify ' - 'pagination parameters by using a file with the ' - '`--cli-input-json` parameter, automatic pagination will be ' - 'turned off.', - output.stderr.getvalue() - ) - def test_should_enable_pagination_with_no_args(self): input_tokens = ['foo', 'bar'] self.parsed_globals.paginate = True From ad991778e20d002d4e69a69216d3a72298b50a68 Mon Sep 17 00:00:00 2001 From: aemous Date: Mon, 13 Oct 2025 18:35:19 -0400 Subject: [PATCH 04/15] Add tests to verify register feature ID. --- awscli/customizations/globalargs.py | 13 +++++++ requirements.txt | 3 +- tests/unit/customizations/test_globalargs.py | 40 ++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/awscli/customizations/globalargs.py b/awscli/customizations/globalargs.py index 96b599ce37ea..c8bc83fe4ea6 100644 --- a/awscli/customizations/globalargs.py +++ b/awscli/customizations/globalargs.py @@ -18,10 +18,12 @@ from botocore.client import Config from botocore import UNSIGNED from botocore.endpoint import DEFAULT_TIMEOUT +from botocore.useragent import register_feature_id import jmespath from awscli.compat import urlparse + def register_parse_global_args(cli): cli.register('top-level-args-parsed', resolve_types, unique_id='resolve-types') @@ -186,8 +188,19 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): '/cliv2-migration-changes.html#cliv2-migration-aliases.\n', out_file=sys.stderr ) + # Register against the provide-client-params event to ensure that the + # feature ID is registered before any API requests are made. We + # cannot register the feature ID in this function because no + # botocore context is created at this point. + session.register( + 'provide-client-params.*.*', + _register_v2_debug_feature_id + ) session.register('choose-signer.s3.*', warn_if_sigv2) +def _register_v2_debug_feature_id(params, model, **kwargs): + register_feature_id('CLI_V1_TO_V2_MIGRATION_DEBUG_MODE') + def warn_if_east_configured_global_endpoint(request, operation_name, **kwargs): # The regional us-east-1 endpoint is used in certain cases (e.g. # FIPS/Dual-Stack is enabled). Rather than duplicating this logic diff --git a/requirements.txt b/requirements.txt index 1802a0285af9..2d1dc01ec558 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ # botocore and the awscli packages are typically developed # in tandem, so we're requiring the latest develop # branch of botocore and s3transfer when working on the awscli. --e git+https://github.com/boto/botocore.git@develop#egg=botocore +# -e git+https://github.com/boto/botocore.git@develop#egg=botocore +-e file:///Users/aemous/GitHub/botocore -e git+https://github.com/boto/s3transfer.git@develop#egg=s3transfer diff --git a/tests/unit/customizations/test_globalargs.py b/tests/unit/customizations/test_globalargs.py index f3bf17b4a680..5fb8d93c4fbe 100644 --- a/tests/unit/customizations/test_globalargs.py +++ b/tests/unit/customizations/test_globalargs.py @@ -10,6 +10,8 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. +from unittest.mock import patch + from botocore.session import get_session from botocore import UNSIGNED import os @@ -186,6 +188,44 @@ def test_cli_connect_timeout_for_blocking(self): self.assertEqual( session.get_default_client_config().connect_timeout, None) + def test_register_feature_id(self): + parsed_args = FakeParsedArgs(v2_debug=True) + session = get_session() + globalargs.detect_migration_breakage( + parsed_args, + [], + session + ) + # Verify the correct feature ID is registered during the + # provide-client-params event. + with (mock.patch('awscli.customizations.globalargs.register_feature_id') + as mock_register_feature_id): + session.emit( + 'provide-client-params.s3.ListBuckets', + params={}, + model={}, + ) + mock_register_feature_id.assert_any_call( + 'CLI_V1_TO_V2_MIGRATION_DEBUG_MODE' + ) + + def test_ecr_login_v2_debug(self): + parsed_args = FakeParsedArgs(command='ecr', v2_debug=True) + remaining_args = ['get-login'] + session = get_session() + with capture_output() as output: + globalargs.detect_migration_breakage( + parsed_args, + remaining_args, + session + ) + # Verify the expected warning is printed + self.assertIn( + 'AWS CLI v2 MIGRATION WARNING: The ecr get-login command has ' + 'been removed in AWS CLI v2.', + output.stderr.getvalue() + ) + def test_v2_debug_python_utf8_env_var(self): parsed_args = FakeParsedArgs(v2_debug=True) session = get_session() From d407cb7b6aa9142a42f283b640e7c3db85468c79 Mon Sep 17 00:00:00 2001 From: aemous Date: Wed, 15 Oct 2025 14:27:48 -0400 Subject: [PATCH 05/15] Progress. --- awscli/customizations/globalargs.py | 15 +++++++++++++++ awscli/data/cli.json | 5 +++++ awscli/examples/global_options.rst | 4 ++++ awscli/examples/global_synopsis.rst | 1 + tests/unit/test_clidriver.py | 5 ----- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/awscli/customizations/globalargs.py b/awscli/customizations/globalargs.py index c8bc83fe4ea6..f1be8214c281 100644 --- a/awscli/customizations/globalargs.py +++ b/awscli/customizations/globalargs.py @@ -106,6 +106,20 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): ] region = parsed_args.region or session.get_config_variable('region') s3_config = session.get_config_variable('s3') + if ( + not session.get_scoped_config().get('cli_pager', None) + == '' and 'AWS_PAGER' not in os.environ + ): + uni_print( + 'AWS CLI v2 UPGRADE WARNING: By default, the AWS CLI version 2 ' + 'returns all output through your operating system’s default pager ' + 'program. To retain AWS CLI v1 behavior, set the `cli_pager` ' + 'configuration setting, or the `AWS_PAGER` environment variable, ' + 'to the empty string. See https://docs.aws.amazon.com/cli/latest/' + 'userguide/cliv2-migration-changes.html' + '#cliv2-migration-output-pager.\n', + out_file=sys.stderr + ) if 'PYTHONUTF8' in os.environ or 'PYTHONIOENCODING' in os.environ: if 'AWS_CLI_FILE_ENCODING' not in os.environ: uni_print( @@ -198,6 +212,7 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): ) session.register('choose-signer.s3.*', warn_if_sigv2) + def _register_v2_debug_feature_id(params, model, **kwargs): register_feature_id('CLI_V1_TO_V2_MIGRATION_DEBUG_MODE') diff --git a/awscli/data/cli.json b/awscli/data/cli.json index 25687399d05c..d75489e88664 100644 --- a/awscli/data/cli.json +++ b/awscli/data/cli.json @@ -69,6 +69,11 @@ "action": "store_true", "dest": "v2_debug", "help": "

Enable AWS CLI v2 migration assistance. Prints warnings if the command would face a breaking change after swapping AWS CLI v1 for AWS CLI v2 in the current environment. Prints one warning for each breaking change detected.

" + }, + "no-v2-debug": { + "action": "store_true", + "dest": "no_v2_debug", + "help": "

Disable AWS CLI v2 migration assistance.

" } } } diff --git a/awscli/examples/global_options.rst b/awscli/examples/global_options.rst index d450cf0ce78a..914d070ed329 100644 --- a/awscli/examples/global_options.rst +++ b/awscli/examples/global_options.rst @@ -74,3 +74,7 @@ Enable AWS CLI v2 migration assistance. Prints warnings if the command would face a breaking change after swapping AWS CLI v1 for AWS CLI v2 in the current environment. Prints one warning for each breaking change detected. +``--no-v2-debug`` (boolean) + + Disable AWS CLI v2 migration assistance. + diff --git a/awscli/examples/global_synopsis.rst b/awscli/examples/global_synopsis.rst index 12865958a809..1d8295f550ed 100644 --- a/awscli/examples/global_synopsis.rst +++ b/awscli/examples/global_synopsis.rst @@ -13,3 +13,4 @@ [--cli-read-timeout ] [--cli-connect-timeout ] [--v2-debug] +[--no-v2-debug] diff --git a/tests/unit/test_clidriver.py b/tests/unit/test_clidriver.py index a88e13ed76ed..bfc17cf71ab8 100644 --- a/tests/unit/test_clidriver.py +++ b/tests/unit/test_clidriver.py @@ -92,11 +92,6 @@ "type": "int", "help": "" }, - "migrate-v2": { - "action": "store_true", - "dest": "migrate_v2", - "help": "", - } } }, } From 25a2e63d3c59e9fa00f7641dd3e9a8ea94b9555e Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 08:01:03 -0400 Subject: [PATCH 06/15] Progress. --- awscli/clidriver.py | 6 +- .../customizations/cloudformation/deploy.py | 7 +- awscli/customizations/globalargs.py | 65 ++++++++++--------- awscli/customizations/paginate.py | 11 ++-- awscli/customizations/s3/subcommands.py | 6 +- awscli/customizations/scalarparse.py | 14 ++-- awscli/utils.py | 12 ++++ tests/functional/test_api_versions.py | 2 +- .../customizations/s3/test_subcommands.py | 2 +- tests/unit/customizations/test_globalargs.py | 29 +++++++-- tests/unit/customizations/test_paginate.py | 5 +- tests/unit/test_utils.py | 28 +++++++- 12 files changed, 126 insertions(+), 61 deletions(-) diff --git a/awscli/clidriver.py b/awscli/clidriver.py index 1a798aa2c5c0..8f8a897df6ea 100644 --- a/awscli/clidriver.py +++ b/awscli/clidriver.py @@ -49,7 +49,7 @@ ServiceHelpCommand, ) from awscli.plugin import load_plugins -from awscli.utils import emit_top_level_args_parsed_event, write_exception, create_nested_client +from awscli.utils import emit_top_level_args_parsed_event, write_exception, create_nested_client, resolve_v2_debug_mode from botocore import __version__ as botocore_version from botocore import xform_name @@ -682,7 +682,7 @@ def _detect_binary_file_migration_change( # if cli_binary_format is set to raw-in-base64-out, then v2 behavior will # be the same as v1, so there is no breaking change in this case. return - if parsed_globals.v2_debug: + if resolve_v2_debug_mode(parsed_globals): parsed_args_to_check = { arg: getattr(parsed_args, arg) for arg in vars(parsed_args) if getattr(parsed_args, arg) @@ -696,7 +696,7 @@ def _detect_binary_file_migration_change( ] if arg_values_to_check: uni_print( - 'AWS CLI v2 MIGRATION WARNING: When specifying a blob-type ' + 'AWS CLI v2 UPGRADE WARNING: When specifying a blob-type ' 'parameter starting with `file://`, AWS CLI v2 will assume ' 'the content of the file is already base64-encoded. To ' 'maintain v1 behavior after upgrading to v2, set the ' diff --git a/awscli/customizations/cloudformation/deploy.py b/awscli/customizations/cloudformation/deploy.py index a734453e2e0f..e212cd4815a3 100644 --- a/awscli/customizations/cloudformation/deploy.py +++ b/awscli/customizations/cloudformation/deploy.py @@ -25,7 +25,7 @@ from awscli.customizations.commands import BasicCommand from awscli.compat import get_stdout_text_writer from awscli.customizations.utils import uni_print -from awscli.utils import create_nested_client, write_exception +from awscli.utils import create_nested_client, write_exception, resolve_v2_debug_mode LOG = logging.getLogger(__name__) @@ -317,12 +317,13 @@ def _run_main(self, parsed_args, parsed_globals): s3_uploader = None deployer = Deployer(cloudformation_client) + v2_debug = resolve_v2_debug_mode(parsed_globals) return self.deploy(deployer, stack_name, template_str, parameters, parsed_args.capabilities, parsed_args.execute_changeset, parsed_args.role_arn, parsed_args.notification_arns, s3_uploader, tags, parsed_args.fail_on_empty_changeset, - parsed_args.disable_rollback, getattr(parsed_globals, 'v2_debug', False)) + parsed_args.disable_rollback, v2_debug) def deploy(self, deployer, stack_name, template_str, parameters, capabilities, execute_changeset, role_arn, @@ -344,7 +345,7 @@ def deploy(self, deployer, stack_name, template_str, if fail_on_empty_changeset: if v2_debug: uni_print( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, ' 'deploying an AWS CloudFormation Template that ' 'results in an empty changeset will NOT result in an ' 'error. You can add the -–no-fail-on-empty-changeset ' diff --git a/awscli/customizations/globalargs.py b/awscli/customizations/globalargs.py index f1be8214c281..93633c580b83 100644 --- a/awscli/customizations/globalargs.py +++ b/awscli/customizations/globalargs.py @@ -22,6 +22,7 @@ import jmespath from awscli.compat import urlparse +from awscli.utils import resolve_v2_debug_mode def register_parse_global_args(cli): @@ -98,7 +99,7 @@ def resolve_cli_connect_timeout(parsed_args, session, **kwargs): _resolve_timeout(session, parsed_args, arg_name) def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): - if not parsed_args.v2_debug: + if not resolve_v2_debug_mode(parsed_args): return url_params = [ param for param in remaining_args @@ -113,21 +114,22 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): uni_print( 'AWS CLI v2 UPGRADE WARNING: By default, the AWS CLI version 2 ' 'returns all output through your operating system’s default pager ' - 'program. To retain AWS CLI v1 behavior, set the `cli_pager` ' - 'configuration setting, or the `AWS_PAGER` environment variable, ' - 'to the empty string. See https://docs.aws.amazon.com/cli/latest/' - 'userguide/cliv2-migration-changes.html' - '#cliv2-migration-output-pager.\n', + 'program. To retain AWS CLI v1 behavior after upgrading to AWS ' + 'CLI v2, set the `cli_pager` configuration setting, or the ' + '`AWS_PAGER` environment variable, to the empty string. See ' + 'https://docs.aws.amazon.com/cli/latest/userguide' + '/cliv2-migration-changes.html#cliv2-migration-output-pager.\n', out_file=sys.stderr ) if 'PYTHONUTF8' in os.environ or 'PYTHONIOENCODING' in os.environ: if 'AWS_CLI_FILE_ENCODING' not in os.environ: uni_print( - 'AWS CLI v2 MIGRATION WARNING: The PYTHONUTF8 and ' + 'AWS CLI v2 UPGRADE WARNING: The PYTHONUTF8 and ' 'PYTHONIOENCODING environment variables are unsupported ' - 'in AWS CLI v2. AWS CLI v2 uses AWS_CLI_FILE_ENCODING ' - 'instead, set this environment variable to resolve this. ' - 'See https://docs.aws.amazon.com/cli/latest/userguide/' + 'in AWS CLI v2. AWS CLI v2 uses the `AWS_CLI_FILE_ENCODING` ' + 'variable instead; set this environment variable to retain ' + 'AWS CLI v1 behavior after upgrading to AWS CLI v2. See ' + 'https://docs.aws.amazon.com/cli/latest/userguide/' 'cliv2-migration-changes.html' '#cliv2-migration-encodingenvvar.\n', out_file=sys.stderr @@ -145,18 +147,18 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): ) if session.get_config_variable('api_versions'): uni_print( - 'AWS CLI v2 MIGRATION WARNING: The AWS CLI v2 does not support ' + 'AWS CLI v2 UPGRADE WARNING: The AWS CLI v2 does not support ' 'calling earlier versions of AWS service APIs via the ' '`api_versions` configuration file setting. To migrate to v2 ' - 'behavior and resolve this warning, remove the `api_versions` ' - 'setting in the configuration file. See ' + 'behavior, remove the `api_versions` configuration setting, and ' + 'test against the latest API versions. See ' 'https://docs.aws.amazon.com/cli/latest/userguide/' 'cliv2-migration-changes.html#cliv2-migration-api-versions.\n', out_file = sys.stderr ) if session.full_config.get('plugins', {}): uni_print( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, plugin support ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, plugin support ' 'is provisional. If you rely on plugins, be sure to lock into ' 'a particular version of the AWS CLI and test the ' 'functionality of your plugins for each upgrade. See ' @@ -167,18 +169,18 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): ) if parsed_args.command == 'ecr' and remaining_args[0] == 'get-login': uni_print( - 'AWS CLI v2 MIGRATION WARNING: The ecr get-login command has ' - 'been removed in AWS CLI v2. See https://docs.aws.amazon.com/' - 'cli/latest/userguide/cliv2-migration-changes.html' - '#cliv2-migration-ecr-get-login.\n', + 'AWS CLI v2 UPGRADE WARNING: The `ecr get-login` command has ' + 'been removed in AWS CLI v2. You must use `ecr get-login-password` ' + 'instead. See https://docs.aws.amazon.com/cli/latest/userguide/' + 'cliv2-migration-changes.html#cliv2-migration-ecr-get-login.\n', out_file=sys.stderr ) - if url_params and session.full_config.get('cli_follow_urlparam', True): + if url_params and session.get_scoped_config().get('cli_pager', None): uni_print( - 'AWS CLI v2 MIGRATION WARNING: For input parameters that have ' + 'AWS CLI v2 UPGRADE WARNING: For input parameters that have ' 'a prefix of http:// or https://, AWS CLI v2 will no longer ' 'automatically request the content of the URL for the ' - 'parameter, and the cli_follow_urlparam option has been ' + 'parameter, and the `cli_follow_urlparam` option has been ' 'removed. See https://docs.aws.amazon.com/cli/latest/' 'userguide/cliv2-migration-changes.html' '#cliv2-migration-paramfile.\n', @@ -195,9 +197,10 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs): and f"--{working_param}" in remaining_args ): uni_print( - 'AWS CLI v2 MIGRATION WARNING: You have entered command ' + 'AWS CLI v2 UPGRADE WARNING: You have entered command ' 'arguments that uses at least 1 of 21 hidden aliases that ' - 'were removed in AWS CLI v2. See ' + 'were removed in AWS CLI v2. You must replace usage of the ' + 'obsolete alias with the corresponding working parameter. See ' 'https://docs.aws.amazon.com/cli/latest/userguide' '/cliv2-migration-changes.html#cliv2-migration-aliases.\n', out_file=sys.stderr @@ -222,12 +225,12 @@ def warn_if_east_configured_global_endpoint(request, operation_name, **kwargs): # from botocore, we check the endpoint URL directly. if 's3.amazonaws.com' in request.url: uni_print( - 'AWS CLI v2 MIGRATION WARNING: When you configure AWS CLI v2 ' + 'AWS CLI v2 UPGRADE WARNING: When you configure AWS CLI v2 ' 'to use the `us-east-1` region, it uses the true regional ' - 'endpoint rather than the global endpoint. To continue using ' - 'the global endpoint on v2, configure the region to be ' - '`aws-global`. See https://docs.aws.amazon.com/cli/latest/' - 'userguide/cliv2-migration-changes.html' + 'endpoint rather than the global endpoint. To retain AWS CLI v1 ' + 'behavior after upgrading to AWS CLI v2, configure the `region` ' + 'setting to `aws-global`. See https://docs.aws.amazon.com/cli' + '/latest/userguide/cliv2-migration-changes.html' '#cliv2-migration-s3-regional-endpoint.\n', out_file=sys.stderr ) @@ -242,9 +245,9 @@ def warn_if_sigv2( if context.get('auth_type', None) == 'v2': uni_print( 'AWS CLI v2 MIGRATION WARNING: The AWS CLI v2 only uses Signature ' - 'v4 to authenticate Amazon S3 requests. Run the command `aws ' - 'configure set s3.signature_version s3v4` to migrate to v4 and ' - 'resolve this.\n', + 'v4 to authenticate Amazon S3 requests. To migrate to AWS CLI ' + 'v2 behavior, configure the Signature Version S3 setting to ' + 'version 4.\n', out_file=sys.stderr ) diff --git a/awscli/customizations/paginate.py b/awscli/customizations/paginate.py index 836b338b0fef..2d64bae611c3 100644 --- a/awscli/customizations/paginate.py +++ b/awscli/customizations/paginate.py @@ -33,7 +33,7 @@ from botocore import model from awscli.arguments import BaseCLIArgument - +from awscli.utils import resolve_v2_debug_mode logger = logging.getLogger(__name__) @@ -293,7 +293,7 @@ def check_should_enable_pagination_call_parameters( naming space and would be missed by the processing above. This function gets called on the calling-command event. """ - if parsed_globals.v2_debug: + if resolve_v2_debug_mode(parsed_globals): cli_input_json_data = session.emit_first_non_none_response( f"get-cli-input-json-data", ) @@ -304,11 +304,12 @@ def check_should_enable_pagination_call_parameters( ] if pagination_params_in_input_tokens: uni_print( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, if you specify ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, if you specify ' 'pagination parameters by using a file with the ' '`--cli-input-json` parameter, automatic pagination will be ' - 'turned off. This is not the case in v1. See ' - 'https://docs.aws.amazon.com/cli/latest/userguide/' + 'turned off. To retain AWS CLI v1 behavior after upgrading to ' + 'AWS CLI v2, remove all pagination parameters from the input ' + 'JSON. See https://docs.aws.amazon.com/cli/latest/userguide/' 'cliv2-migration-changes.html' '#cliv2-migration-skeleton-paging.\n', out_file=sys.stderr diff --git a/awscli/customizations/s3/subcommands.py b/awscli/customizations/s3/subcommands.py index 665fa9ae2603..b05ae1857020 100644 --- a/awscli/customizations/s3/subcommands.py +++ b/awscli/customizations/s3/subcommands.py @@ -36,7 +36,7 @@ from awscli.customizations.s3.syncstrategy.base import MissingFileSync, \ SizeAndLastModifiedSync, NeverSync from awscli.customizations.s3 import transferconfig - +from awscli.utils import resolve_v2_debug_mode LOGGER = logging.getLogger(__name__) @@ -1060,7 +1060,7 @@ def run(self): if self.parameters['v2_debug']: if operation_name == 'copy': uni_print( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, object ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, object ' 'properties will be copied from the source in multipart ' 'copies between S3 buckets. This may result in extra S3 ' 'API calls being made. Breakage may occur if the principal ' @@ -1464,7 +1464,7 @@ def add_page_size(self, parsed_args): self.parameters['page_size'] = getattr(parsed_args, 'page_size', None) def add_v2_debug(self, parsed_globals): - self.parameters['v2_debug'] = parsed_globals.v2_debug + self.parameters['v2_debug'] = resolve_v2_debug_mode(parsed_globals) def _validate_sse_c_args(self): self._validate_sse_c_arg() diff --git a/awscli/customizations/scalarparse.py b/awscli/customizations/scalarparse.py index a9c56eaa8656..ba90b0667085 100644 --- a/awscli/customizations/scalarparse.py +++ b/awscli/customizations/scalarparse.py @@ -33,6 +33,7 @@ from botocore.exceptions import ProfileNotFound from awscli.customizations.utils import uni_print +from awscli.utils import resolve_v2_debug_mode def register_scalar_parser(event_handlers): @@ -79,12 +80,13 @@ def identity_with_warning(x): if not encountered_timestamp: encountered_timestamp = True uni_print( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, all timestamp ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, all timestamp ' 'response values are returned in the ISO 8601 format. To ' - 'migrate to v2 behavior and resolve this warning, set the ' - 'configuration variable `cli_timestamp_format` to `iso8601`. ' - 'See https://docs.aws.amazon.com/cli/latest/userguide/' - 'cliv2-migration-changes.html#cliv2-migration-timestamp.\n', + 'migrate to v2 behavior, set the configuration variable ' + '`cli_timestamp_format` to `iso8601`. See https://' + 'docs.aws.amazon.com/cli/latest/userguide/' + 'cliv2-migration-changes.html' + '#cliv2-migration-timestamp.\n', out_file=sys.stderr ) return identity(x) @@ -101,4 +103,4 @@ def identity_with_warning(x): def add_scalar_parsers(session, parsed_args, **kwargs): factory = session.get_component('response_parser_factory') factory.set_parser_defaults(blob_parser=identity) - add_timestamp_parser(session, parsed_args.v2_debug) + add_timestamp_parser(session, resolve_v2_debug_mode(parsed_args)) diff --git a/awscli/utils.py b/awscli/utils.py index 3e7e9d6e8e37..4e4809a5f166 100644 --- a/awscli/utils.py +++ b/awscli/utils.py @@ -134,6 +134,18 @@ def find_service_and_method_in_event_name(event_name): return service_name, operation_name +def resolve_v2_debug_mode(args): + # Resolve whether v2-debug mode is enabled, + # following the correct precedence order. + if no_v2_debug := getattr(args, 'no_v2_debug', False): + return False + if getattr(args, 'v2_debug', False): + return True + if os.environ.get('AWS_CLI_UPGRADE_DEBUG_MODE', '').lower() == 'true': + return True + return False + + def is_document_type(shape): """Check if shape is a document type""" return getattr(shape, 'is_document_type', False) diff --git a/tests/functional/test_api_versions.py b/tests/functional/test_api_versions.py index 2c3d339ab1ba..e98f0159cb44 100644 --- a/tests/functional/test_api_versions.py +++ b/tests/functional/test_api_versions.py @@ -59,7 +59,7 @@ def test_v2_debug_migration_warning(self): # Make sure that the migration warning is printed since the user # specified --v2-debug self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: The AWS CLI v2 does not support ' + 'AWS CLI v2 UPGRADE WARNING: The AWS CLI v2 does not support ' 'calling earlier versions of AWS service APIs via the ' '`api_versions` configuration file setting.', stderr diff --git a/tests/unit/customizations/s3/test_subcommands.py b/tests/unit/customizations/s3/test_subcommands.py index c0b5af9eb804..b19d65a352ed 100644 --- a/tests/unit/customizations/s3/test_subcommands.py +++ b/tests/unit/customizations/s3/test_subcommands.py @@ -635,7 +635,7 @@ def test_v2_debug_mv(self): cmd_arc.create_instructions() self.patch_make_request() cmd_arc.run() - warning_str = 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, object '\ + warning_str = 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, object '\ 'properties will be copied from the source in multipart '\ 'copies between S3 buckets.' output_str = f"(dryrun) move: {s3_file} to {s3_file}" diff --git a/tests/unit/customizations/test_globalargs.py b/tests/unit/customizations/test_globalargs.py index 5fb8d93c4fbe..1157563789dd 100644 --- a/tests/unit/customizations/test_globalargs.py +++ b/tests/unit/customizations/test_globalargs.py @@ -221,7 +221,26 @@ def test_ecr_login_v2_debug(self): ) # Verify the expected warning is printed self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: The ecr get-login command has ' + 'AWS CLI v2 UPGRADE WARNING: The ecr get-login command has ' + 'been removed in AWS CLI v2.', + output.stderr.getvalue() + ) + + def test_ecr_login_v2_debug_env_var(self): + parsed_args = FakeParsedArgs(command='ecr') + remaining_args = ['get-login'] + session = get_session() + env = {'AWS_CLI_UPGRADE_DEBUG_MODE': 'true'} + with capture_output() as output: + with mock.patch('os.environ', env): + globalargs.detect_migration_breakage( + parsed_args, + remaining_args, + session + ) + # Verify the expected warning is printed + self.assertIn( + 'AWS CLI v2 UPGRADE WARNING: The ecr get-login command has ' 'been removed in AWS CLI v2.', output.stderr.getvalue() ) @@ -234,7 +253,7 @@ def test_v2_debug_python_utf8_env_var(self): with capture_output() as output: globalargs.detect_migration_breakage(parsed_args, [], session) self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: The PYTHONUTF8 and ' + 'AWS CLI v2 UPGRADE WARNING: The PYTHONUTF8 and ' 'PYTHONIOENCODING environment variables are unsupported ' 'in AWS CLI v2.', output.stderr.getvalue() @@ -248,7 +267,7 @@ def test_v2_debug_python_utf8_resolved_env_var(self): with capture_output() as output: globalargs.detect_migration_breakage(parsed_args, [], session) self.assertNotIn( - 'AWS CLI v2 MIGRATION WARNING: The PYTHONUTF8 and ' + 'AWS CLI v2 UPGRADE WARNING: The PYTHONUTF8 and ' 'PYTHONIOENCODING environment variables are unsupported ' 'in AWS CLI v2.', output.stderr.getvalue() @@ -262,7 +281,7 @@ def test_v2_debug_python_io_encoding_env_var(self): with capture_output() as output: globalargs.detect_migration_breakage(parsed_args, [], session) self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: The PYTHONUTF8 and ' + 'AWS CLI v2 UPGRADE WARNING: The PYTHONUTF8 and ' 'PYTHONIOENCODING environment variables are unsupported ' 'in AWS CLI v2.', output.stderr.getvalue() @@ -281,7 +300,7 @@ def test_v2_debug_s3_sigv2(self): context={'auth_type': 'v2'}, ) self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: The AWS CLI v2 only uses Signature ' + 'AWS CLI v2 UPGRADE WARNING: The AWS CLI v2 only uses Signature ' 'v4 to authenticate Amazon S3 requests.', output.stderr.getvalue() ) diff --git a/tests/unit/customizations/test_paginate.py b/tests/unit/customizations/test_paginate.py index 03eed8e45f30..2b0a1ed818d4 100644 --- a/tests/unit/customizations/test_paginate.py +++ b/tests/unit/customizations/test_paginate.py @@ -335,6 +335,7 @@ def test_v2_debug_call_parameters(self): # migration warning should be printed. # From setUp(), the limit_key is 'Bar' input_tokens = ['Foo', 'Bar'] + self.parsed_globals.no_v2_debug = False self.parsed_globals.v2_debug = True self.parsed_globals.paginate = True self.session.emit_first_non_none_response.side_effect = partial( @@ -355,7 +356,7 @@ def test_v2_debug_call_parameters(self): # We should have printed the migration warning # because the user specified {Bar: 10} in the input JSON self.assertIn( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, if you specify ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, if you specify ' 'pagination parameters by using a file with the ' '`--cli-input-json` parameter, automatic pagination will be ' 'turned off.', @@ -387,7 +388,7 @@ def test_v2_debug_call_params_does_not_print_for_cmd_args(self): # We should not have printed the warning because # the user did not specify any params through CLI input JSON self.assertNotIn( - 'AWS CLI v2 MIGRATION WARNING: In AWS CLI v2, if you specify ' + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, if you specify ' 'pagination parameters by using a file with the ' '`--cli-input-json` parameter, automatic pagination will be ' 'turned off.', diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 8030e2eba786..3f979d8fd25d 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -23,7 +23,7 @@ split_on_commas, ignore_ctrl_c, find_service_and_method_in_event_name, is_document_type, is_document_type_container, is_streaming_blob_type, is_tagged_union_type, operation_uses_document_types, ShapeWalker, - ShapeRecordingVisitor, OutputStreamFactory + ShapeRecordingVisitor, OutputStreamFactory, resolve_v2_debug_mode ) @@ -135,6 +135,32 @@ def test_returns_none_if_event_is_too_short(self): self.assertIs(operation, None) +class TestV2DebugResolution(unittest.TestCase): + def test_no_v2_debug_flag_takes_precedence(self): + args = mock.Mock(no_v2_debug=True, v2_debug=True) + with mock.patch.dict(os.environ, {'AWS_CLI_UPGRADE_DEBUG_MODE': 'true'}): + self.assertFalse(resolve_v2_debug_mode(args)) + + def test_v2_debug_flag_enabled(self): + args = mock.Mock(no_v2_debug=False, v2_debug=True) + self.assertTrue(resolve_v2_debug_mode(args)) + + def test_env_var_enabled(self): + args = mock.Mock(no_v2_debug=False, v2_debug=False) + with mock.patch.dict(os.environ, {'AWS_CLI_UPGRADE_DEBUG_MODE': 'true'}): + self.assertTrue(resolve_v2_debug_mode(args)) + + def test_all_disabled(self): + args = mock.Mock(no_v2_debug=False, v2_debug=False) + with mock.patch.dict(os.environ, {}, clear=True): + self.assertFalse(resolve_v2_debug_mode(args)) + + def test_env_var_non_true_value(self): + args = mock.Mock(no_v2_debug=False, v2_debug=False) + with mock.patch.dict(os.environ, {'AWS_CLI_UPGRADE_DEBUG_MODE': 'false'}): + self.assertFalse(resolve_v2_debug_mode(args)) + + class MockProcess(object): @property def stdin(self): From 74fb5c2968cd494a70cbc8f99fd9a6d011db58be Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 10:12:43 -0400 Subject: [PATCH 07/15] Make cfn deploy false-positive category to reduce change of service-dependent false-negatives. --- .../customizations/cloudformation/deploy.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/awscli/customizations/cloudformation/deploy.py b/awscli/customizations/cloudformation/deploy.py index e212cd4815a3..e33b03a8f362 100644 --- a/awscli/customizations/cloudformation/deploy.py +++ b/awscli/customizations/cloudformation/deploy.py @@ -331,6 +331,18 @@ def deploy(self, deployer, stack_name, template_str, fail_on_empty_changeset=True, disable_rollback=False, v2_debug=False): try: + if v2_debug and fail_on_empty_changeset: + uni_print( + 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, ' + 'deploying an AWS CloudFormation Template that ' + 'results in an empty changeset will NOT result in an ' + 'error. You can add the -–no-fail-on-empty-changeset ' + 'flag to migrate to v2 behavior and resolve this ' + 'warning. See https://docs.aws.amazon.com/cli/latest/' + 'userguide/cliv2-migration-changes.html' + '#cliv2-migration-cfn.\n', + out_file=sys.stderr + ) result = deployer.create_and_wait_for_changeset( stack_name=stack_name, cfn_template=template_str, @@ -343,18 +355,6 @@ def deploy(self, deployer, stack_name, template_str, ) except exceptions.ChangeEmptyError as ex: if fail_on_empty_changeset: - if v2_debug: - uni_print( - 'AWS CLI v2 UPGRADE WARNING: In AWS CLI v2, ' - 'deploying an AWS CloudFormation Template that ' - 'results in an empty changeset will NOT result in an ' - 'error. You can add the -–no-fail-on-empty-changeset ' - 'flag to migrate to v2 behavior and resolve this ' - 'warning. See https://docs.aws.amazon.com/cli/latest/' - 'userguide/cliv2-migration-changes.html' - '#cliv2-migration-cfn.\n', - out_file=sys.stderr - ) raise write_exception(ex, outfile=get_stdout_text_writer()) return 0 From 37d656dfb636669a74ff2dd0d5a061e34f2ee186 Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 10:25:11 -0400 Subject: [PATCH 08/15] Progress --- awscli/customizations/globalargs.py | 2 +- tests/unit/customizations/test_globalargs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awscli/customizations/globalargs.py b/awscli/customizations/globalargs.py index 93633c580b83..59582ab61768 100644 --- a/awscli/customizations/globalargs.py +++ b/awscli/customizations/globalargs.py @@ -244,7 +244,7 @@ def warn_if_sigv2( ): if context.get('auth_type', None) == 'v2': uni_print( - 'AWS CLI v2 MIGRATION WARNING: The AWS CLI v2 only uses Signature ' + 'AWS CLI v2 UPGRADE WARNING: The AWS CLI v2 only uses Signature ' 'v4 to authenticate Amazon S3 requests. To migrate to AWS CLI ' 'v2 behavior, configure the Signature Version S3 setting to ' 'version 4.\n', diff --git a/tests/unit/customizations/test_globalargs.py b/tests/unit/customizations/test_globalargs.py index 1157563789dd..4ff130b9d1f7 100644 --- a/tests/unit/customizations/test_globalargs.py +++ b/tests/unit/customizations/test_globalargs.py @@ -221,7 +221,7 @@ def test_ecr_login_v2_debug(self): ) # Verify the expected warning is printed self.assertIn( - 'AWS CLI v2 UPGRADE WARNING: The ecr get-login command has ' + 'AWS CLI v2 UPGRADE WARNING: The `ecr get-login` command has ' 'been removed in AWS CLI v2.', output.stderr.getvalue() ) @@ -240,7 +240,7 @@ def test_ecr_login_v2_debug_env_var(self): ) # Verify the expected warning is printed self.assertIn( - 'AWS CLI v2 UPGRADE WARNING: The ecr get-login command has ' + 'AWS CLI v2 UPGRADE WARNING: The `ecr get-login` command has ' 'been removed in AWS CLI v2.', output.stderr.getvalue() ) From 6a6a1ce86542e8507596bef84253f008e404b627 Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 09:42:20 -0400 Subject: [PATCH 09/15] Add 'wire' as a valid value for cli_timestamp_format. --- .changes/next-release/enhancement-timestamps-52310.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/next-release/enhancement-timestamps-52310.json diff --git a/.changes/next-release/enhancement-timestamps-52310.json b/.changes/next-release/enhancement-timestamps-52310.json new file mode 100644 index 000000000000..eeb8c3350e93 --- /dev/null +++ b/.changes/next-release/enhancement-timestamps-52310.json @@ -0,0 +1,5 @@ +{ + "type": "enhancement", + "category": "timestamps", + "description": "Add `wire` as a valid value for `cli_timestamp_format`." +} From a230d85e30210bf7731d4b0721f0761f2ef644ed Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 10:27:12 -0400 Subject: [PATCH 10/15] Update from feedback --- .changes/next-release/enhancement-timestamps-52310.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/next-release/enhancement-timestamps-52310.json b/.changes/next-release/enhancement-timestamps-52310.json index eeb8c3350e93..008b443614e0 100644 --- a/.changes/next-release/enhancement-timestamps-52310.json +++ b/.changes/next-release/enhancement-timestamps-52310.json @@ -1,5 +1,5 @@ { "type": "enhancement", "category": "timestamps", - "description": "Add `wire` as a valid value for `cli_timestamp_format`." + "description": "Add ``wire`` as a valid value for ``cli_timestamp_format``." } From 78e4a64f5e4be4cb56a2c8ae5c93a433e9618b23 Mon Sep 17 00:00:00 2001 From: aemous Date: Fri, 17 Oct 2025 13:48:33 -0400 Subject: [PATCH 11/15] Upgrade scalarparse debug warning to only print if the user did not configure cli_timestamp_format. --- awscli/customizations/scalarparse.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/awscli/customizations/scalarparse.py b/awscli/customizations/scalarparse.py index ba90b0667085..c5217a0db804 100644 --- a/awscli/customizations/scalarparse.py +++ b/awscli/customizations/scalarparse.py @@ -51,10 +51,18 @@ def iso_format(value): def add_timestamp_parser(session, v2_debug): factory = session.get_component('response_parser_factory') + print_v2_debug_warnings = v2_debug try: timestamp_format = session.get_scoped_config().get( 'cli_timestamp_format', - 'wire') + None) + if timestamp_format is not None: + # We do not want to print v2 debug warnings if the user explicitly + # configured the cli_timestamp_format, they would not be + # broken in that case. + print_v2_debug_warnings = False + else: + timestamp_format = 'wire' except ProfileNotFound: # If a --profile is provided that does not exist, loading # a value from get_scoped_config will crash the CLI. @@ -91,7 +99,8 @@ def identity_with_warning(x): ) return identity(x) - timestamp_parser = identity_with_warning if v2_debug else identity + timestamp_parser = identity_with_warning \ + if print_v2_debug_warnings else identity elif timestamp_format == 'iso8601': timestamp_parser = iso_format else: From 34ae9f07973b980046f085b7f6f1623135ce8478 Mon Sep 17 00:00:00 2001 From: aemous Date: Wed, 22 Oct 2025 10:27:14 -0400 Subject: [PATCH 12/15] Update binary-params runtime check so that it no longer depends on starting with --- awscli/clidriver.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/awscli/clidriver.py b/awscli/clidriver.py index 8f8a897df6ea..7e9fa32c3266 100644 --- a/awscli/clidriver.py +++ b/awscli/clidriver.py @@ -692,18 +692,17 @@ def _detect_binary_file_migration_change( arg.py_name for arg in arg_table.values() if arg.py_name in parsed_args_to_check and arg.argument_model.type_name == 'blob' - and parsed_args_to_check[arg.py_name].startswith('file://') ] if arg_values_to_check: uni_print( 'AWS CLI v2 UPGRADE WARNING: When specifying a blob-type ' - 'parameter starting with `file://`, AWS CLI v2 will assume ' - 'the content of the file is already base64-encoded. To ' - 'maintain v1 behavior after upgrading to v2, set the ' - '`cli_binary_format` configuration variable to ' - '`raw-in-base64-out`. See https://docs.aws.amazon.com/cli/' - 'latest/userguide/cliv2-migration-changes.html#' - 'cliv2-migration-binaryparam.\n', + 'parameter, AWS CLI v2 will assume the parameter value is ' + 'base64-encoded. To maintain v1 behavior after upgrading ' + 'to v2, set the `cli_binary_format` configuration ' + 'variable to `raw-in-base64-out`. See ' + 'https://docs.aws.amazon.com/cli/latest/userguide' + '/cliv2-migration-changes.html' + '#cliv2-migration-binaryparam.\n', out_file=sys.stderr ) From 8e6b1274aa18779a8021e1ef355386b487a1e84b Mon Sep 17 00:00:00 2001 From: aemous Date: Wed, 22 Oct 2025 11:01:03 -0400 Subject: [PATCH 13/15] Keep uni_print in customizations. --- awscli/clidriver.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/awscli/clidriver.py b/awscli/clidriver.py index 7e9fa32c3266..07d12131af68 100644 --- a/awscli/clidriver.py +++ b/awscli/clidriver.py @@ -41,7 +41,6 @@ ) from awscli.commands import CLICommand from awscli.compat import get_stderr_text_writer -from awscli.customizations.utils import uni_print from awscli.formatter import get_formatter from awscli.help import ( OperationHelpCommand, @@ -694,7 +693,7 @@ def _detect_binary_file_migration_change( and arg.argument_model.type_name == 'blob' ] if arg_values_to_check: - uni_print( + print( 'AWS CLI v2 UPGRADE WARNING: When specifying a blob-type ' 'parameter, AWS CLI v2 will assume the parameter value is ' 'base64-encoded. To maintain v1 behavior after upgrading ' @@ -703,7 +702,7 @@ def _detect_binary_file_migration_change( 'https://docs.aws.amazon.com/cli/latest/userguide' '/cliv2-migration-changes.html' '#cliv2-migration-binaryparam.\n', - out_file=sys.stderr + file=sys.stderr ) From b502eadeca20825b01b0ddf3e54e4cf47e86b5d8 Mon Sep 17 00:00:00 2001 From: aemous Date: Wed, 22 Oct 2025 16:07:40 -0400 Subject: [PATCH 14/15] Remove changelog for already-released change. --- .changes/next-release/enhancement-Migration-48043.json | 2 +- .changes/next-release/enhancement-timestamps-52310.json | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .changes/next-release/enhancement-timestamps-52310.json diff --git a/.changes/next-release/enhancement-Migration-48043.json b/.changes/next-release/enhancement-Migration-48043.json index 562578687c30..ad42ffc841a3 100644 --- a/.changes/next-release/enhancement-Migration-48043.json +++ b/.changes/next-release/enhancement-Migration-48043.json @@ -1,5 +1,5 @@ { "type": "enhancement", "category": "Migration", - "description": "Implement a ``--migrate-v2`` flag that detects breaking changes for AWS CLI v2 for entered commands." + "description": "Implement a ``--v2-debug`` flag that detects breaking changes for AWS CLI v2 for entered commands." } diff --git a/.changes/next-release/enhancement-timestamps-52310.json b/.changes/next-release/enhancement-timestamps-52310.json deleted file mode 100644 index 008b443614e0..000000000000 --- a/.changes/next-release/enhancement-timestamps-52310.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "enhancement", - "category": "timestamps", - "description": "Add ``wire`` as a valid value for ``cli_timestamp_format``." -} From 1657364f2a566ec899848eb28f670d69df353743 Mon Sep 17 00:00:00 2001 From: Ahmed Moustafa <35640105+aemous@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:23:07 -0400 Subject: [PATCH 15/15] Revert local changes to requirements.txt made for testing --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2d1dc01ec558..1802a0285af9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ # botocore and the awscli packages are typically developed # in tandem, so we're requiring the latest develop # branch of botocore and s3transfer when working on the awscli. -# -e git+https://github.com/boto/botocore.git@develop#egg=botocore --e file:///Users/aemous/GitHub/botocore +-e git+https://github.com/boto/botocore.git@develop#egg=botocore -e git+https://github.com/boto/s3transfer.git@develop#egg=s3transfer