Skip to content

Commit 5423f7f

Browse files
committed
Merge branch 'develop' of https://github.com/aws-powertools/powertools-lambda-python into aws-powertools-develop
2 parents c36deb5 + 1455c3b commit 5423f7f

File tree

374 files changed

+14599
-9482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+14599
-9482
lines changed

.chglog/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ style: github
22
template: CHANGELOG.tpl.md
33
info:
44
title: CHANGELOG
5-
repository_url: https://github.com/awslabs/aws-lambda-powertools-python
5+
repository_url: https://github.com/aws-powertools/powertools-lambda-python
66
options:
77
commits:
88
filters:

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
22

3-
* @awslabs/aws-lambda-powertools-python
3+
* @aws-powertools/lambda-python-core

.github/ISSUE_TEMPLATE/bug_report.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
value: |
99
Thank you for submitting a bug report. Please add as much information as possible to help us reproduce, and remove any potential sensitive data.
1010
11-
Please become familiar with [our definition of bug](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/MAINTAINERS.md#is-that-a-bug).
11+
Please become familiar with [our definition of bug](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/MAINTAINERS.md#is-that-a-bug).
1212
- type: textarea
1313
id: expected_behaviour
1414
attributes:
@@ -62,6 +62,7 @@ body:
6262
- "3.8"
6363
- "3.9"
6464
- "3.10"
65+
- "3.11"
6566
validations:
6667
required: true
6768
- type: dropdown
@@ -79,7 +80,7 @@ body:
7980
id: logs
8081
attributes:
8182
label: Debugging logs
82-
description: If available, please share [debugging logs](https://awslabs.github.io/aws-lambda-powertools-python/#debug-mode)
83+
description: If available, please share [debugging logs](https://docs.powertools.aws.dev/lambda/python/#debug-mode)
8384
render: python
8485
validations:
8586
required: false

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/awslabs/aws-lambda-powertools-python/discussions/new
4+
url: https://github.com/aws-powertools/powertools-lambda-python/discussions/new
55
about: Ask a general question about Lambda Powertools

.github/ISSUE_TEMPLATE/feature_request.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ body:
3636
attributes:
3737
label: Acknowledgment
3838
options:
39-
- label: This feature request meets [Powertools for AWS Lambda (Python) Tenets](https://awslabs.github.io/aws-lambda-powertools-python/latest/#tenets)
39+
- label: This feature request meets [Powertools for AWS Lambda (Python) Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)
4040
required: true
41-
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/awslabs/aws-lambda-powertools-java/), [TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
41+
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/aws-powertools/powertools-lambda-java/), [TypeScript](https://github.com/aws-powertools/powertools-lambda-typescript/), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet/)
4242
required: false
4343
- type: markdown
4444
attributes:

.github/ISSUE_TEMPLATE/maintenance.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ body:
5353
attributes:
5454
label: Acknowledgment
5555
options:
56-
- label: This request meets [Powertools for AWS Lambda (Python) Tenets](https://awslabs.github.io/aws-lambda-powertools-python/latest/#tenets)
56+
- label: This request meets [Powertools for AWS Lambda (Python) Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)
5757
required: true
58-
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/awslabs/aws-lambda-powertools-java/), [TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
58+
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/aws-powertools/powertools-lambda-java/), [TypeScript](https://github.com/aws-powertools/powertools-lambda-typescript/), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet/)
5959
required: false
6060
- type: markdown
6161
attributes:

.github/ISSUE_TEMPLATE/rfc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ body:
9191
attributes:
9292
label: Acknowledgment
9393
options:
94-
- label: This feature request meets [Powertools for AWS Lambda (Python) Tenets](https://awslabs.github.io/aws-lambda-powertools-python/latest/#tenets)
94+
- label: This feature request meets [Powertools for AWS Lambda (Python) Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)
9595
required: true
96-
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/awslabs/aws-lambda-powertools-java/), [TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
96+
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/aws-powertools/powertools-lambda-java/), [TypeScript](https://github.com/aws-powertools/powertools-lambda-typescript/), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet/)
9797
required: false
9898
- type: markdown
9999
attributes:

.github/ISSUE_TEMPLATE/static_typing.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
value: |
99
Thank you for submitting a static typing report. Please add as much information as possible to help us reproduce.
1010
11-
Our preferred static type checker is [Mypy](https://mypy.readthedocs.io/en/stable/) using the following [configuration](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/mypy.ini).
11+
Our preferred static type checker is [Mypy](https://mypy.readthedocs.io/en/stable/) using the following [configuration](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/mypy.ini).
1212
- type: dropdown
1313
id: tool
1414
attributes:
@@ -29,6 +29,7 @@ body:
2929
- "3.8"
3030
- "3.9"
3131
- "3.10"
32+
- "3.11"
3233
validations:
3334
required: true
3435
- type: input

.github/ISSUE_TEMPLATE/tech_debt.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ body:
5050
attributes:
5151
label: Acknowledgment
5252
options:
53-
- label: This request meets [Powertools for AWS Lambda (Python) Tenets](https://awslabs.github.io/aws-lambda-powertools-python/latest/#tenets)
53+
- label: This request meets [Powertools for AWS Lambda (Python) Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)
5454
required: true
55-
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/awslabs/aws-lambda-powertools-java/), [TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
55+
- label: Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/aws-powertools/powertools-lambda-java/), [TypeScript](https://github.com/aws-powertools/powertools-lambda-typescript/), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet/)
5656
required: false
5757
- type: markdown
5858
attributes:

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
If your change doesn't seem to apply, please leave them unchecked.
1717

18-
* [ ] [Meet tenets criteria](https://awslabs.github.io/aws-lambda-powertools-python/#tenets)
18+
* [ ] [Meet tenets criteria](https://docs.powertools.aws.dev/lambda/python/#tenets)
1919
* [ ] I have performed a self-review of this change
2020
* [ ] Changes have been tested
2121
* [ ] Changes are documented
22-
* [ ] PR title follows [conventional commit semantics](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/.github/semantic.yml)
22+
* [ ] PR title follows [conventional commit semantics](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/.github/semantic.yml)
2323

2424
<details>
2525
<summary>Is this a breaking change?</summary>

.github/actionlint.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
self-hosted-runner:
22
labels:
3-
- aws-lambda-powertools_ubuntu-latest_4-core
4-
- aws-lambda-powertools_ubuntu-latest_8-core
5-
- aws-lambda-powertools_ubuntu-latest_16-core
3+
- aws-powertools_ubuntu-latest_4-core
4+
- aws-powertools_ubuntu-latest_8-core

.github/actions/create-pr/create_pr_for_staged_changes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function create_temporary_branch_with_changes() {
8989
function create_pr() {
9090
start_span "Creating PR against ${TEMP_BRANCH} branch"
9191
# TODO: create label
92-
NEW_PR_URL=$(gh pr create --title "${PR_TITLE}" --body "${PR_BODY}: ${WORKFLOW_URL}" --base "${BASE_BRANCH}" --label "${SKIP_LABEL}" || error "Failed to create PR") # e.g, https://github.com/awslabs/aws-lambda-powertools/pull/13
92+
NEW_PR_URL=$(gh pr create --title "${PR_TITLE}" --body "${PR_BODY}: ${WORKFLOW_URL}" --base "${BASE_BRANCH}" --label "${SKIP_LABEL}" || error "Failed to create PR") # e.g, https://github.com/aws-powertools/powertools-lambda-python/pull/13
9393

9494
# greedy remove any string until the last URL path, including the last '/'. https://opensource.com/article/17/6/bash-parameter-expansion
9595
debug "Extracing PR Number from PR URL: "${NEW_PR_URL}""
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "Restore sealed source code"
2+
description: "Restore sealed source code and confirm integrity hash"
3+
4+
# PROCESS
5+
#
6+
# 1. Exports artifact name using Prefix + GitHub Run ID (unique for each release trigger)
7+
# 2. Compress entire source code as tarball OR given files
8+
# 3. Create and export integrity hash for tarball
9+
# 4. Upload artifact
10+
# 5. Remove archive
11+
12+
# USAGE
13+
#
14+
# - name: Seal and upload
15+
# id: seal_source_code
16+
# uses: ./.github/actions/seal
17+
# with:
18+
# artifact_name_prefix: "source"
19+
#
20+
# - name: Restore sealed source code
21+
# uses: ./.github/actions/seal-restore
22+
# with:
23+
# integrity_hash: ${{ needs.seal_source_code.outputs.integrity_hash }}
24+
# artifact_name: ${{ needs.seal_source_code.outputs.artifact_name }}
25+
26+
# NOTES
27+
#
28+
# To be used together with .github/actions/seal
29+
30+
inputs:
31+
integrity_hash:
32+
description: "Integrity hash to verify"
33+
required: true
34+
artifact_name:
35+
description: "Sealed artifact name to restore"
36+
required: true
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- id: adjust-path
42+
run: echo "${{ github.action_path }}" >> $GITHUB_PATH
43+
shell: bash
44+
45+
- name: Download artifacts
46+
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
47+
with:
48+
name: ${{ inputs.artifact_name }}
49+
path: .
50+
51+
- id: integrity_hash
52+
name: Create integrity hash for downloaded artifact
53+
run: |
54+
HASH=$(sha256sum "${ARTIFACT_NAME}.tar" | awk '{print $1}')
55+
56+
echo "current_hash=${HASH}" >> "$GITHUB_OUTPUT"
57+
env:
58+
ARTIFACT_NAME: ${{ inputs.artifact_name }}
59+
shell: bash
60+
61+
- id: verify_hash
62+
name: Verify sealed artifact integrity hash
63+
run: test "${CURRENT_HASH}" = "${PROVIDED_HASH}" || exit 1
64+
env:
65+
ARTIFACT_NAME: ${{ inputs.artifact_name }}
66+
PROVIDED_HASH: ${{ inputs.integrity_hash }}
67+
CURRENT_HASH: ${{ steps.integrity_hash.outputs.current_hash }}
68+
shell: bash
69+
70+
# Restore and overwrite tarball in current directory
71+
- id: overwrite
72+
name: Extract tarball
73+
run: tar -xvf "${ARTIFACT_NAME}".tar
74+
env:
75+
ARTIFACT_NAME: ${{ inputs.artifact_name }}
76+
shell: bash
77+
78+
- name: Remove archive
79+
run: rm -f "${ARTIFACT_NAME}.tar"
80+
env:
81+
ARTIFACT_NAME: ${{ inputs.artifact_name }}
82+
shell: bash

.github/actions/seal/action.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: "Seal and hash source code"
2+
description: "Seal and export source code as a tarball artifact along with its integrity hash"
3+
4+
# PROCESS
5+
#
6+
# 1. Exports artifact name using Prefix + GitHub Run ID (unique for each release trigger)
7+
# 2. Compress entire source code as tarball OR given files
8+
# 3. Create and export integrity hash for tarball
9+
# 4. Upload artifact
10+
# 5. Remove archive
11+
12+
# USAGE
13+
#
14+
# - name: Seal and upload
15+
# id: seal_source_code
16+
# uses: ./.github/actions/seal
17+
# with:
18+
# artifact_name_prefix: "source"
19+
20+
inputs:
21+
files:
22+
description: "Files to seal separated by space"
23+
required: false
24+
artifact_name_prefix:
25+
description: "Prefix to use when exporting artifact"
26+
required: true
27+
28+
outputs:
29+
integrity_hash:
30+
description: "Source code integrity hash"
31+
value: ${{ steps.integrity_hash.outputs.integrity_hash }}
32+
artifact_name:
33+
description: "Artifact name containTemporary branch created with staged changed"
34+
value: ${{ steps.export_artifact_name.outputs.artifact_name }}
35+
36+
runs:
37+
using: "composite"
38+
steps:
39+
- id: adjust-path
40+
run: echo "${{ github.action_path }}" >> $GITHUB_PATH
41+
shell: bash
42+
43+
- id: export_artifact_name
44+
name: Export final artifact name
45+
run: echo "artifact_name=${ARTIFACT_PREFIX}-${GITHUB_RUN_ID}" >> "$GITHUB_OUTPUT"
46+
env:
47+
GITHUB_RUN_ID: ${{ github.run_id }}
48+
ARTIFACT_PREFIX: ${{ inputs.artifact_name_prefix }}
49+
shell: bash
50+
51+
# By default, create a tarball of the current directory minus .git
52+
# otherwise it breaks GH Actions when restoring it
53+
- id: compress_all
54+
if: ${{ !inputs.files }}
55+
name: Create tarball for entire source
56+
run: tar --exclude-vcs -cvf "${ARTIFACT_NAME}".tar *
57+
env:
58+
ARTIFACT_NAME: ${{ steps.export_artifact_name.outputs.artifact_name }}
59+
shell: bash
60+
61+
# If a list of files are given, then create a tarball for those only
62+
- id: compress_selected_files
63+
if: ${{ inputs.files }}
64+
name: Create tarball for selected files
65+
run: tar --exclude-vcs -cvf "${ARTIFACT_NAME}".tar "${FILES}"
66+
env:
67+
FILES: ${{ inputs.files }}
68+
ARTIFACT_NAME: ${{ steps.export_artifact_name.outputs.artifact_name }}
69+
shell: bash
70+
71+
- id: integrity_hash
72+
name: Create and export integrity hash for tarball
73+
run: |
74+
HASH=$(sha256sum "${ARTIFACT_NAME}.tar" | awk '{print $1}')
75+
76+
echo "integrity_hash=${HASH}" >> "$GITHUB_OUTPUT"
77+
env:
78+
ARTIFACT_NAME: ${{ steps.export_artifact_name.outputs.artifact_name }}
79+
shell: bash
80+
81+
- name: Upload artifacts
82+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
83+
with:
84+
if-no-files-found: error
85+
name: ${{ steps.export_artifact_name.outputs.artifact_name }}
86+
path: ${{ steps.export_artifact_name.outputs.artifact_name }}.tar
87+
retention-days: 1
88+
89+
- name: Remove archive
90+
run: rm -f "${ARTEFACT_NAME}.tar"
91+
env:
92+
ARTIFACT_NAME: ${{ steps.export_artifact_name.outputs.artifact_name }}
93+
shell: bash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Upload provenance attestation to release"
2+
description: "Download and upload newly generated provenance attestation to latest release."
3+
4+
# PROCESS
5+
#
6+
# 1. Downloads provenance attestation artifact generated earlier in the release pipeline
7+
# 2. Updates latest GitHub draft release pointing to newly git release tag
8+
# 3. Uploads provenance attestation file to latest GitHub draft release
9+
10+
# USAGE
11+
#
12+
# - name: Upload provenance
13+
# id: upload-provenance
14+
# uses: ./.github/actions/upload-release-provenance
15+
# with:
16+
# release_version: ${{ needs.seal.outputs.RELEASE_VERSION }}
17+
# provenance_name: ${{needs.provenance.outputs.provenance-name}}
18+
# github_token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
# NOTES
21+
#
22+
# There are no outputs.
23+
#
24+
25+
inputs:
26+
provenance_name:
27+
description: "Provenance artifact name to download"
28+
required: true
29+
release_version:
30+
description: "Release version (e.g., 2.20.0)"
31+
required: true
32+
github_token:
33+
description: "GitHub token for GitHub CLI"
34+
required: true
35+
36+
runs:
37+
using: "composite"
38+
steps:
39+
- id: adjust-path
40+
run: echo "${{ github.action_path }}" >> $GITHUB_PATH
41+
shell: bash
42+
43+
- id: download-provenance
44+
name: Download newly generated provenance
45+
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1
46+
with:
47+
name: ${{ inputs.provenance_name }}
48+
49+
- id: sync-release-tag
50+
name: Update draft release tag to release commit tag
51+
run: |
52+
CURRENT_DRAFT_RELEASE=$(gh release list | awk '{ if ($2 == "Draft") print $1}')
53+
gh release edit "${CURRENT_DRAFT_RELEASE}" --tag v"${RELEASE_VERSION}"
54+
env:
55+
RELEASE_VERSION: ${{ inputs.release_version }}
56+
GH_TOKEN: ${{ inputs.github_token }}
57+
shell: bash
58+
59+
- id: upload-provenance
60+
name: Upload provenance to release tag
61+
# clobber flag means overwrite release asset if available (eventual consistency, retried failed steps)
62+
run: gh release upload --clobber v"${RELEASE_VERSION}" "${PROVENANCE_FILE}"
63+
env:
64+
RELEASE_VERSION: ${{ inputs.release_version }}
65+
PROVENANCE_FILE: ${{ inputs.provenance_name }}
66+
GH_TOKEN: ${{ inputs.github_token }}
67+
shell: bash

0 commit comments

Comments
 (0)