Skip to content

Commit

Permalink
Merge pull request #3560 from aws/release-v1.86.0
Browse files Browse the repository at this point in the history
Release 1.86.0 (to main)
  • Loading branch information
xazhao authored Mar 7, 2024
2 parents cf74322 + 62df231 commit 5a5ab3c
Show file tree
Hide file tree
Showing 22 changed files with 1,076 additions and 627 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: chore
include: scope
reviewers:
- aws/sae-enterprise
open-pull-requests-limit: 10
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: make init
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:

steps:
- name: Checkout the PR
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -29,7 +29,7 @@ jobs:
cp bin/public_interface.py "${{ runner.temp }}"/public_interface.py
- name: Checkout the base
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: "${{ github.base_ref }}"

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/close_issue_message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ jobs:
# These inputs are both required
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
### ⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -71,6 +71,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
4 changes: 2 additions & 2 deletions integration/helpers/deployer/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import sys
import time
from collections import OrderedDict
from datetime import datetime
from datetime import datetime, timezone

import botocore

Expand Down Expand Up @@ -140,7 +140,7 @@ def create_changeset(
"ChangeSetType": changeset_type,
"Parameters": parameter_values,
"Capabilities": capabilities,
"Description": f"Created by SAM CLI at {datetime.utcnow().isoformat()} UTC",
"Description": f"Created by SAM CLI at {datetime.now(timezone.utc).isoformat()} UTC",
"Tags": tags,
}

Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/deployer/utils/time_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def parse_date(date_string):
# will use current local time as the base for subtraction, but falsely assume it is a UTC time. Therefore
# the time that dateparser returns will be a `datetime` object that did not have any timezone information.
# So be explicit to set the time to UTC.
"RELATIVE_BASE": datetime.datetime.utcnow()
"RELATIVE_BASE": datetime.datetime.now(datetime.timezone.utc)
}

return dateparser.parse(date_string, settings=parser_settings)
2 changes: 1 addition & 1 deletion samtranslator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.85.0"
__version__ = "1.86.0"
133 changes: 133 additions & 0 deletions samtranslator/internal/data/aws_managed_policies.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions samtranslator/metrics/metrics.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
Helper classes to publish metrics
"""

import logging
from abc import ABC, abstractmethod
from datetime import datetime
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, TypedDict, Union

from samtranslator.internal.deprecation_control import deprecated
Expand Down Expand Up @@ -114,7 +115,7 @@ def __init__(
self.value = value
self.unit = unit
self.dimensions = dimensions if dimensions else []
self.timestamp = timestamp if timestamp else datetime.utcnow()
self.timestamp = timestamp if timestamp else datetime.now(timezone.utc)

def get_metric_data(self) -> Dict[str, Any]:
return {
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/model/eventsources/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _link_policy(self, role, destination_config_policy=None): # type: ignore[no
if role.Policies and destination_config_policy not in role.Policies:
policy_document = destination_config_policy.get("PolicyDocument")
# do not add the policy if the same policy document is already present
if policy_document not in [d["PolicyDocument"] for d in role.Policies]:
if policy_document not in [d.get("PolicyDocument", {}) for d in role.Policies]:
role.Policies.append(destination_config_policy)

def _validate_filter_criteria(self) -> None:
Expand Down
4 changes: 3 additions & 1 deletion samtranslator/model/s3_utils/uri_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def construct_s3_location_object(

s3_pointer = location_uri

else:
elif isinstance(location_uri, str):
# SSM Pattern found here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html
ssm_pattern = r"{{resolve:(ssm|ssm-secure|secretsmanager):[a-zA-Z0-9_.\-/]+(:\d+)?}}"
match = search(ssm_pattern, location_uri)
Expand All @@ -107,6 +107,8 @@ def construct_s3_location_object(
"parameter.",
)
s3_pointer = _s3_pointer
else:
raise InvalidResourceException(logical_id, f"'{property_name}' must be of type dict or string.")

code = {"S3Bucket": s3_pointer["Bucket"], "S3Key": s3_pointer["Key"]}
if "Version" in s3_pointer:
Expand Down
Loading

0 comments on commit 5a5ab3c

Please sign in to comment.