Skip to content

Commit

Permalink
Merge branch 'release-1.34.31' into develop
Browse files Browse the repository at this point in the history
* release-1.34.31:
  Bumping version to 1.34.31
  Update changelog based on model updates
  Merge customizations for codeartifact
  • Loading branch information
aws-sdk-python-automation committed Oct 1, 2024
2 parents 12c1a3b + 4a7db84 commit 4fe8654
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .changes/1.34.31.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"category": "``bedrock-agent``",
"description": "This release adds support to stop an ongoing ingestion job using the StopIngestionJob API in Agents for Amazon Bedrock.",
"type": "api-change"
},
{
"category": "``codeartifact``",
"description": "Add support for the dual stack endpoints.",
"type": "api-change"
},
{
"category": "``rds``",
"description": "This release provides additional support for enabling Aurora Limitless Database DB clusters.",
"type": "api-change"
}
]
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
CHANGELOG
=========

1.34.31
=======

* api-change:``bedrock-agent``: This release adds support to stop an ongoing ingestion job using the StopIngestionJob API in Agents for Amazon Bedrock.
* api-change:``codeartifact``: Add support for the dual stack endpoints.
* api-change:``rds``: This release provides additional support for enabling Aurora Limitless Database DB clusters.


1.34.30
=======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import os

__version__ = '1.34.30'
__version__ = '1.34.31'

#
# Get our data path to be added to botocore's search path
Expand Down
7 changes: 7 additions & 0 deletions awscli/customizations/codeartifact/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ class CodeArtifactLogin(BasicCommand):
'help_text': 'Your CodeArtifact repository name',
'required': True,
},
{
'name': 'endpoint-type',
'help_text': 'The type of endpoint you want the tool to interact with',
'required': False
},
{
'name': 'dry-run',
'action': 'store_true',
Expand Down Expand Up @@ -750,6 +755,8 @@ def _get_repository_endpoint(
'repository': parsed_args.repository,
'format': package_format
}
if parsed_args.endpoint_type:
kwargs['endpointType'] = parsed_args.endpoint_type
if parsed_args.domain_owner:
kwargs['domainOwner'] = parsed_args.domain_owner

Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.34.'
# The full version, including alpha/beta/rc tags.
release = '1.34.30'
release = '1.34.31'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore==1.35.30
botocore==1.35.31
docutils>=0.10,<0.17
s3transfer>=0.10.0,<0.11.0
PyYAML>=3.10,<6.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def find_version(*file_paths):


install_requires = [
'botocore==1.35.30',
'botocore==1.35.31',
'docutils>=0.10,<0.17',
's3transfer>=0.10.0,<0.11.0',
'PyYAML>=3.10,<6.1',
Expand Down
159 changes: 157 additions & 2 deletions tests/functional/codeartifact/test_codeartifact_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def setUp(self):
self.domain = 'domain'
self.domain_owner = 'domain-owner'
self.repository = 'repository'
self.endpoint_type = 'ipv4'
self.auth_token = 'auth-token'
self.namespace = 'namespace'
self.nuget_index_url_fmt = '{endpoint}v3/index.json'
Expand Down Expand Up @@ -66,7 +67,9 @@ def tearDown(self):
self.file_creator.remove_all()

def _setup_cmd(self, tool,
include_domain_owner=False, dry_run=False,
include_domain_owner=False,
dry_run=False,
include_endpoint_type=False,
include_duration_seconds=False,
include_namespace=False):
package_format = CodeArtifactLogin.TOOL_MAP[tool]['package_format']
Expand All @@ -88,6 +91,9 @@ def _setup_cmd(self, tool,
if include_domain_owner:
cmdline.extend(['--domain-owner', self.domain_owner])

if include_endpoint_type:
cmdline.extend(['--endpoint-type', self.endpoint_type])

if dry_run:
cmdline.append('--dry-run')

Expand Down Expand Up @@ -264,7 +270,8 @@ def _assert_expiration_printed_to_stdout(self, stdout):

def _assert_operations_called(
self, package_format, result,
include_domain_owner=False, include_duration_seconds=False
include_domain_owner=False, include_duration_seconds=False,
include_endpoint_type=False
):

get_auth_token_kwargs = {
Expand All @@ -280,6 +287,9 @@ def _assert_operations_called(
get_auth_token_kwargs['domainOwner'] = self.domain_owner
get_repo_endpoint_kwargs['domainOwner'] = self.domain_owner

if include_endpoint_type:
get_repo_endpoint_kwargs['endpointType'] = self.endpoint_type

if include_duration_seconds:
get_auth_token_kwargs['durationSeconds'] = self.duration

Expand Down Expand Up @@ -529,6 +539,34 @@ def test_swift_login_with_namespace_dry_run(self):
self._assert_dry_run_execution(
self._get_swift_commands(scope=self.namespace),result.stdout)

@mock.patch('awscli.customizations.codeartifact.login.is_macos', False)
def test_swift_login_with_namespace_with_endpoint_type(self):
cmdline = self._setup_cmd(
tool='swift', include_namespace=True, include_endpoint_type=True
)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='swift', result=result, include_endpoint_type=True)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(
self._get_swift_commands(scope=self.namespace)
)
self._assert_netrc_has_expected_content()

@mock.patch('awscli.customizations.codeartifact.login.is_macos', True)
def test_swift_login_with_domain_owner_with_endpoint_type(self):
cmdline = self._setup_cmd(
tool='swift', include_domain_owner=True, include_endpoint_type=True
)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='swift', result=result, include_endpoint_type=True,
include_domain_owner=True)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(
self._get_swift_commands(token=self.auth_token)
)

def test_nuget_login_without_domain_owner_without_duration_seconds(self):
cmdline = self._setup_cmd(tool='nuget')
result = self.cli_runner.run(cmdline)
Expand Down Expand Up @@ -586,6 +624,27 @@ def test_nuget_login_with_domain_owner_duration_sections(self):
self._get_nuget_commands()
)

def test_nuget_login_with_domain_owner_duration_endpoint_type(self):
cmdline = self._setup_cmd(
tool='nuget',
include_domain_owner=True,
include_duration_seconds=True,
include_endpoint_type=True
)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(
package_format='nuget',
include_domain_owner=True,
include_duration_seconds=True,
include_endpoint_type=True,
result=result
)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(
self._get_nuget_commands()
)

def test_nuget_login_without_domain_owner_dry_run(self):
cmdline = self._setup_cmd(tool='nuget', dry_run=True)
result = self.cli_runner.run(cmdline)
Expand Down Expand Up @@ -646,6 +705,26 @@ def test_nuget_login_with_domain_owner_duration_seconds_dry_run(self):
result.stdout
)

def test_nuget_login_with_domain_owner_duration_seconds_with_endpoint_type_dryrun(self):
cmdline = self._setup_cmd(
tool='nuget', include_domain_owner=True,
include_duration_seconds=True,
dry_run=True, include_endpoint_type=True
)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(
package_format='nuget',
include_domain_owner=True,
include_duration_seconds=True,
include_endpoint_type=True,
result=result
)
self._assert_dry_run_execution(
self._get_nuget_commands(),
result.stdout
)

@mock.patch('awscli.customizations.codeartifact.login.is_windows', True)
def test_dotnet_login_without_domain_owner_without_duration_seconds(self):
cmdline = self._setup_cmd(tool='dotnet')
Expand All @@ -657,6 +736,17 @@ def test_dotnet_login_without_domain_owner_without_duration_seconds(self):
self._get_dotnet_commands()
)

@mock.patch('awscli.customizations.codeartifact.login.is_windows', True)
def test_dotnet_login_without_domain_owner_without_duration_seconds_with_endpoint_type(self):
cmdline = self._setup_cmd(tool='dotnet', include_endpoint_type=True)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='nuget', result=result, include_endpoint_type=True)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(
self._get_dotnet_commands()
)

@mock.patch('awscli.customizations.codeartifact.login.is_windows', True)
def test_dotnet_login_with_domain_owner_without_duration_seconds(self):
cmdline = self._setup_cmd(tool='dotnet', include_domain_owner=True)
Expand Down Expand Up @@ -799,6 +889,21 @@ def test_dotnet_login_sources_listed_with_extra_non_list_text(self):
]]
self._assert_subprocess_check_output_execution(commands)

@mock.patch('awscli.customizations.codeartifact.login.is_windows', True)
def test_dotnet_login_sources_listed_with_extra_non_list_text_with_endpoint_type(self):

self.subprocess_check_output_patch.return_value = \
self._NUGET_SOURCES_LIST_RESPONSE_WITH_EXTRA_NON_LIST_TEXT

cmdline = self._setup_cmd(tool='dotnet', include_endpoint_type=True)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='nuget', result=result, include_endpoint_type=True)
commands = [[
'dotnet', 'nuget', 'list', 'source', '--format', 'detailed'
]]
self._assert_subprocess_check_output_execution(commands)

def test_npm_login_without_domain_owner(self):
cmdline = self._setup_cmd(tool='npm')
result = self.cli_runner.run(cmdline)
Expand Down Expand Up @@ -849,6 +954,18 @@ def test_npm_login_with_domain_owner(self):
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(self._get_npm_commands())

def test_npm_login_with_domain_owner_endpoint_type(self):
cmdline = self._setup_cmd(tool='npm', include_domain_owner=True, include_endpoint_type=True)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(
package_format='npm', result=result,
include_domain_owner=True, include_duration_seconds=False,
include_endpoint_type=True
)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(self._get_npm_commands())

def test_npm_login_with_domain_owner_duration(self):
cmdline = self._setup_cmd(tool='npm', include_domain_owner=True,
include_duration_seconds=True)
Expand Down Expand Up @@ -896,6 +1013,18 @@ def test_npm_login_with_namespace_dry_run(self):
result.stdout
)

def test_npm_login_with_namespace_endpoint_type_dry_run(self):
cmdline = self._setup_cmd(
tool='npm', include_namespace=True, dry_run=True, include_endpoint_type=True
)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='npm', result=result, include_endpoint_type=True)
self._assert_dry_run_execution(
self._get_npm_commands(scope='@{}'.format(self.namespace)),
result.stdout
)

def test_pip_login_without_domain_owner(self):
cmdline = self._setup_cmd(tool='pip')
result = self.cli_runner.run(cmdline)
Expand Down Expand Up @@ -933,6 +1062,18 @@ def test_pip_login_with_domain_owner_duration(self):
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(self._get_pip_commands())

def test_pip_login_with_domain_owner_duration_endpoint_type(self):
cmdline = self._setup_cmd(tool='pip', include_domain_owner=True,
include_duration_seconds=True, include_endpoint_type=True)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(
package_format='pypi', result=result, include_domain_owner=True,
include_duration_seconds=True, include_endpoint_type=True
)
self._assert_expiration_printed_to_stdout(result.stdout)
self._assert_subprocess_execution(self._get_pip_commands())

def test_pip_login_with_domain_owner_dry_run(self):
cmdline = self._setup_cmd(
tool='pip', include_domain_owner=True, dry_run=True
Expand Down Expand Up @@ -1012,6 +1153,20 @@ def test_twine_login_without_domain_owner_dry_run(self):
password=self.auth_token
)

def test_twine_login_without_domain_owner_dry_run_endpoint_type(self):
cmdline = self._setup_cmd(tool='twine', dry_run=True, include_endpoint_type=True)
result = self.cli_runner.run(cmdline)
self.assertEqual(result.rc, 0)
self._assert_operations_called(package_format='pypi', result=result, include_endpoint_type=True)
self.assertFalse(os.path.exists(self.test_pypi_rc_path))
self._assert_pypi_rc_has_expected_content(
pypi_rc_str=self._get_twine_commands(),
server='codeartifact',
repo_url=self.endpoint,
username='aws',
password=self.auth_token
)

def test_twine_login_with_domain_owner(self):
cmdline = self._setup_cmd(tool='twine', include_domain_owner=True)
result = self.cli_runner.run(cmdline)
Expand Down

0 comments on commit 4fe8654

Please sign in to comment.