Skip to content

Commit ab19c1a

Browse files
committed
Merge branch 'develop' into chore/changelog-automate
* develop: chore(deps): bump jsii from 1.61.0 to 1.62.0 (aws-powertools#1294) chore(ci): experiment with conditional on outputs chore(ci): improve error handling for non-issue numbers fix(ci): address conditional type on_merge chore(ci): add end to end testing mechanism (aws-powertools#1247) chore(deps-dev): bump mypy-boto3-appconfig from 1.24.0 to 1.24.29 (aws-powertools#1295)
2 parents 4330cab + e677cab commit ab19c1a

26 files changed

+1078
-35
lines changed

.github/scripts/constants.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = Object.freeze({
1515
/** @type {number} */
1616
"PR_NUMBER": process.env.PR_NUMBER || 0,
1717

18-
/** @type {boolean} */
19-
"PR_IS_MERGED": process.env.PR_IS_MERGED || false,
18+
/** @type {string} */
19+
"PR_IS_MERGED": process.env.PR_IS_MERGED || "false",
2020

2121
/** @type {string} */
2222
"LABEL_BLOCK": "do-not-merge",

.github/scripts/label_related_issue.js

+24-19
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,35 @@ module.exports = async ({github, context, core}) => {
1313
return core.notice("Author in IGNORE_AUTHORS list; skipping...")
1414
}
1515

16-
if (!PR_IS_MERGED) {
16+
if (PR_IS_MERGED == "false") {
1717
return core.notice("Only merged PRs to avoid spam; skipping")
1818
}
1919

20-
2120
const RELATED_ISSUE_REGEX = /Issue number:[^\d\r\n]+(?<issue>\d+)/;
22-
const isMatch = RELATED_ISSUE_REGEX.exec(PR_BODY);
23-
if (!isMatch) {
24-
core.setFailed(`Unable to find related issue for PR number ${PR_NUMBER}.\n\n Body details: ${PR_BODY}`);
25-
return await github.rest.issues.createComment({
21+
22+
try {
23+
const isMatch = RELATED_ISSUE_REGEX.exec(PR_BODY);
24+
if (!isMatch) {
25+
core.setFailed(`Unable to find related issue for PR number ${PR_NUMBER}.\n\n Body details: ${PR_BODY}`);
26+
return await github.rest.issues.createComment({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
body: `${HANDLE_MAINTAINERS_TEAM} No related issues found. Please ensure '${LABEL_PENDING_RELEASE}' label is applied before releasing.`,
30+
issue_number: PR_NUMBER,
31+
});
32+
}
33+
34+
const { groups: {issue} } = isMatch
35+
36+
core.info(`Auto-labeling related issue ${issue} for release`)
37+
return await github.rest.issues.addLabels({
38+
issue_number: issue,
2639
owner: context.repo.owner,
2740
repo: context.repo.repo,
28-
body: `${HANDLE_MAINTAINERS_TEAM} No related issues found. Please ensure '${LABEL_PENDING_RELEASE}' label is applied before releasing.`,
29-
issue_number: PR_NUMBER,
30-
});
41+
labels: [LABEL_PENDING_RELEASE]
42+
})
43+
} catch (error) {
44+
core.setFailed(`Is this issue number (${issue}) valid? Perhaps a discussion?`);
45+
throw new Error(error);
3146
}
32-
33-
const { groups: {issue} } = isMatch
34-
35-
core.info(`Auto-labeling related issue ${issue} for release`)
36-
return await github.rest.issues.addLabels({
37-
issue_number: issue,
38-
owner: context.repo.owner,
39-
repo: context.repo.repo,
40-
labels: [LABEL_PENDING_RELEASE]
41-
})
4247
}

.github/workflows/on_merged_pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
release_label_on_merge:
1818
needs: get_pr_details
1919
runs-on: ubuntu-latest
20+
if: needs.get_pr_details.outputs.prIsMerged == 'true'
2021
steps:
2122
- uses: actions/checkout@v3
2223
- name: "Label PR related issue for release"

.github/workflows/run-e2e-tests.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: run-e2e-tests
2+
on:
3+
workflow_dispatch:
4+
env:
5+
AWS_DEFAULT_REGION: us-east-1
6+
E2E_TESTS_PATH: tests/e2e/
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # needed to request JWT with GitHub's OIDC Token endpoint. docs: https://bit.ly/3MNgQO9
12+
contents: read
13+
strategy:
14+
matrix:
15+
version: ["3.7", "3.8", "3.9"]
16+
steps:
17+
- name: "Checkout"
18+
uses: actions/checkout@v3
19+
- name: "Use Python"
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.version }}
23+
architecture: "x64"
24+
- name: Install dependencies
25+
run: make dev
26+
- name: Configure AWS credentials
27+
uses: aws-actions/configure-aws-credentials@v1
28+
with:
29+
role-to-assume: ${{ secrets.AWS_TEST_ROLE_ARN }}
30+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
31+
- name: Test
32+
run: make e2e-test

MAINTAINERS.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
- [Triage Bug Reports](#triage-bug-reports)
1414
- [Triage RFCs](#triage-rfcs)
1515
- [Releasing a new version](#releasing-a-new-version)
16-
- [Changelog generation](#changelog-generation)
17-
- [Bumping the version](#bumping-the-version)
1816
- [Drafting release notes](#drafting-release-notes)
17+
- [Run end to end tests](#run-end-to-end-tests)
1918
- [Releasing a documentation hotfix](#releasing-a-documentation-hotfix)
2019
- [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo)
2120
- [Manage Roadmap](#manage-roadmap)
@@ -209,6 +208,14 @@ This will kick off the [Publishing workflow](https://github.com/awslabs/aws-lamb
209208

210209
> TODO: Include information to verify SAR and Lambda Layers deployment; we're still finalizing Lambda Layer automated deployment in GitHub Actions - ping @am29d when in doubt.
211210
211+
### Run end to end tests
212+
213+
In order to run end to end tests you need to install CDK CLI first and bootstrap your account with `cdk bootstrap` command. For additional details follow [documentation](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html).
214+
215+
To run locally, export `AWS_PROFILE` environment variable and run `make e2e tests`. To run from GitHub Actions, use [run-e2e-tests workflow](https://github.com/awslabs/aws-lambda-powertools-python/actions/workflows/run-e2e-tests.yml) and pick the branch you want to run tests against.
216+
217+
**NOTE**: E2E tests are run as part of each merge to `develop` branch.
218+
212219
### Releasing a documentation hotfix
213220

214221
You can rebuild the latest documentation without a full release via this [GitHub Actions Workflow](https://github.com/awslabs/aws-lambda-powertools-python/actions/workflows/rebuild_latest_docs.yml). Choose `Run workflow`, keep `develop` as the branch, and input the latest Powertools version available.

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ lint-docs-fix:
2323
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs"
2424

2525
test:
26-
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=xml
26+
poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=xml
2727
poetry run pytest --cache-clear tests/performance
2828

2929
unit-test:
3030
poetry run pytest tests/unit
3131

32+
e2e-test:
33+
poetry run pytest -rP -n 3 --dist loadscope --durations=0 --durations-min=1 tests/e2e
34+
3235
coverage-html:
33-
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=html
36+
poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=html
3437

3538
pre-commit:
3639
pre-commit run --show-diff-on-failure

layer/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ exceptiongroup==1.0.0rc8 \
4040
# via
4141
# -r requirements.txt
4242
# cattrs
43-
jsii==1.61.0 \
44-
--hash=sha256:542a72cd1a144d36fa530dc359b5295b82d9e7ecdd76d5c7b4b61195f132a746 \
45-
--hash=sha256:b2899f24bcc95ce009bc256558c81cde8cff9f830eddbe9b0d581c40558a1ff0
43+
jsii==1.62.0 \
44+
--hash=sha256:c22ac7373260fbabdb012faba717a8a4dbd933120cee373905030fd66956a65a \
45+
--hash=sha256:d124b0f350fd206e0488d3bb83dc58832f11e64fc728fd3a10096872d8a3a938
4646
# via
4747
# -r requirements.txt
4848
# aws-cdk-lib

0 commit comments

Comments
 (0)