Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ddf4a80

Browse files
heitorlessarubenfonseca
authored andcommittedSep 20, 2022
docs(maintainers): explain CDK CLI parallelization; reorder TOC
1 parent 6976e28 commit ddf4a80

File tree

1 file changed

+109
-75
lines changed

1 file changed

+109
-75
lines changed
 

‎MAINTAINERS.md

Lines changed: 109 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
- [Releasing a new version](#releasing-a-new-version)
1616
- [Drafting release notes](#drafting-release-notes)
1717
- [Run end to end tests](#run-end-to-end-tests)
18-
- [Structure](#structure)
19-
- [Mechanics](#mechanics)
20-
- [Authoring an E2E test](#authoring-an-e2e-test)
21-
- [Internals](#internals)
22-
- [Parallelization](#parallelization)
23-
- [CDK safe parallelization](#cdk-safe-parallelization)
2418
- [Releasing a documentation hotfix](#releasing-a-documentation-hotfix)
2519
- [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo)
2620
- [Manage Roadmap](#manage-roadmap)
@@ -34,6 +28,13 @@
3428
- [Is that a bug?](#is-that-a-bug)
3529
- [Mentoring contributions](#mentoring-contributions)
3630
- [Long running issues or PRs](#long-running-issues-or-prs)
31+
- [E2E framework](#e2e-framework)
32+
- [Structure](#structure)
33+
- [Mechanics](#mechanics)
34+
- [Authoring an E2E test](#authoring-an-e2e-test)
35+
- [Internals](#internals)
36+
- [Test runner parallelization](#test-runner-parallelization)
37+
- [CDK CLI parallelization](#cdk-cli-parallelization)
3738

3839
## Overview
3940

@@ -222,7 +223,79 @@ E2E tests are run on every push to `develop` or manually via [run-e2e-tests work
222223

223224
To run locally, you need [AWS CDK CLI](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites) and an [account bootstrapped](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html) (`cdk bootstrap`). With a default AWS CLI profile configured, or `AWS_PROFILE` environment variable set, run `make e2e tests`.
224225

225-
#### Structure
226+
### Releasing a documentation hotfix
227+
228+
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.
229+
230+
This workflow will update both user guide and API documentation.
231+
232+
### Maintain Overall Health of the Repo
233+
234+
> TODO: Coordinate renaming `develop` to `main`
235+
236+
Keep the `develop` branch at production quality at all times. Backport features as needed. Cut release branches and tags to enable future patches.
237+
238+
### Manage Roadmap
239+
240+
See [Roadmap section](https://awslabs.github.io/aws-lambda-powertools-python/latest/roadmap/)
241+
242+
Ensure the repo highlights features that should be elevated to the project roadmap. Be clear about the feature’s status, priority, target version, and whether or not it should be elevated to the roadmap.
243+
244+
### Add Continuous Integration Checks
245+
246+
Add integration checks that validate pull requests and pushes to ease the burden on Pull Request reviewers. Continuously revisit areas of improvement to reduce operational burden in all parties involved.
247+
248+
### Negative Impact on the Project
249+
250+
Actions that negatively impact the project will be handled by the admins, in coordination with other maintainers, in balance with the urgency of the issue. Examples would be [Code of Conduct](CODE_OF_CONDUCT.md) violations, deliberate harmful or malicious actions, spam, monopolization, and security risks.
251+
252+
### Becoming a maintainer
253+
254+
In 2023, we will revisit this. We need to improve our understanding of how other projects are doing, their mechanisms to promote key contributors, and how they interact daily.
255+
256+
We suspect this process might look similar to the [OpenSearch project](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md#becoming-a-maintainer).
257+
258+
## Common scenarios
259+
260+
These are recurring ambiguous situations that new and existing maintainers may encounter. They serve as guidance. It is up to each maintainer to follow, adjust, or handle in a different manner as long as [our conduct is consistent](#uphold-code-of-conduct)
261+
262+
### Contribution is stuck
263+
264+
A contribution can get stuck often due to lack of bandwidth and language barrier. For bandwidth issues, check whether the author needs help. Make sure you get their permission before pushing code into their existing PR - do not create a new PR unless strictly necessary.
265+
266+
For language barrier and others, offer a 1:1 chat to get them unblocked. Often times, English might not be their primary language, and writing in public might put them off, or come across not the way they intended to be.
267+
268+
In other cases, you may have constrained capacity. Use `help wanted` label when you want to signal other maintainers and external contributors that you could use a hand to move it forward.
269+
270+
### Insufficient feedback or information
271+
272+
When in doubt, use `need-more-information` or `need-customer-feedback` labels to signal more context and feedback are necessary before proceeding. You can also use `revisit-in-3-months` label when you expect it might take a while to gather enough information before you can decide.
273+
274+
### Crediting contributions
275+
276+
We credit all contributions as part of each [release note](https://github.com/awslabs/aws-lambda-powertools-python/releases) as an automated process. If you find contributors are missing from the release note you're producing, please add them manually.
277+
278+
### Is that a bug?
279+
280+
A bug produces incorrect or unexpected results at runtime that differ from its intended behavior. Bugs must be reproducible. They directly affect customers experience at runtime despite following its recommended usage.
281+
282+
Documentation snippets, use of internal components, or unadvertised functionalities are not considered bugs.
283+
284+
### Mentoring contributions
285+
286+
Always favor mentoring issue authors to contribute, unless they're not interested or the implementation is sensitive (_e.g., complexity, time to release, etc._).
287+
288+
Make use of `help wanted` and `good first issue` to signal additional contributions the community can help.
289+
290+
### Long running issues or PRs
291+
292+
Try offering a 1:1 call in the attempt to get to a mutual understanding and clarify areas that maintainers could help.
293+
294+
In the rare cases where both parties don't have the bandwidth or expertise to continue, it's best to use the `revisit-in-3-months` label. By then, see if it's possible to break the PR or issue in smaller chunks, and eventually close if there is no progress.
295+
296+
## E2E framework
297+
298+
### Structure
226299

227300
Our E2E framework relies on pytest fixtures to coordinate infrastructure and test parallelization (see [Parallelization](#Parallelization)).
228301

@@ -270,7 +343,7 @@ You probably notice we have multiple `conftest.py`, `infrastructure.py`, and `ha
270343
- Feature-level `e2e/<feature>/conftest` deploys stacks in parallel and make them independent of each other.
271344
- **`handlers/`**. Lambda function handlers that will be automatically deployed and exported as PascalCase for later use.
272345

273-
#### Mechanics
346+
### Mechanics
274347

275348
Under `BaseInfrastructure`, we hide the complexity of handling CDK parallel deployments, exposing CloudFormation Outputs, building Lambda Layer with the latest available code, and creating Lambda functions found in `handlers`.
276349

@@ -318,7 +391,7 @@ classDiagram
318391
BaseInfrastructure <|-- EventHandlerStack : inherit
319392
```
320393

321-
#### Authoring an E2E test
394+
### Authoring an E2E test
322395

323396
Imagine you're going to create E2E for Event Handler feature for the first time.
324397

@@ -430,9 +503,9 @@ def test_alb_headers_serializer(alb_basic_listener_endpoint):
430503
...
431504
```
432505

433-
#### Internals
506+
### Internals
434507

435-
##### Parallelization
508+
#### Test runner parallelization
436509

437510
We parallelize our end-to-end tests to benefit from speed and isolate Lambda functions to ease assessing side effects (e.g., traces, logs, etc.). The following diagram demonstrates the process we take every time you use `make e2e`:
438511

@@ -465,76 +538,37 @@ graph TD
465538
ResultCollection --> DeployEnd["Delete Stacks"]
466539
```
467540

468-
##### CDK safe parallelization
469-
470-
Describe CDK App, Stack, synth, etc.
471-
472-
### Releasing a documentation hotfix
473-
474-
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.
475-
476-
This workflow will update both user guide and API documentation.
477-
478-
### Maintain Overall Health of the Repo
541+
#### CDK CLI parallelization
479542

480-
> TODO: Coordinate renaming `develop` to `main`
543+
For CDK CLI to work with [independent CDK Apps](https://docs.aws.amazon.com/cdk/v2/guide/apps.html), we specify an output directory when running `cdk synth -o cdk.out/<feature>` and then deploy from that said output directory with `cdk deploy --app cdk.out/<feature>`.
481544

482-
Keep the `develop` branch at production quality at all times. Backport features as needed. Cut release branches and tags to enable future patches.
545+
We also create a typical CDK `app.py` at runtime with the information we know for a given feature when tests run on a per Python version basis.
483546

484-
### Manage Roadmap
485-
486-
See [Roadmap section](https://awslabs.github.io/aws-lambda-powertools-python/latest/roadmap/)
487-
488-
Ensure the repo highlights features that should be elevated to the project roadmap. Be clear about the feature’s status, priority, target version, and whether or not it should be elevated to the roadmap.
547+
> Excerpt `cdk_app_V39.py` for Event Handler created at deploy phase
489548
490-
### Add Continuous Integration Checks
491-
492-
Add integration checks that validate pull requests and pushes to ease the burden on Pull Request reviewers. Continuously revisit areas of improvement to reduce operational burden in all parties involved.
493-
494-
### Negative Impact on the Project
495-
496-
Actions that negatively impact the project will be handled by the admins, in coordination with other maintainers, in balance with the urgency of the issue. Examples would be [Code of Conduct](CODE_OF_CONDUCT.md) violations, deliberate harmful or malicious actions, spam, monopolization, and security risks.
497-
498-
### Becoming a maintainer
499-
500-
In 2023, we will revisit this. We need to improve our understanding of how other projects are doing, their mechanisms to promote key contributors, and how they interact daily.
501-
502-
We suspect this process might look similar to the [OpenSearch project](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md#becoming-a-maintainer).
503-
504-
## Common scenarios
505-
506-
These are recurring ambiguous situations that new and existing maintainers may encounter. They serve as guidance. It is up to each maintainer to follow, adjust, or handle in a different manner as long as [our conduct is consistent](#uphold-code-of-conduct)
507-
508-
### Contribution is stuck
509-
510-
A contribution can get stuck often due to lack of bandwidth and language barrier. For bandwidth issues, check whether the author needs help. Make sure you get their permission before pushing code into their existing PR - do not create a new PR unless strictly necessary.
511-
512-
For language barrier and others, offer a 1:1 chat to get them unblocked. Often times, English might not be their primary language, and writing in public might put them off, or come across not the way they intended to be.
513-
514-
In other cases, you may have constrained capacity. Use `help wanted` label when you want to signal other maintainers and external contributors that you could use a hand to move it forward.
515-
516-
### Insufficient feedback or information
517-
518-
When in doubt, use `need-more-information` or `need-customer-feedback` labels to signal more context and feedback are necessary before proceeding. You can also use `revisit-in-3-months` label when you expect it might take a while to gather enough information before you can decide.
519-
520-
### Crediting contributions
521-
522-
We credit all contributions as part of each [release note](https://github.com/awslabs/aws-lambda-powertools-python/releases) as an automated process. If you find contributors are missing from the release note you're producing, please add them manually.
523-
524-
### Is that a bug?
525-
526-
A bug produces incorrect or unexpected results at runtime that differ from its intended behavior. Bugs must be reproducible. They directly affect customers experience at runtime despite following its recommended usage.
527-
528-
Documentation snippets, use of internal components, or unadvertised functionalities are not considered bugs.
529-
530-
### Mentoring contributions
549+
```python
550+
from tests.e2e.event_handler.infrastructure import EventHandlerStack
551+
stack = EventHandlerStack()
552+
stack.create_resources()
553+
stack.app.synth()
554+
```
531555

532-
Always favor mentoring issue authors to contribute, unless they're not interested or the implementation is sensitive (_e.g., complexity, time to release, etc._).
556+
When E2E tests are run for a single feature or all of them, `cdk.out` looks like the following:
533557

534-
Make use of `help wanted` and `good first issue` to signal additional contributions the community can help.
558+
```shell
559+
total 8
560+
drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 event-handler
561+
drwxr-xr-x 3 lessa staff 96B Sep 6 15:08 layer_build
562+
-rw-r--r-- 1 lessa staff 32B Sep 6 15:08 layer_build.diff
563+
drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 logger
564+
drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 metrics
565+
drwxr-xr-x 22 lessa staff 704B Sep 9 10:52 tracer
566+
```
535567

536-
### Long running issues or PRs
568+
Where:
537569

538-
Try offering a 1:1 call in the attempt to get to a mutual understanding and clarify areas that maintainers could help.
570+
- `<feature>` has CDK Assets, CDK `manifest.json`, our `cdk_app_<PyVersion>.py` and `stack_outputs.json`
571+
- `layer_build` contains our Lambda Layer source code built once, used by all stacks independently
572+
- `layer_build.diff` contains a hash on whether our source code has changed to speed up further deployments and E2E tests
539573

540-
In the rare cases where both parties don't have the bandwidth or expertise to continue, it's best to use the `revisit-in-3-months` label. By then, see if it's possible to break the PR or issue in smaller chunks, and eventually close if there is no progress.
574+
Together, all of this allows us to use Pytest like we would for any project, use CDK CLI and its [context methods](https://docs.aws.amazon.com/cdk/v2/guide/context.html#context_methods) (`from_lookup`), and use step-through debugging for a single E2E test without any extra configuration.

0 commit comments

Comments
 (0)
Please sign in to comment.