Skip to content

chore: merge v2 branch #1625

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

Merged
merged 31 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
719c9eb
feat(event_handler): improved support for headers and cookies in v2 (…
rubenfonseca Aug 29, 2022
90b45aa
docs(homepage): note about v2 version
heitorlessa Aug 29, 2022
c83c635
refactor(batch): remove legacy sqs_batch_processor (#1492)
rubenfonseca Sep 1, 2022
a00156d
feat(event_handler): add cookies as 1st class citizen in v2 (#1487)
rubenfonseca Sep 2, 2022
8cfa3b3
feat(tracer): support methods with the same name (ABCs) by including …
leandrodamascena Sep 8, 2022
0c8453f
chore(core): expose modules in the Top-level package (#1517)
kmkhr Sep 15, 2022
e201bd2
chore(ci): migrate E2E tests to CDK CLI and off Docker (#1501)
heitorlessa Sep 20, 2022
74d21f1
fix(ci): workflow should use npx for CDK CLI
heitorlessa Sep 20, 2022
839aecb
feat(idempotency): support methods with the same name (ABCs) by inclu…
leandrodamascena Sep 27, 2022
7d7e68f
chore: bump pyproject version to 2.0
rubenfonseca Oct 4, 2022
b0bc888
chore(deps): lock importlib to 4.x
rubenfonseca Oct 4, 2022
bbc1c14
feat(layers): add support for publishing v2 layer (#1558)
rubenfonseca Oct 7, 2022
8ee6259
docs(v2): document optional dependencies and local dev (#1574)
heitorlessa Oct 7, 2022
79a676f
refactor(e2e): fix idempotency typing
heitorlessa Oct 11, 2022
b31786d
refactor(e2e): make table name dynamic
heitorlessa Oct 11, 2022
f63d437
bug(v2/idempotency-e2e): fixing e2e tests
leandrodamascena Oct 11, 2022
0464f46
feat(layer): publish SAR v2 via Github actions (#1585)
rubenfonseca Oct 13, 2022
cc18880
feat(parameters): migrate AppConfig to new APIs due to API deprecatio…
leandrodamascena Oct 14, 2022
fe45ff7
fix: lint files
rubenfonseca Oct 14, 2022
e5a263a
fix: mypy errors
rubenfonseca Oct 14, 2022
18bee37
docs(homepage): auto-update Layer ARN on every release (#1610)
rubenfonseca Oct 18, 2022
648501b
chore(deps): remove email-validator; use Str over EmailStr in SES mod…
rubenfonseca Oct 18, 2022
ec96b14
chore(dep): add cfn-lint as a dev dependency; pre-commit (#1612)
heitorlessa Oct 18, 2022
2864b46
feat(apigateway): ignore trailing slashes in routes (APIGatewayRestRe…
walmsles Oct 19, 2022
bf0ae43
feat(data-classes): replace AttributeValue in DynamoDBStreamEvent wit…
shanab Oct 19, 2022
feca650
refactor(apigateway): remove POWERTOOLS_EVENT_HANDLER_DEBUG env var (…
heitorlessa Oct 19, 2022
4bba49c
chore(ci): remove v1 workflows (#1617)
rubenfonseca Oct 19, 2022
11ae5a9
feat(ci): release docs as alpha when doing a pre-release (#1624)
rubenfonseca Oct 20, 2022
ec4204f
docs(upgrade_guide): add latest changes and quick summary (#1623)
leandrodamascena Oct 20, 2022
61aa6bc
Merge branch 'develop' into v2
rubenfonseca Oct 20, 2022
b4a12b2
fix: lock dependencies
rubenfonseca Oct 20, 2022
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
35 changes: 32 additions & 3 deletions .github/workflows/on_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ env:

on:
release:
# We can't filter by tag here, so we filter later on the first job
types: [published]

workflow_dispatch:
inputs:
version_to_publish:
description: "Version to be released in PyPi, Docs, and Lambda Layer, e.g. v1.26.4"
default: v1.26.4
default: v2.0.0
required: true
skip_pypi:
description: "Skip publishing to PyPi as it can't publish more than once. Useful for semi-failed releases"
Expand All @@ -42,9 +44,15 @@ on:
default: false
type: boolean
required: false
pre_release:
description: "Publishes documentation using a pre-release tag. You are still responsible for passing a pre-release version tag to the workflow."
default: false
type: boolean
required: false

jobs:
release:
if: ${{ startsWith(github.ref, 'refs/tags/v2') }}
environment: release
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -110,17 +118,38 @@ jobs:
contents: write
uses: ./.github/workflows/reusable_publish_changelog.yml

# When doing a pre-release, we want to publish the docs as "alpha" instead of replacing the latest docs
prepare_docs_alias:
runs-on: ubuntu-latest
outputs:
DOCS_ALIAS: ${{ steps.set-alias.outputs.DOCS_ALIAS }}
steps:
- name: Set docs alias
id: set-alias
run: |
DOCS_ALIAS=latest
if [[ "${{ github.event.release.prerelease || inputs.pre_release }}" == true ]] ; then
DOCS_ALIAS=alpha
fi
echo DOCS_ALIAS="$DOCS_ALIAS" >> "$GITHUB_OUTPUT"

docs:
needs: [release, changelog]
needs: [release, changelog, prepare_docs_alias]
permissions:
contents: write
pages: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: ${{ needs.release.outputs.RELEASE_VERSION }}
alias: latest
alias: ${{ needs.prepare_docs_alias.outputs.DOCS_ALIAS }}
detached_mode: true

publish_layer:
needs: release
uses: ./.github/workflows/publish_v2_layer.yml
with:
latest_published_version: ${{ needs.release.outputs.RELEASE_VERSION }}

post_release:
needs: release
permissions:
Expand Down
86 changes: 0 additions & 86 deletions .github/workflows/publish_layer.yml

This file was deleted.

104 changes: 100 additions & 4 deletions .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,108 @@ on:
workflow_dispatch:
inputs:
latest_published_version:
description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0"
description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0"
required: true
workflow_call:
inputs:
latest_published_version:
type: string
description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0"
required: true

jobs:
dummy:
build-layer:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./layer
outputs:
release-tag-version: ${{ steps.release-notes-tag.outputs.RELEASE_TAG_VERSION }}
steps:
- name: Hello world
run: echo "hello world"
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install poetry
run: pipx install poetry
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.12"
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: Resolve and install project dependencies
# CDK spawns system python when compiling stack
# therefore it ignores both activated virtual env and cached interpreter by GH
run: |
poetry export --format requirements.txt --output requirements.txt
pip install -r requirements.txt
- name: Set release notes tag
id: release-notes-tag
run: |
RELEASE_INPUT=${{ inputs.latest_published_version }}
LATEST_TAG=$(git describe --tag --abbrev=0)
RELEASE_TAG_VERSION=${RELEASE_INPUT:-$LATEST_TAG}
echo RELEASE_TAG_VERSION="${RELEASE_TAG_VERSION:1}" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v2.0.0
# NOTE: we need QEMU to build Layer against a different architecture (e.g., ARM)
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v2.0.0
- name: install cdk and deps
run: |
npm install -g aws-cdk@2.44.0
cdk --version
- name: CDK build
run: cdk synth --context version="${{ steps.release-notes-tag.outputs.RELEASE_TAG_VERSION }}" -o cdk.out
- name: zip output
run: zip -r cdk.out.zip cdk.out
- name: Archive CDK artifacts
uses: actions/upload-artifact@v3
with:
name: cdk-layer-artefact
path: layer/cdk.out.zip

deploy-beta:
needs: build-layer
uses: ./.github/workflows/reusable_deploy_v2_layer_stack.yml
secrets: inherit
with:
stage: "BETA"
artefact-name: "cdk-layer-artefact"
environment: "layer-beta"
latest_published_version: ${{ inputs.latest_published_version }}

deploy-prod:
needs: deploy-beta
uses: ./.github/workflows/reusable_deploy_v2_layer_stack.yml
secrets: inherit
with:
stage: "PROD"
artefact-name: "cdk-layer-artefact"
environment: "layer-prod"
latest_published_version: ${{ inputs.latest_published_version }}

deploy-sar-beta:
needs: build-layer
uses: ./.github/workflows/reusable_deploy_v2_sar.yml
secrets: inherit
with:
stage: "BETA"
artefact-name: "cdk-layer-artefact"
environment: "layer-beta"
package-version: ${{ needs.build-layer.outputs.release-tag-version }}

deploy-sar-prod:
needs: [build-layer, deploy-sar-beta]
uses: ./.github/workflows/reusable_deploy_v2_sar.yml
secrets: inherit
with:
stage: "PROD"
artefact-name: "cdk-layer-artefact"
environment: "layer-prod"
package-version: ${{ needs.build-layer.outputs.release-tag-version }}
4 changes: 2 additions & 2 deletions .github/workflows/rebuild_latest_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
workflow_dispatch:
inputs:
latest_published_version:
description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.26.7"
default: "v1.28.0"
description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0"
default: "v2.0.0"
required: true

jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Deploy cdk stack
name: Deploy CDK Layer v2 stack

permissions:
id-token: write
contents: read

env:
CDK_VERSION: 2.44.0

on:
workflow_call:
inputs:
Expand All @@ -19,6 +22,10 @@ on:
description: "GitHub Environment to use for encrypted secrets"
required: true
type: string
latest_published_version:
description: "Latest version that is published"
required: true
type: string

jobs:
deploy-cdk-stack:
Expand Down Expand Up @@ -82,7 +89,7 @@ jobs:
pip install -r requirements.txt
- name: install cdk and deps
run: |
npm install -g aws-cdk@2.29.0
npm install -g "aws-cdk@$CDK_VERSION"
cdk --version
- name: install deps
run: poetry install
Expand All @@ -94,6 +101,23 @@ jobs:
- name: unzip artefact
run: unzip cdk.out.zip
- name: CDK Deploy Layer
run: cdk deploy --app cdk.out --context region=${{ matrix.region }} 'LayerStack' --require-approval never --verbose
run: cdk deploy --app cdk.out --context region=${{ matrix.region }} 'LayerV2Stack' --require-approval never --verbose --outputs-file cdk-outputs.json
- name: Store latest Layer ARN
if: ${{ inputs.stage == 'PROD' }}
run: |
jq -c '.LayerV2Stack.VersionArn' cdk-outputs.json > cdk-layer-stack-${{ matrix.region }}-layer-version.txt
jq -c '.LayerV2Stack.Arm64VersionArn' cdk-outputs.json >> cdk-layer-stack-${{ matrix.region }}-layer-version.txt
- name: CDK Deploy Canary
run: cdk deploy --app cdk.out --context region=${{ matrix.region}} --parameters DeployStage="${{ inputs.stage }}" 'CanaryStack' --require-approval never --verbose
run: cdk deploy --app cdk.out --context region=${{ matrix.region}} --parameters DeployStage="${{ inputs.stage }}" 'CanaryV2Stack' --require-approval never --verbose
- name: Save Layer ARN artifact
uses: actions/upload-artifacts@v3
with:
name: cdk-layer-stack
path: cdk-layer-stack*

update_v2_layer_arn_docs:
permissions:
contents: write
uses: ./.github/workflows/reusable_update_v2_layer_arn_docs.yml
with:
latest_published_version: ${{ inputs.latest_published_version }}
Loading