From a2cdf65534800c4cc9bed7383165401f7e30dafe Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Wed, 26 Jul 2023 15:03:06 +0200 Subject: [PATCH 01/12] Starting maintainers doc from python --- docs/maintainers.md | 654 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 654 insertions(+) create mode 100644 docs/maintainers.md diff --git a/docs/maintainers.md b/docs/maintainers.md new file mode 100644 index 000000000..337436ad4 --- /dev/null +++ b/docs/maintainers.md @@ -0,0 +1,654 @@ +--- +title: Maintainers playbook +description: Playbook for active maintainers in Powertools for AWS Lambda (Java) +--- + + + +## Overview + +!!! note "Please treat this content as a living document." + +This is document explains who the maintainers are, their responsibilities, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CONTRIBUTING.md){target="_blank" rel="nofollow"}. + +## Current Maintainers + +| Maintainer | GitHub ID | Affiliation | +|-----------------------|-------------------------------------------------------------------------------------| ----------- | +| Mark Sailes | [heitorlessa](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | +| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank" rel="nofollow"} | Amazon | +| Michele Ricciardi | [rubenfonseca](https://github.com/mriccia){target="_blank" rel="nofollow"} | Amazon | +| Scott Gerring | [leandrodamascena](https://github.com/scottgerring){target="_blank" rel="nofollow"} | Amazon | + +## Emeritus + +Previous active maintainers who contributed to this project. + +TODO + +## Labels + +These are the most common labels used by maintainers to triage issues, pull requests (PR), and for project management: + +| Label | Usage | Notes | +| ---------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------- | +| triage | New issues that require maintainers review | Issue template | +| bug | Unexpected, reproducible and unintended software behavior | PR/Release automation; Doc snippets are excluded; | +| not-a-bug | New and existing bug reports incorrectly submitted as bug | Analytics | +| documentation | Documentation improvements | PR/Release automation; Doc additions, fixes, etc.; | +| feature-request | New or enhancements to existing features | Issue template | +| typing | New or enhancements to static typing | Issue template | +| RFC | Technical design documents related to a feature request | Issue template | +| bug-upstream | Bug caused by upstream dependency | | +| help wanted | Tasks you want help from anyone to move forward | Bandwidth, complex topics, etc. | +| need-customer-feedback | Tasks that need more feedback before proceeding | 80/20% rule, uncertain, etc. | +| need-more-information | Missing information before making any calls | | +| need-documentation | PR is missing or has incomplete documentation | | +| need-issue | PR is missing a related issue for tracking change | PR automation | +| need-rfc | Feature request requires a RFC to improve discussion | | +| pending-release | Merged changes that will be available soon | Release automation auto-closes/notifies it | +| revisit-in-3-months | Blocked issues/PRs that need to be revisited | Often related to `need-customer-feedback`, prioritization, etc. | +| breaking-change | Changes that will cause customer impact and need careful triage | | +| do-not-merge | PRs that are blocked for varying reasons | Timeline is uncertain | +| size/XS | PRs between 0-9 LOC | PR automation | +| size/S | PRs between 10-29 LOC | PR automation | +| size/M | PRs between 30-99 LOC | PR automation | +| size/L | PRs between 100-499 LOC | PR automation | +| size/XL | PRs between 500-999 LOC, often PRs that grown with feedback | PR automation | +| size/XXL | PRs with 1K+ LOC, largely documentation related | PR automation | +| tests | PRs that add or change tests | PR automation | +| `` | PRs related to a Powertools for AWS Lambda (Python) utility, e.g. `parameters`, `tracer` | PR automation | +| feature | New features or minor changes | PR/Release automation | +| dependencies | Changes that touch dependencies, e.g. Dependabot, etc. | PR/ automation | +| github-actions | Changes in GitHub workflows | PR automation | +| github-templates | Changes in GitHub issue/PR templates | PR automation | +| internal | Changes in governance and chores (linting setup, baseline, etc.) | PR automation | +| tech-debt | Changes in tech debt | | +| customer-reference | Authorization to use company name in our documentation | Public Relations | +| community-content | Suggested content to feature in our documentation | Public Relations | + +## Maintainer Responsibilities + +Maintainers are active and visible members of the community, and have [maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization){target="_blank" rel="nofollow"}. Use those privileges to serve the community and evolve code as follows. + +Be aware of recurring ambiguous situations and [document them](#common-scenarios) to help your fellow maintainers. + +### Uphold Code of Conduct + + +Model the behavior set forward by the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} and raise any violations to other maintainers and admins. There could be unusual circumstances where inappropriate behavior does not immediately fall within the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"}. + +These might be nuanced and should be handled with extra care - when in doubt, do not engage and reach out to other maintainers and admins. + +### Prioritize Security + +Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported security vulnerabilities are addressed before features or bugs. + +Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/SECURITY.md){target="_blank" rel="nofollow"} for details. + +### Review Pull Requests + +Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. Provide code reviews and guidance on incoming pull requests. + +PRs are [labeled](#labels) based on file changes and semantic title. Pay attention to whether labels reflect the current state of the PR and correct accordingly. + +Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for [CHANGELOG](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CHANGELOG.md){target="_blank" rel="nofollow"} and [Release notes](https://github.com/aws-powertools/powertools-lambda-python/releases) - make sure they communicate their intent at the human level. + +> TODO: This is an area we want to automate using the new GitHub GraphQL API. + +For issues linked to a PR, make sure `pending release` label is applied to them when merging. [Upon release](#releasing-a-new-version), these issues will be notified which release version contains their change. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage New Issues + +Manage [labels](#labels), review issues regularly, and create new labels as needed by the project. Remove `triage` label when you're able to confirm the validity of a request, a bug can be reproduced, etc. Give priority to the original author for implementation, unless it is a sensitive task that is best handled by maintainers. + +> TODO: This is an area we want to automate using the new GitHub GraphQL API. + +Make sure issues are assigned to our [board of activities](https://github.com/orgs/awslabs/projects/51/) and have the right [status](https://docs.powertools.aws.dev/lambda/python/latest/roadmap/#roadmap-status-definition). + +Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might need additional feedback from the author, other customers, experienced community members and/or maintainers. + +Be aware of [casual contributors](https://opensource.com/article/17/10/managing-casual-contributors) and recurring contributors. Provide the experience and attention you wish you had if you were starting in open source. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage Bug Reports + +Be familiar with [our definition of bug](#is-that-a-bug). If it's not a bug, you can close it or adjust its title and labels - always communicate the reason accordingly. + +For bugs caused by upstream dependencies, replace `bug` with `bug-upstream` label. Ask the author whether they'd like to raise the issue upstream or if they prefer us to do so. + +Assess the impact and make the call on whether we need an emergency release. Contact other [maintainers](#current-maintainers) when in doubt. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage RFCs + +RFC is a collaborative process to help us get to the most optimal solution given the context. Their purpose is to ensure everyone understands what this context is, their trade-offs, and alternative solutions that were part of the research before implementation begins. + +Make sure you ask these questions in mind when reviewing: + +- Does it use our [RFC template](https://github.com/aws-powertools/powertools-lambda-python/issues/new?assignees=&labels=RFC%2Ctriage&template=rfc.yml&title=RFC%3A+TITLE)? +- Does the match our [Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)? +- Does the proposal address the use case? If so, is the recommended usage explicit? +- Does it focus on the mechanics to solve the use case over fine-grained implementation details? +- Can anyone familiar with the code base implement it? +- If approved, are they interested in contributing? Do they need any guidance? +- Does this significantly increase the overall project maintenance? Do we have the skills to maintain it? +- If we can't take this use case, are there alternative projects we could recommend? Or does it call for a new project altogether? + +When necessary, be upfront that the time to review, approve, and implement a RFC can vary - see [Contribution is stuck](#contribution-is-stuck). Some RFCs may be further updated after implementation, as certain areas become clearer. + +Some examples using our initial and new RFC templates: #92, #94, #95, #991, #1226 + +### Releasing a new version + +Firstly, make sure the commit history in the `develop` branch **(1)** it's up to date, **(2)** commit messages are semantic, and **(3)** commit messages have their respective area, for example `feat(logger): `, `chore(ci): ...`). + +**Looks good, what's next?** + +Kickoff the `Release` workflow with the intended version - this might take around 25m-30m to complete. + +Once complete, you can start drafting the release notes to let customers know **what changed and what's in it for them (a.k.a why they should care)**. We have guidelines in the release notes section so you know what good looks like. + +> **NOTE**: Documentation might take a few minutes to reflect the latest version due to caching and CDN invalidations. + +#### Release process visualized + +Every release makes hundreds of checks, security scans, canaries and deployments - all of these are automated. + +This is a close visual representation of the main steps (GitHub Actions UI should be the source of truth), along with the approximate time it takes for each key step to complete. + + + +**TODO (Take Simon's work?)** + +```mermaid +gantt + +title Release process +dateFormat HH:mm +axisFormat %H:%M + +Release commit : milestone, m1, 10:00,2m + +section Seal + Bump release version : active, 8s + Prevent source tampering : active, 43s +section QA + Quality checks : active, 2.2m +section Build + Checksum : active, 8s + Build release artifact : active, 39s + Seal : active, 8s +section Provenance + Attest build : active, 8s + Sign attestation : active, attestation, 10:06, 8s + +section Release + Checksum : active, 8s + PyPi temp credentials : active, 8s + Publish PyPi : active, pypi, 10:07, 29s + +PyPi release : milestone, m2, 10:07,1s + +section Git release + Checksum : active, after pypi, 8s + Git Tag : active, 8s + Bump package version : active, 8s + Create PR : active, 8s + Upload attestation : active, 8s + +section Layer release + Build (x86+ARM) : active, layer_build, 10:08, 6m + Deploy Beta : active, layer_beta, after layer_build, 6.3m + Deploy Prod : active, layer_prod, after layer_beta, 6.3m + +Layer release : milestone, m3, 10:26,1s + +section SAR release + Deploy Beta : active, sar_beta, after layer_beta, 2.2m + Deploy Prod : active, sar_prod, after sar_beta, 2.2m + +SAR release : milestone, m4, 10:25,1s + +section Docs + Create PR (Layer ARN) : active, after layer_prod, 8s + Release versioned docs : active, 2.2m + +Documentation release : milestone, m4, 10:28,1m + +section Post-release + Close pending issues : active, 8s + +Release complete : milestone, m6, 10:31,2m +``` + +#### Drafting release notes + +Visit the [Releases page](https://github.com/aws-powertools/powertools-lambda-java/releases) and choose the edit pencil button. + +Make sure the `tag` field reflects the new version you're releasing, the target branch field is set to `develop`, and `release title` matches your tag e.g., `v1.26.0`. + +You'll notice we group all changes based on their [labels](#labels) like `feature`, `bug`, `documentation`, etc. + +**I spotted a typo or incorrect grouping - how do I fix it?** + +Edit the respective PR title and update their [labels](#labels). Then run the [Release Drafter workflow](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/release-drafter.yml) to update the Draft release. + +> **NOTE**: This won't change the CHANGELOG as the merge commit is immutable. Don't worry about it. We'd only rewrite git history only if this can lead to confusion and we'd pair with another maintainer. + +**All looking good, what's next?** + +The best part comes now. Replace the placeholder `[Human readable summary of changes]` with what you'd like to communicate to customers what this release is all about. Rule of thumb: always put yourself in the customers shoes. + +These are some questions to keep in mind when drafting your first or future release notes: + +- Can customers understand at a high level what changed in this release? +- Is there a link to the documentation where they can read more about each main change? +- Are there any graphics or [code snippets](carbon.now.sh/) that can enhance readability? +- Are we calling out any key contributor(s) to this release? + - All contributors are automatically credited, use this as an exceptional case to feature them + +Once you're happy, hit `Publish release` πŸŽ‰πŸŽ‰πŸŽ‰. + +This will kick off the [Publishing workflow](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/release.yml) and within a few minutes you should see the latest version in PyPi, and all issues labeled as `pending-release` will be closed and notified. + +### Run end to end tests +TODO + +### Releasing a documentation hotfix +TODO + +### Maintain Overall Health of the Repo + +TODO + +### Manage Roadmap + +TODO + +See [Roadmap section](https://docs.powertools.aws.dev/lambda/java/latest/roadmap/) + +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. + +### Add Continuous Integration Checks + +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. + +### Negative Impact on the Project + +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](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} violations, deliberate harmful or malicious actions, spam, monopolization, and security risks. + +### Becoming a maintainer + +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. + +We suspect this process might look similar to the [OpenSearch project](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md#becoming-a-maintainer){target="_blank" rel="nofollow"}. + +## Common scenarios + +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) + +### Contribution is stuck + +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. + +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. + +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. + +### Insufficient feedback or information + +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. + +### Crediting contributions + +We credit all contributions as part of each [release note](https://github.com/aws-powertools/powertools-lambda-python/releases){target="_blank" rel="nofollow"} as an automated process. If you find contributors are missing from the release note you're producing, please add them manually. + +### Is that a bug? + +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. + +Documentation snippets, use of internal components, or unadvertised functionalities are not considered bugs. + +### Mentoring contributions + +Always favor mentoring issue authors to contribute, unless they're not interested or the implementation is sensitive (_e.g., complexity, time to release, etc._). + +Make use of `help wanted` and `good first issue` to signal additional contributions the community can help. + +### Long running issues or PRs + +Try offering a 1:1 call in the attempt to get to a mutual understanding and clarify areas that maintainers could help. + +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. + +## E2E framework + +### Structure + +TODO + +**tests/e2e structure** + +```shell +. +β”œβ”€β”€ __init__.py +β”œβ”€β”€ conftest.py # builds Lambda Layer once +β”œβ”€β”€ logger +β”‚ β”œβ”€β”€ __init__.py +β”‚ β”œβ”€β”€ conftest.py # deploys LoggerStack +β”‚ β”œβ”€β”€ handlers +β”‚ β”‚ └── basic_handler.py +β”‚ β”œβ”€β”€ infrastructure.py # LoggerStack definition +β”‚ └── test_logger.py +β”œβ”€β”€ metrics +β”‚ β”œβ”€β”€ __init__.py +β”‚ β”œβ”€β”€ conftest.py # deploys MetricsStack +β”‚ β”œβ”€β”€ handlers +β”‚ β”‚ β”œβ”€β”€ basic_handler.py +β”‚ β”‚ └── cold_start.py +β”‚ β”œβ”€β”€ infrastructure.py # MetricsStack definition +β”‚ └── test_metrics.py +β”œβ”€β”€ tracer +β”‚ β”œβ”€β”€ __init__.py +β”‚ β”œβ”€β”€ conftest.py # deploys TracerStack +β”‚ β”œβ”€β”€ handlers +β”‚ β”‚ β”œβ”€β”€ async_capture.py +β”‚ β”‚ └── basic_handler.py +β”‚ β”œβ”€β”€ infrastructure.py # TracerStack definition +β”‚ └── test_tracer.py +└── utils + β”œβ”€β”€ __init__.py + β”œβ”€β”€ data_builder # build_service_name(), build_add_dimensions_input, etc. + β”œβ”€β”€ data_fetcher # get_traces(), get_logs(), get_lambda_response(), etc. + β”œβ”€β”€ infrastructure.py # base infrastructure like deploy logic, etc. +``` + +Where: + +- **`/infrastructure.py`**. Uses CDK to define the infrastructure a given feature needs. +- **`/handlers/`**. Lambda function handlers to build, deploy, and exposed as stack output in PascalCase (e.g., `BasicHandler`). +- **`utils/`**. Test utilities to build data and fetch AWS data to ease assertion +- **`conftest.py`**. Deploys and deletes a given feature infrastructure. Hierarchy matters: + - **Top-level (`e2e/conftest`)**. Builds Lambda Layer only once and blocks I/O across all CPU workers. + - **Feature-level (`e2e//conftest`)**. Deploys stacks in parallel and make them independent of each other. + +### Mechanics + +Under [`BaseInfrastructure`](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/tests/e2e/utils/infrastructure.py){target="_blank" rel="nofollow"}, we hide the complexity of deployment and delete coordination under `deploy`, `delete`, and `create_lambda_functions` methods. + +This allows us to benefit from test and deployment parallelization, use IDE step-through debugging for a single test, run one, subset, or all tests and only deploy their related infrastructure, without any custom configuration. + +> Class diagram to understand abstraction built when defining a new stack (`LoggerStack`) + +```mermaid +classDiagram + class InfrastructureProvider { + <> + +deploy() Dict + +delete() + +create_resources() + +create_lambda_functions() Dict~Functions~ + } + + class BaseInfrastructure { + +deploy() Dict + +delete() + +create_lambda_functions() Dict~Functions~ + +add_cfn_output() + } + + class TracerStack { + +create_resources() + } + + class LoggerStack { + +create_resources() + } + + class MetricsStack { + +create_resources() + } + + class EventHandlerStack { + +create_resources() + } + + InfrastructureProvider <|-- BaseInfrastructure : implement + BaseInfrastructure <|-- TracerStack : inherit + BaseInfrastructure <|-- LoggerStack : inherit + BaseInfrastructure <|-- MetricsStack : inherit + BaseInfrastructure <|-- EventHandlerStack : inherit +``` + +### Authoring a new feature E2E test + +Imagine you're going to create E2E for Event Handler feature for the first time. Keep the following mental model when reading: + +```mermaid +graph LR + A["1. Define infrastructure"]-->B["2. Deploy/Delete infrastructure"]-->C["3.Access Stack outputs" ] +``` + +#### 1. Define infrastructure + +We use CDK as our Infrastructure as Code tool of choice. Before you start using CDK, you'd take the following steps: + +1. Create `tests/e2e/event_handler/infrastructure.py` file +2. Create a new class `EventHandlerStack` and inherit from `BaseInfrastructure` +3. Override `create_resources` method and define your infrastructure using CDK +4. (Optional) Create a Lambda function under `handlers/alb_handler.py` + +> Excerpt `tests/e2e/event_handler/infrastructure.py` + +```python +class EventHandlerStack(BaseInfrastructure): + def create_resources(self): + functions = self.create_lambda_functions() + + self._create_alb(function=functions["AlbHandler"]) + ... + + def _create_alb(self, function: Function): + vpc = ec2.Vpc.from_lookup( + self.stack, + "VPC", + is_default=True, + region=self.region, + ) + + alb = elbv2.ApplicationLoadBalancer(self.stack, "ALB", vpc=vpc, internet_facing=True) + CfnOutput(self.stack, "ALBDnsName", value=alb.load_balancer_dns_name) + ... +``` + +> Excerpt `tests/e2e/event_handler/handlers/alb_handler.py` + +```python +from aws_lambda_powertools.event_handler import ALBResolver, Response, content_types + +app = ALBResolver() + + +@app.get("/todos") +def hello(): + return Response( + status_code=200, + content_type=content_types.TEXT_PLAIN, + body="Hello world", + cookies=["CookieMonster", "MonsterCookie"], + headers={"Foo": ["bar", "zbr"]}, + ) + + +def lambda_handler(event, context): + return app.resolve(event, context) +``` + +#### 2. Deploy/Delete infrastructure when tests run + +We need to create a Pytest fixture for our new feature under `tests/e2e/event_handler/conftest.py`. + +This will instruct Pytest to deploy our infrastructure when our tests start, and delete it when they complete whether tests are successful or not. Note that this file will not need any modification in the future. + +> Excerpt `conftest.py` for Event Handler + +```python +import pytest + +from tests.e2e.event_handler.infrastructure import EventHandlerStack + + +@pytest.fixture(autouse=True, scope="module") +def infrastructure(): + """Setup and teardown logic for E2E test infrastructure + + Yields + ------ + Dict[str, str] + CloudFormation Outputs from deployed infrastructure + """ + stack = EventHandlerStack() + try: + yield stack.deploy() + finally: + stack.delete() + +``` + +#### 3. Access stack outputs for E2E tests + +Within our tests, we should now have access to the `infrastructure` fixture we defined earlier in `tests/e2e/event_handler/conftest.py`. + +We can access any Stack Output using pytest dependency injection. + +> Excerpt `tests/e2e/event_handler/test_header_serializer.py` + +```python +@pytest.fixture +def alb_basic_listener_endpoint(infrastructure: dict) -> str: + dns_name = infrastructure.get("ALBDnsName") + port = infrastructure.get("ALBBasicListenerPort", "") + return f"http://{dns_name}:{port}" + + +def test_alb_headers_serializer(alb_basic_listener_endpoint): + # GIVEN + url = f"{alb_basic_listener_endpoint}/todos" + ... +``` + +### Internals + +#### Test runner parallelization + +Besides speed, we parallelize our end-to-end tests to ease asserting async side-effects may take a while per test too, _e.g., traces to become available_. + +The following diagram demonstrates the process we take every time you use `make e2e` locally or at CI: + +```mermaid +graph TD + A[make e2e test] -->Spawn{"Split and group tests
by feature and CPU"} + + Spawn -->|Worker0| Worker0_Start["Load tests"] + Spawn -->|Worker1| Worker1_Start["Load tests"] + Spawn -->|WorkerN| WorkerN_Start["Load tests"] + + Worker0_Start -->|Wait| LambdaLayer["Lambda Layer build"] + Worker1_Start -->|Wait| LambdaLayer["Lambda Layer build"] + WorkerN_Start -->|Wait| LambdaLayer["Lambda Layer build"] + + LambdaLayer -->|Worker0| Worker0_Deploy["Launch feature stack"] + LambdaLayer -->|Worker1| Worker1_Deploy["Launch feature stack"] + LambdaLayer -->|WorkerN| WorkerN_Deploy["Launch feature stack"] + + Worker0_Deploy -->|Worker0| Worker0_Tests["Run tests"] + Worker1_Deploy -->|Worker1| Worker1_Tests["Run tests"] + WorkerN_Deploy -->|WorkerN| WorkerN_Tests["Run tests"] + + Worker0_Tests --> ResultCollection + Worker1_Tests --> ResultCollection + WorkerN_Tests --> ResultCollection + + ResultCollection{"Wait for workers
Collect test results"} + ResultCollection --> TestEnd["Report results"] + ResultCollection --> DeployEnd["Delete Stacks"] +``` + +#### CDK CLI parallelization + +For CDK CLI to work with [independent CDK Apps](https://docs.aws.amazon.com/cdk/v2/guide/apps.html){target="_blank" rel="nofollow"}, we specify an output directory when synthesizing our stack and deploy from said output directory. + +```mermaid +flowchart TD + subgraph "Deploying distinct CDK Apps" + EventHandlerInfra["Event Handler CDK App"] --> EventHandlerSynth + TracerInfra["Tracer CDK App"] --> TracerSynth + EventHandlerSynth["cdk synth --out cdk.out/event_handler"] --> EventHandlerDeploy["cdk deploy --app cdk.out/event_handler"] + + TracerSynth["cdk synth --out cdk.out/tracer"] --> TracerDeploy["cdk deploy --app cdk.out/tracer"] + end +``` + +We create the typical CDK `app.py` at runtime when tests run, since we know which feature and Python version we're dealing with (locally or at CI). + +> Excerpt `cdk_app_V39.py` for Event Handler created at deploy phase + +```python +from tests.e2e.event_handler.infrastructure import EventHandlerStack +stack = EventHandlerStack() +stack.create_resources() +stack.app.synth() +``` + +When we run E2E tests for a single feature or all of them, our `cdk.out` looks like this: + +```shell +total 8 +drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 event-handler +drwxr-xr-x 3 lessa staff 96B Sep 6 15:08 layer_build +-rw-r--r-- 1 lessa staff 32B Sep 6 15:08 layer_build.diff +drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 logger +drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 metrics +drwxr-xr-x 22 lessa staff 704B Sep 9 10:52 tracer +``` + +```mermaid +classDiagram + class CdkOutDirectory { + feature_name/ + layer_build/ + layer_build.diff + } + + class EventHandler { + manifest.json + stack_outputs.json + cdk_app_V39.py + asset.uuid/ + ... + } + + class StackOutputsJson { + BasicHandlerArn: str + ALBDnsName: str + ... + } + + CdkOutDirectory <|-- EventHandler : feature_name/ + StackOutputsJson <|-- EventHandler +``` + +Where: + +- **``**. Contains CDK Assets, CDK `manifest.json`, our `cdk_app_.py` and `stack_outputs.json` +- **`layer_build`**. Contains our Lambda Layer source code built once, used by all stacks independently +- **`layer_build.diff`**. Contains a hash on whether our source code has changed to speed up further deployments and E2E tests + +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){target="_blank" rel="nofollow"} (`from_lookup`), and use step-through debugging for a single E2E test without any extra configuration. + +> NOTE: VSCode doesn't support debugging processes spawning sub-processes (like CDK CLI does w/ shell and CDK App). Maybe [this works](https://stackoverflow.com/a/65339352){target="_blank" rel="nofollow"}. PyCharm works just fine. From 86587328951ce179d07837e4fe134bf2de240561 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Fri, 28 Jul 2023 15:02:56 +0200 Subject: [PATCH 02/12] Initial maintainers guide --- docs/maintainers.md | 654 ---------------------------------- docs/processes/maintainers.md | 246 +++++++++++++ mkdocs.yml | 2 + 3 files changed, 248 insertions(+), 654 deletions(-) delete mode 100644 docs/maintainers.md create mode 100644 docs/processes/maintainers.md diff --git a/docs/maintainers.md b/docs/maintainers.md deleted file mode 100644 index 337436ad4..000000000 --- a/docs/maintainers.md +++ /dev/null @@ -1,654 +0,0 @@ ---- -title: Maintainers playbook -description: Playbook for active maintainers in Powertools for AWS Lambda (Java) ---- - - - -## Overview - -!!! note "Please treat this content as a living document." - -This is document explains who the maintainers are, their responsibilities, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CONTRIBUTING.md){target="_blank" rel="nofollow"}. - -## Current Maintainers - -| Maintainer | GitHub ID | Affiliation | -|-----------------------|-------------------------------------------------------------------------------------| ----------- | -| Mark Sailes | [heitorlessa](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | -| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank" rel="nofollow"} | Amazon | -| Michele Ricciardi | [rubenfonseca](https://github.com/mriccia){target="_blank" rel="nofollow"} | Amazon | -| Scott Gerring | [leandrodamascena](https://github.com/scottgerring){target="_blank" rel="nofollow"} | Amazon | - -## Emeritus - -Previous active maintainers who contributed to this project. - -TODO - -## Labels - -These are the most common labels used by maintainers to triage issues, pull requests (PR), and for project management: - -| Label | Usage | Notes | -| ---------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------- | -| triage | New issues that require maintainers review | Issue template | -| bug | Unexpected, reproducible and unintended software behavior | PR/Release automation; Doc snippets are excluded; | -| not-a-bug | New and existing bug reports incorrectly submitted as bug | Analytics | -| documentation | Documentation improvements | PR/Release automation; Doc additions, fixes, etc.; | -| feature-request | New or enhancements to existing features | Issue template | -| typing | New or enhancements to static typing | Issue template | -| RFC | Technical design documents related to a feature request | Issue template | -| bug-upstream | Bug caused by upstream dependency | | -| help wanted | Tasks you want help from anyone to move forward | Bandwidth, complex topics, etc. | -| need-customer-feedback | Tasks that need more feedback before proceeding | 80/20% rule, uncertain, etc. | -| need-more-information | Missing information before making any calls | | -| need-documentation | PR is missing or has incomplete documentation | | -| need-issue | PR is missing a related issue for tracking change | PR automation | -| need-rfc | Feature request requires a RFC to improve discussion | | -| pending-release | Merged changes that will be available soon | Release automation auto-closes/notifies it | -| revisit-in-3-months | Blocked issues/PRs that need to be revisited | Often related to `need-customer-feedback`, prioritization, etc. | -| breaking-change | Changes that will cause customer impact and need careful triage | | -| do-not-merge | PRs that are blocked for varying reasons | Timeline is uncertain | -| size/XS | PRs between 0-9 LOC | PR automation | -| size/S | PRs between 10-29 LOC | PR automation | -| size/M | PRs between 30-99 LOC | PR automation | -| size/L | PRs between 100-499 LOC | PR automation | -| size/XL | PRs between 500-999 LOC, often PRs that grown with feedback | PR automation | -| size/XXL | PRs with 1K+ LOC, largely documentation related | PR automation | -| tests | PRs that add or change tests | PR automation | -| `` | PRs related to a Powertools for AWS Lambda (Python) utility, e.g. `parameters`, `tracer` | PR automation | -| feature | New features or minor changes | PR/Release automation | -| dependencies | Changes that touch dependencies, e.g. Dependabot, etc. | PR/ automation | -| github-actions | Changes in GitHub workflows | PR automation | -| github-templates | Changes in GitHub issue/PR templates | PR automation | -| internal | Changes in governance and chores (linting setup, baseline, etc.) | PR automation | -| tech-debt | Changes in tech debt | | -| customer-reference | Authorization to use company name in our documentation | Public Relations | -| community-content | Suggested content to feature in our documentation | Public Relations | - -## Maintainer Responsibilities - -Maintainers are active and visible members of the community, and have [maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization){target="_blank" rel="nofollow"}. Use those privileges to serve the community and evolve code as follows. - -Be aware of recurring ambiguous situations and [document them](#common-scenarios) to help your fellow maintainers. - -### Uphold Code of Conduct - - -Model the behavior set forward by the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} and raise any violations to other maintainers and admins. There could be unusual circumstances where inappropriate behavior does not immediately fall within the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"}. - -These might be nuanced and should be handled with extra care - when in doubt, do not engage and reach out to other maintainers and admins. - -### Prioritize Security - -Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported security vulnerabilities are addressed before features or bugs. - -Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/SECURITY.md){target="_blank" rel="nofollow"} for details. - -### Review Pull Requests - -Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. Provide code reviews and guidance on incoming pull requests. - -PRs are [labeled](#labels) based on file changes and semantic title. Pay attention to whether labels reflect the current state of the PR and correct accordingly. - -Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for [CHANGELOG](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CHANGELOG.md){target="_blank" rel="nofollow"} and [Release notes](https://github.com/aws-powertools/powertools-lambda-python/releases) - make sure they communicate their intent at the human level. - -> TODO: This is an area we want to automate using the new GitHub GraphQL API. - -For issues linked to a PR, make sure `pending release` label is applied to them when merging. [Upon release](#releasing-a-new-version), these issues will be notified which release version contains their change. - -See [Common scenarios](#common-scenarios) section for additional guidance. - -### Triage New Issues - -Manage [labels](#labels), review issues regularly, and create new labels as needed by the project. Remove `triage` label when you're able to confirm the validity of a request, a bug can be reproduced, etc. Give priority to the original author for implementation, unless it is a sensitive task that is best handled by maintainers. - -> TODO: This is an area we want to automate using the new GitHub GraphQL API. - -Make sure issues are assigned to our [board of activities](https://github.com/orgs/awslabs/projects/51/) and have the right [status](https://docs.powertools.aws.dev/lambda/python/latest/roadmap/#roadmap-status-definition). - -Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might need additional feedback from the author, other customers, experienced community members and/or maintainers. - -Be aware of [casual contributors](https://opensource.com/article/17/10/managing-casual-contributors) and recurring contributors. Provide the experience and attention you wish you had if you were starting in open source. - -See [Common scenarios](#common-scenarios) section for additional guidance. - -### Triage Bug Reports - -Be familiar with [our definition of bug](#is-that-a-bug). If it's not a bug, you can close it or adjust its title and labels - always communicate the reason accordingly. - -For bugs caused by upstream dependencies, replace `bug` with `bug-upstream` label. Ask the author whether they'd like to raise the issue upstream or if they prefer us to do so. - -Assess the impact and make the call on whether we need an emergency release. Contact other [maintainers](#current-maintainers) when in doubt. - -See [Common scenarios](#common-scenarios) section for additional guidance. - -### Triage RFCs - -RFC is a collaborative process to help us get to the most optimal solution given the context. Their purpose is to ensure everyone understands what this context is, their trade-offs, and alternative solutions that were part of the research before implementation begins. - -Make sure you ask these questions in mind when reviewing: - -- Does it use our [RFC template](https://github.com/aws-powertools/powertools-lambda-python/issues/new?assignees=&labels=RFC%2Ctriage&template=rfc.yml&title=RFC%3A+TITLE)? -- Does the match our [Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)? -- Does the proposal address the use case? If so, is the recommended usage explicit? -- Does it focus on the mechanics to solve the use case over fine-grained implementation details? -- Can anyone familiar with the code base implement it? -- If approved, are they interested in contributing? Do they need any guidance? -- Does this significantly increase the overall project maintenance? Do we have the skills to maintain it? -- If we can't take this use case, are there alternative projects we could recommend? Or does it call for a new project altogether? - -When necessary, be upfront that the time to review, approve, and implement a RFC can vary - see [Contribution is stuck](#contribution-is-stuck). Some RFCs may be further updated after implementation, as certain areas become clearer. - -Some examples using our initial and new RFC templates: #92, #94, #95, #991, #1226 - -### Releasing a new version - -Firstly, make sure the commit history in the `develop` branch **(1)** it's up to date, **(2)** commit messages are semantic, and **(3)** commit messages have their respective area, for example `feat(logger): `, `chore(ci): ...`). - -**Looks good, what's next?** - -Kickoff the `Release` workflow with the intended version - this might take around 25m-30m to complete. - -Once complete, you can start drafting the release notes to let customers know **what changed and what's in it for them (a.k.a why they should care)**. We have guidelines in the release notes section so you know what good looks like. - -> **NOTE**: Documentation might take a few minutes to reflect the latest version due to caching and CDN invalidations. - -#### Release process visualized - -Every release makes hundreds of checks, security scans, canaries and deployments - all of these are automated. - -This is a close visual representation of the main steps (GitHub Actions UI should be the source of truth), along with the approximate time it takes for each key step to complete. - - - -**TODO (Take Simon's work?)** - -```mermaid -gantt - -title Release process -dateFormat HH:mm -axisFormat %H:%M - -Release commit : milestone, m1, 10:00,2m - -section Seal - Bump release version : active, 8s - Prevent source tampering : active, 43s -section QA - Quality checks : active, 2.2m -section Build - Checksum : active, 8s - Build release artifact : active, 39s - Seal : active, 8s -section Provenance - Attest build : active, 8s - Sign attestation : active, attestation, 10:06, 8s - -section Release - Checksum : active, 8s - PyPi temp credentials : active, 8s - Publish PyPi : active, pypi, 10:07, 29s - -PyPi release : milestone, m2, 10:07,1s - -section Git release - Checksum : active, after pypi, 8s - Git Tag : active, 8s - Bump package version : active, 8s - Create PR : active, 8s - Upload attestation : active, 8s - -section Layer release - Build (x86+ARM) : active, layer_build, 10:08, 6m - Deploy Beta : active, layer_beta, after layer_build, 6.3m - Deploy Prod : active, layer_prod, after layer_beta, 6.3m - -Layer release : milestone, m3, 10:26,1s - -section SAR release - Deploy Beta : active, sar_beta, after layer_beta, 2.2m - Deploy Prod : active, sar_prod, after sar_beta, 2.2m - -SAR release : milestone, m4, 10:25,1s - -section Docs - Create PR (Layer ARN) : active, after layer_prod, 8s - Release versioned docs : active, 2.2m - -Documentation release : milestone, m4, 10:28,1m - -section Post-release - Close pending issues : active, 8s - -Release complete : milestone, m6, 10:31,2m -``` - -#### Drafting release notes - -Visit the [Releases page](https://github.com/aws-powertools/powertools-lambda-java/releases) and choose the edit pencil button. - -Make sure the `tag` field reflects the new version you're releasing, the target branch field is set to `develop`, and `release title` matches your tag e.g., `v1.26.0`. - -You'll notice we group all changes based on their [labels](#labels) like `feature`, `bug`, `documentation`, etc. - -**I spotted a typo or incorrect grouping - how do I fix it?** - -Edit the respective PR title and update their [labels](#labels). Then run the [Release Drafter workflow](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/release-drafter.yml) to update the Draft release. - -> **NOTE**: This won't change the CHANGELOG as the merge commit is immutable. Don't worry about it. We'd only rewrite git history only if this can lead to confusion and we'd pair with another maintainer. - -**All looking good, what's next?** - -The best part comes now. Replace the placeholder `[Human readable summary of changes]` with what you'd like to communicate to customers what this release is all about. Rule of thumb: always put yourself in the customers shoes. - -These are some questions to keep in mind when drafting your first or future release notes: - -- Can customers understand at a high level what changed in this release? -- Is there a link to the documentation where they can read more about each main change? -- Are there any graphics or [code snippets](carbon.now.sh/) that can enhance readability? -- Are we calling out any key contributor(s) to this release? - - All contributors are automatically credited, use this as an exceptional case to feature them - -Once you're happy, hit `Publish release` πŸŽ‰πŸŽ‰πŸŽ‰. - -This will kick off the [Publishing workflow](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/release.yml) and within a few minutes you should see the latest version in PyPi, and all issues labeled as `pending-release` will be closed and notified. - -### Run end to end tests -TODO - -### Releasing a documentation hotfix -TODO - -### Maintain Overall Health of the Repo - -TODO - -### Manage Roadmap - -TODO - -See [Roadmap section](https://docs.powertools.aws.dev/lambda/java/latest/roadmap/) - -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. - -### Add Continuous Integration Checks - -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. - -### Negative Impact on the Project - -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](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} violations, deliberate harmful or malicious actions, spam, monopolization, and security risks. - -### Becoming a maintainer - -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. - -We suspect this process might look similar to the [OpenSearch project](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md#becoming-a-maintainer){target="_blank" rel="nofollow"}. - -## Common scenarios - -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) - -### Contribution is stuck - -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. - -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. - -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. - -### Insufficient feedback or information - -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. - -### Crediting contributions - -We credit all contributions as part of each [release note](https://github.com/aws-powertools/powertools-lambda-python/releases){target="_blank" rel="nofollow"} as an automated process. If you find contributors are missing from the release note you're producing, please add them manually. - -### Is that a bug? - -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. - -Documentation snippets, use of internal components, or unadvertised functionalities are not considered bugs. - -### Mentoring contributions - -Always favor mentoring issue authors to contribute, unless they're not interested or the implementation is sensitive (_e.g., complexity, time to release, etc._). - -Make use of `help wanted` and `good first issue` to signal additional contributions the community can help. - -### Long running issues or PRs - -Try offering a 1:1 call in the attempt to get to a mutual understanding and clarify areas that maintainers could help. - -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. - -## E2E framework - -### Structure - -TODO - -**tests/e2e structure** - -```shell -. -β”œβ”€β”€ __init__.py -β”œβ”€β”€ conftest.py # builds Lambda Layer once -β”œβ”€β”€ logger -β”‚ β”œβ”€β”€ __init__.py -β”‚ β”œβ”€β”€ conftest.py # deploys LoggerStack -β”‚ β”œβ”€β”€ handlers -β”‚ β”‚ └── basic_handler.py -β”‚ β”œβ”€β”€ infrastructure.py # LoggerStack definition -β”‚ └── test_logger.py -β”œβ”€β”€ metrics -β”‚ β”œβ”€β”€ __init__.py -β”‚ β”œβ”€β”€ conftest.py # deploys MetricsStack -β”‚ β”œβ”€β”€ handlers -β”‚ β”‚ β”œβ”€β”€ basic_handler.py -β”‚ β”‚ └── cold_start.py -β”‚ β”œβ”€β”€ infrastructure.py # MetricsStack definition -β”‚ └── test_metrics.py -β”œβ”€β”€ tracer -β”‚ β”œβ”€β”€ __init__.py -β”‚ β”œβ”€β”€ conftest.py # deploys TracerStack -β”‚ β”œβ”€β”€ handlers -β”‚ β”‚ β”œβ”€β”€ async_capture.py -β”‚ β”‚ └── basic_handler.py -β”‚ β”œβ”€β”€ infrastructure.py # TracerStack definition -β”‚ └── test_tracer.py -└── utils - β”œβ”€β”€ __init__.py - β”œβ”€β”€ data_builder # build_service_name(), build_add_dimensions_input, etc. - β”œβ”€β”€ data_fetcher # get_traces(), get_logs(), get_lambda_response(), etc. - β”œβ”€β”€ infrastructure.py # base infrastructure like deploy logic, etc. -``` - -Where: - -- **`/infrastructure.py`**. Uses CDK to define the infrastructure a given feature needs. -- **`/handlers/`**. Lambda function handlers to build, deploy, and exposed as stack output in PascalCase (e.g., `BasicHandler`). -- **`utils/`**. Test utilities to build data and fetch AWS data to ease assertion -- **`conftest.py`**. Deploys and deletes a given feature infrastructure. Hierarchy matters: - - **Top-level (`e2e/conftest`)**. Builds Lambda Layer only once and blocks I/O across all CPU workers. - - **Feature-level (`e2e//conftest`)**. Deploys stacks in parallel and make them independent of each other. - -### Mechanics - -Under [`BaseInfrastructure`](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/tests/e2e/utils/infrastructure.py){target="_blank" rel="nofollow"}, we hide the complexity of deployment and delete coordination under `deploy`, `delete`, and `create_lambda_functions` methods. - -This allows us to benefit from test and deployment parallelization, use IDE step-through debugging for a single test, run one, subset, or all tests and only deploy their related infrastructure, without any custom configuration. - -> Class diagram to understand abstraction built when defining a new stack (`LoggerStack`) - -```mermaid -classDiagram - class InfrastructureProvider { - <> - +deploy() Dict - +delete() - +create_resources() - +create_lambda_functions() Dict~Functions~ - } - - class BaseInfrastructure { - +deploy() Dict - +delete() - +create_lambda_functions() Dict~Functions~ - +add_cfn_output() - } - - class TracerStack { - +create_resources() - } - - class LoggerStack { - +create_resources() - } - - class MetricsStack { - +create_resources() - } - - class EventHandlerStack { - +create_resources() - } - - InfrastructureProvider <|-- BaseInfrastructure : implement - BaseInfrastructure <|-- TracerStack : inherit - BaseInfrastructure <|-- LoggerStack : inherit - BaseInfrastructure <|-- MetricsStack : inherit - BaseInfrastructure <|-- EventHandlerStack : inherit -``` - -### Authoring a new feature E2E test - -Imagine you're going to create E2E for Event Handler feature for the first time. Keep the following mental model when reading: - -```mermaid -graph LR - A["1. Define infrastructure"]-->B["2. Deploy/Delete infrastructure"]-->C["3.Access Stack outputs" ] -``` - -#### 1. Define infrastructure - -We use CDK as our Infrastructure as Code tool of choice. Before you start using CDK, you'd take the following steps: - -1. Create `tests/e2e/event_handler/infrastructure.py` file -2. Create a new class `EventHandlerStack` and inherit from `BaseInfrastructure` -3. Override `create_resources` method and define your infrastructure using CDK -4. (Optional) Create a Lambda function under `handlers/alb_handler.py` - -> Excerpt `tests/e2e/event_handler/infrastructure.py` - -```python -class EventHandlerStack(BaseInfrastructure): - def create_resources(self): - functions = self.create_lambda_functions() - - self._create_alb(function=functions["AlbHandler"]) - ... - - def _create_alb(self, function: Function): - vpc = ec2.Vpc.from_lookup( - self.stack, - "VPC", - is_default=True, - region=self.region, - ) - - alb = elbv2.ApplicationLoadBalancer(self.stack, "ALB", vpc=vpc, internet_facing=True) - CfnOutput(self.stack, "ALBDnsName", value=alb.load_balancer_dns_name) - ... -``` - -> Excerpt `tests/e2e/event_handler/handlers/alb_handler.py` - -```python -from aws_lambda_powertools.event_handler import ALBResolver, Response, content_types - -app = ALBResolver() - - -@app.get("/todos") -def hello(): - return Response( - status_code=200, - content_type=content_types.TEXT_PLAIN, - body="Hello world", - cookies=["CookieMonster", "MonsterCookie"], - headers={"Foo": ["bar", "zbr"]}, - ) - - -def lambda_handler(event, context): - return app.resolve(event, context) -``` - -#### 2. Deploy/Delete infrastructure when tests run - -We need to create a Pytest fixture for our new feature under `tests/e2e/event_handler/conftest.py`. - -This will instruct Pytest to deploy our infrastructure when our tests start, and delete it when they complete whether tests are successful or not. Note that this file will not need any modification in the future. - -> Excerpt `conftest.py` for Event Handler - -```python -import pytest - -from tests.e2e.event_handler.infrastructure import EventHandlerStack - - -@pytest.fixture(autouse=True, scope="module") -def infrastructure(): - """Setup and teardown logic for E2E test infrastructure - - Yields - ------ - Dict[str, str] - CloudFormation Outputs from deployed infrastructure - """ - stack = EventHandlerStack() - try: - yield stack.deploy() - finally: - stack.delete() - -``` - -#### 3. Access stack outputs for E2E tests - -Within our tests, we should now have access to the `infrastructure` fixture we defined earlier in `tests/e2e/event_handler/conftest.py`. - -We can access any Stack Output using pytest dependency injection. - -> Excerpt `tests/e2e/event_handler/test_header_serializer.py` - -```python -@pytest.fixture -def alb_basic_listener_endpoint(infrastructure: dict) -> str: - dns_name = infrastructure.get("ALBDnsName") - port = infrastructure.get("ALBBasicListenerPort", "") - return f"http://{dns_name}:{port}" - - -def test_alb_headers_serializer(alb_basic_listener_endpoint): - # GIVEN - url = f"{alb_basic_listener_endpoint}/todos" - ... -``` - -### Internals - -#### Test runner parallelization - -Besides speed, we parallelize our end-to-end tests to ease asserting async side-effects may take a while per test too, _e.g., traces to become available_. - -The following diagram demonstrates the process we take every time you use `make e2e` locally or at CI: - -```mermaid -graph TD - A[make e2e test] -->Spawn{"Split and group tests
by feature and CPU"} - - Spawn -->|Worker0| Worker0_Start["Load tests"] - Spawn -->|Worker1| Worker1_Start["Load tests"] - Spawn -->|WorkerN| WorkerN_Start["Load tests"] - - Worker0_Start -->|Wait| LambdaLayer["Lambda Layer build"] - Worker1_Start -->|Wait| LambdaLayer["Lambda Layer build"] - WorkerN_Start -->|Wait| LambdaLayer["Lambda Layer build"] - - LambdaLayer -->|Worker0| Worker0_Deploy["Launch feature stack"] - LambdaLayer -->|Worker1| Worker1_Deploy["Launch feature stack"] - LambdaLayer -->|WorkerN| WorkerN_Deploy["Launch feature stack"] - - Worker0_Deploy -->|Worker0| Worker0_Tests["Run tests"] - Worker1_Deploy -->|Worker1| Worker1_Tests["Run tests"] - WorkerN_Deploy -->|WorkerN| WorkerN_Tests["Run tests"] - - Worker0_Tests --> ResultCollection - Worker1_Tests --> ResultCollection - WorkerN_Tests --> ResultCollection - - ResultCollection{"Wait for workers
Collect test results"} - ResultCollection --> TestEnd["Report results"] - ResultCollection --> DeployEnd["Delete Stacks"] -``` - -#### CDK CLI parallelization - -For CDK CLI to work with [independent CDK Apps](https://docs.aws.amazon.com/cdk/v2/guide/apps.html){target="_blank" rel="nofollow"}, we specify an output directory when synthesizing our stack and deploy from said output directory. - -```mermaid -flowchart TD - subgraph "Deploying distinct CDK Apps" - EventHandlerInfra["Event Handler CDK App"] --> EventHandlerSynth - TracerInfra["Tracer CDK App"] --> TracerSynth - EventHandlerSynth["cdk synth --out cdk.out/event_handler"] --> EventHandlerDeploy["cdk deploy --app cdk.out/event_handler"] - - TracerSynth["cdk synth --out cdk.out/tracer"] --> TracerDeploy["cdk deploy --app cdk.out/tracer"] - end -``` - -We create the typical CDK `app.py` at runtime when tests run, since we know which feature and Python version we're dealing with (locally or at CI). - -> Excerpt `cdk_app_V39.py` for Event Handler created at deploy phase - -```python -from tests.e2e.event_handler.infrastructure import EventHandlerStack -stack = EventHandlerStack() -stack.create_resources() -stack.app.synth() -``` - -When we run E2E tests for a single feature or all of them, our `cdk.out` looks like this: - -```shell -total 8 -drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 event-handler -drwxr-xr-x 3 lessa staff 96B Sep 6 15:08 layer_build --rw-r--r-- 1 lessa staff 32B Sep 6 15:08 layer_build.diff -drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 logger -drwxr-xr-x 18 lessa staff 576B Sep 6 15:38 metrics -drwxr-xr-x 22 lessa staff 704B Sep 9 10:52 tracer -``` - -```mermaid -classDiagram - class CdkOutDirectory { - feature_name/ - layer_build/ - layer_build.diff - } - - class EventHandler { - manifest.json - stack_outputs.json - cdk_app_V39.py - asset.uuid/ - ... - } - - class StackOutputsJson { - BasicHandlerArn: str - ALBDnsName: str - ... - } - - CdkOutDirectory <|-- EventHandler : feature_name/ - StackOutputsJson <|-- EventHandler -``` - -Where: - -- **``**. Contains CDK Assets, CDK `manifest.json`, our `cdk_app_.py` and `stack_outputs.json` -- **`layer_build`**. Contains our Lambda Layer source code built once, used by all stacks independently -- **`layer_build.diff`**. Contains a hash on whether our source code has changed to speed up further deployments and E2E tests - -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){target="_blank" rel="nofollow"} (`from_lookup`), and use step-through debugging for a single E2E test without any extra configuration. - -> NOTE: VSCode doesn't support debugging processes spawning sub-processes (like CDK CLI does w/ shell and CDK App). Maybe [this works](https://stackoverflow.com/a/65339352){target="_blank" rel="nofollow"}. PyCharm works just fine. diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md new file mode 100644 index 000000000..18d42a693 --- /dev/null +++ b/docs/processes/maintainers.md @@ -0,0 +1,246 @@ +--- +title: Maintainers +description: Process +--- + + + +## Overview + +!!! note "Please treat this content as a living document." + +This is document explains who the maintainers are, their responsibilities, and how they should be doing it. If you're interested in contributing, + see [CONTRIBUTING](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CONTRIBUTING.md){target="_blank" rel="nofollow"}. + +## Current Maintainers + +| Maintainer | GitHub ID | Affiliation | +|-----------------------|---------------------------------------------------------------------------------| ----------- | +| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank" rel="nofollow"} | Amazon | +| Michele Ricciardi | [mriccia](https://github.com/mriccia){target="_blank" rel="nofollow"} | Amazon | +| Scott Gerring | [scottgerring](https://github.com/scottgerring){target="_blank" rel="nofollow"} | Amazon | + +## Emeritus + +Previous active maintainers who contributed to this project. + +| Maintainer | GitHub ID | Affiliation | +|----------------|-----------------------------------------------------------------------------------------|---------------| +| Mark Sailes | [heitorlessa](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | +| Pankaj Agrawal | [ pankajagrawal16 ](https://github.com/pankajagrawal16){target="_blank" rel="nofollow"} | Former Amazon | +| Steve Houel | [stevehouel](https://github.com/stevehouel) | Amazon | + +## Labels + +These are the most common labels used by maintainers to triage issues, pull requests (PR), and for project management: + +| Label | Usage | Notes | +|----------------------------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------| +| triage | New issues that require maintainers review | Issue template | +| bug | Unexpected, reproducible and unintended software behavior | PR/Release automation; Doc snippets are excluded; | +| documentation | Documentation improvements | PR/Release automation; Doc additions, fixes, etc.; | +| duplicate | Dupe of another issue | | +| enhancement | New or enhancements to existing features | Issue template | +| RFC | Technical design documents related to a feature request | Issue template | +| help wanted | Tasks you want help from anyone to move forward | Bandwidth, complex topics, etc. | +| feature-parity | Adding features present in other Powertools for Lambda libraries | | +| good first issue | Somewhere for new contributors to start | | +| governance | Issues related to project governance - contributor guides, automation, etc. | | +| question | Issues that are raised to ask questions | | +| maven | Related to the build system | | +| need-more-information | Missing information before making any calls | | +| status/staged-next-release | Changes are merged and will be available once the next release is made. | | +| status/staged-next-major-release | Contains breaking changes - merged changes will be available once the next major release is made. | | +| blocked | Issues or PRs that are blocked for varying reasons | Timeline is uncertain | +| priority:1 | Critical - needs urgent attention | | +| priority:2 | High - core feature, or affects 60%+ of users | | +| priority:3 | Neutral - not a core feature, or affects < 40% of users | | +| priority:4 | Low - nice to have | | +| priority:5 | Low - idea for later | | +| invalid | This doesn't seem right | | +| size/XS | PRs between 0-9 LOC | PR automation | +| size/S | PRs between 10-29 LOC | PR automation | +| size/M | PRs between 30-99 LOC | PR automation | +| size/L | PRs between 100-499 LOC | PR automation | +| size/XL | PRs between 500-999 LOC, often PRs that grown with feedback | PR automation | +| size/XXL | PRs with 1K+ LOC, largely documentation related | PR automation | +| dependencies | Changes that touch dependencies, e.g. Dependabot, etc. | PR/ automation | +| maintenance | Address outstanding tech debt | | + +## Maintainer Responsibilities + +Maintainers are active and visible members of the community, and have +[maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization){target="_blank" rel="nofollow"}. +Use those privileges to serve the community and evolve code as follows. + +Be aware of recurring ambiguous situations and [document them](#common-scenarios) to help your fellow maintainers. + +### Uphold Code of Conduct + + +Model the behavior set forward by the +[Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} +and raise any violations to other maintainers and admins. There could be unusual circumstances where inappropriate +behavior does not immediately fall within the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"}. + +These might be nuanced and should be handled with extra care - when in doubt, do not engage and reach out to other maintainers +and admins. + +### Prioritize Security + +Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported +security vulnerabilities are addressed before features or bugs. + +Note that this repository is monitored and supported 24/7 by Amazon Security, see +[Security disclosures](https://github.com/aws-powertools/powertools-lambda-java/){target="_blank" rel="nofollow"} for details. + +### Review Pull Requests + +Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. +Provide code reviews and guidance on incoming pull requests. + +PRs are [labeled](#labels) based on file changes and semantic title. Pay attention to whether labels reflect the current +state of the PR and correct accordingly. + +Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for +[CHANGELOG](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CHANGELOG.md){target="_blank" rel="nofollow"} +and [Release notes](https://github.com/aws-powertools/powertools-lambda-java/releases) - make sure they communicate their +intent at the human level. + +For issues linked to a PR, make sure `status/staged-next-release` label is applied to them when merging. +[Upon release](#releasing-a-new-version), these issues will be notified which release version contains their change. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage New Issues + +Manage [labels](#labels), review issues regularly, and create new labels as needed by the project. Remove `triage` +label when you're able to confirm the validity of a request, a bug can be reproduced, etc. +Give priority to the original author for implementation, unless it is a sensitive task that is best handled by maintainers. + +Make sure issues are assigned to our [board of activities](https://github.com/orgs/aws-powertools/projects/4). + +Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might +need additional feedback from the author, other customers, experienced community members and/or maintainers. + +Be aware of [casual contributors](https://opensource.com/article/17/10/managing-casual-contributors) and recurring contributors. +Provide the experience and attention you wish you had if you were starting in open source. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage Bug Reports + +Be familiar with [our definition of bug](#is-that-a-bug). If it's not a bug, you can close it or adjust its title and +labels - always communicate the reason accordingly. + +For bugs caused by upstream dependencies, replace `bug` with `bug-upstream` label. Ask the author whether they'd like to +raise the issue upstream or if they prefer us to do so. + +Assess the impact and make the call on whether we need an emergency release. Contact other [maintainers](#current-maintainers) when in doubt. + +See [Common scenarios](#common-scenarios) section for additional guidance. + +### Triage RFCs + +RFC is a collaborative process to help us get to the most optimal solution given the context. Their purpose is to ensure +everyone understands what this context is, their trade-offs, and alternative solutions that were part of the research +before implementation begins. + +Make sure you ask these questions in mind when reviewing: + +- Does it use our [RFC template](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=RFC%2C+triage&projects=&template=rfc.md&title=RFC%3A+)? +- Does the match our [Tenets](https://docs.powertools.aws.dev/lambda/java/latest/#tenets)? +- Does the proposal address the use case? If so, is the recommended usage explicit? +- Does it focus on the mechanics to solve the use case over fine-grained implementation details? +- Can anyone familiar with the code base implement it? +- If approved, are they interested in contributing? Do they need any guidance? +- Does this significantly increase the overall project maintenance? Do we have the skills to maintain it? +- If we can't take this use case, are there alternative projects we could recommend? Or does it call for a new project altogether? + +When necessary, be upfront that the time to review, approve, and implement a RFC can vary - +see [Contribution is stuck](#contribution-is-stuck). Some RFCs may be further updated after implementation, as certain areas become clearer. + +Some examples using our initial and new RFC templates: #92, #94, #95, #991, #1226 + +### Releasing a new version + +!!! note "The release process is currently a long, multi-step process. The team is in the process of automating at it." + +Firstly, make sure the commit history in the `main` branch **(1)** it's up to date, **(2)** commit messages are semantic, +and **(3)** commit messages have their respective area, for example `feat: `, `chore: ...`). + +**Looks good, what's next?** + +Kickoff the `Prepare for maven central release` workflow with the intended rekease version. Once this has completed, it will +draft a Pull Request named something like `chore: Prep release 1.19.0`. the PR will **(1)** roll all of the POM versions +forward to the new release version and **(2)** release notes. + +Once this is done, check out the branch and clean up the release notes. These will be used both in the release notes +file and the [published github release information](https://github.com/aws-powertools/powertools-lambda-java/releases), +and you can use the existing release notes to see how changes are summarized. + +Next, commit and push, wait for the build to complete, and merge to main. Once main has built successfully, create a +tagged release from the Github UI, using the same release notes. + +Next, run the `Publish package to the Maven Central Repository` action to release the library. + +Finally, by hand, create a PR rolling all of the POMs onto the next snapshot version. + + +### Add Continuous Integration Checks + +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. + +### Negative Impact on the Project + +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](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} +violations, deliberate harmful or malicious actions, spam, monopolization, and security risks. + +## Common scenarios + +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) + +### Contribution is stuck + +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. + +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. + +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. + +### Insufficient feedback or information + +When in doubt, use the `need-more-information` label to signal more context and feedback are necessary before proceeding. + +### Crediting contributions + +We credit all contributions as part of each [release note](https://github.com/aws-powertools/powertools-lambda-java/releases){target="_blank" rel="nofollow"} +as an automated process. If you find contributors are missing from the release note you're producing, please add them manually. + +### Is that a bug? + +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. + +Documentation snippets, use of internal components, or unadvertised functionalities are not considered bugs. + +### Mentoring contributions + +Always favor mentoring issue authors to contribute, unless they're not interested or the implementation is sensitive (_e.g., complexity, time to release, etc._). + +Make use of `help wanted` and `good first issue` to signal additional contributions the community can help. + +### Long running issues or PRs + +Try offering a 1:1 call in the attempt to get to a mutual understanding and clarify areas that maintainers could help. + +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. diff --git a/mkdocs.yml b/mkdocs.yml index 05f02c5ca..48275ddcd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,8 @@ nav: - utilities/validation.md - utilities/custom_resources.md - utilities/serialization.md + - Processes: + - processes/maintainers.md theme: name: material From 5a205e3b2eea7a3f822f7fab148a6e6e0dfc135e Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Fri, 28 Jul 2023 15:16:18 +0200 Subject: [PATCH 03/12] Change title --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 18d42a693..7246a6dfc 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -1,5 +1,5 @@ --- -title: Maintainers +title: Maintainers playbook description: Process --- From 2273a987dd3a64cbdb53710986c60589495b5778 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Fri, 28 Jul 2023 15:27:41 +0200 Subject: [PATCH 04/12] Less Heitor more mark --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 7246a6dfc..f3900222e 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -26,7 +26,7 @@ Previous active maintainers who contributed to this project. | Maintainer | GitHub ID | Affiliation | |----------------|-----------------------------------------------------------------------------------------|---------------| -| Mark Sailes | [heitorlessa](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | +| Mark Sailes | [msailes](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | | Pankaj Agrawal | [ pankajagrawal16 ](https://github.com/pankajagrawal16){target="_blank" rel="nofollow"} | Former Amazon | | Steve Houel | [stevehouel](https://github.com/stevehouel) | Amazon | From 90e4ddc5361b910a59793d95a1e1ff592418dac5 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Fri, 28 Jul 2023 16:35:10 +0200 Subject: [PATCH 05/12] No nofollow --- docs/processes/maintainers.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index f3900222e..5b59ca909 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -10,15 +10,15 @@ description: Process !!! note "Please treat this content as a living document." This is document explains who the maintainers are, their responsibilities, and how they should be doing it. If you're interested in contributing, - see [CONTRIBUTING](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CONTRIBUTING.md){target="_blank" rel="nofollow"}. + see [CONTRIBUTING](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CONTRIBUTING.md){target="_blank"}. ## Current Maintainers | Maintainer | GitHub ID | Affiliation | |-----------------------|---------------------------------------------------------------------------------| ----------- | -| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank" rel="nofollow"} | Amazon | -| Michele Ricciardi | [mriccia](https://github.com/mriccia){target="_blank" rel="nofollow"} | Amazon | -| Scott Gerring | [scottgerring](https://github.com/scottgerring){target="_blank" rel="nofollow"} | Amazon | +| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank"} | Amazon | +| Michele Ricciardi | [mriccia](https://github.com/mriccia){target="_blank"} | Amazon | +| Scott Gerring | [scottgerring](https://github.com/scottgerring){target="_blank"} | Amazon | ## Emeritus @@ -26,8 +26,8 @@ Previous active maintainers who contributed to this project. | Maintainer | GitHub ID | Affiliation | |----------------|-----------------------------------------------------------------------------------------|---------------| -| Mark Sailes | [msailes](https://github.com/msailes){target="_blank" rel="nofollow"} | Amazon | -| Pankaj Agrawal | [ pankajagrawal16 ](https://github.com/pankajagrawal16){target="_blank" rel="nofollow"} | Former Amazon | +| Mark Sailes | [msailes](https://github.com/msailes){target="_blank"} | Amazon | +| Pankaj Agrawal | [ pankajagrawal16 ](https://github.com/pankajagrawal16){target="_blank"} | Former Amazon | | Steve Houel | [stevehouel](https://github.com/stevehouel) | Amazon | ## Labels @@ -70,7 +70,7 @@ These are the most common labels used by maintainers to triage issues, pull requ ## Maintainer Responsibilities Maintainers are active and visible members of the community, and have -[maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization){target="_blank" rel="nofollow"}. +[maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization){target="_blank"}. Use those privileges to serve the community and evolve code as follows. Be aware of recurring ambiguous situations and [document them](#common-scenarios) to help your fellow maintainers. @@ -79,9 +79,9 @@ Be aware of recurring ambiguous situations and [document them](#common-scenarios Model the behavior set forward by the -[Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} +[Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank"} and raise any violations to other maintainers and admins. There could be unusual circumstances where inappropriate -behavior does not immediately fall within the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"}. +behavior does not immediately fall within the [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank"}. These might be nuanced and should be handled with extra care - when in doubt, do not engage and reach out to other maintainers and admins. @@ -92,7 +92,7 @@ Security is your number one priority. Maintainer's Github keys must be password security vulnerabilities are addressed before features or bugs. Note that this repository is monitored and supported 24/7 by Amazon Security, see -[Security disclosures](https://github.com/aws-powertools/powertools-lambda-java/){target="_blank" rel="nofollow"} for details. +[Security disclosures](https://github.com/aws-powertools/powertools-lambda-java/){target="_blank"} for details. ### Review Pull Requests @@ -103,7 +103,7 @@ PRs are [labeled](#labels) based on file changes and semantic title. Pay attenti state of the PR and correct accordingly. Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for -[CHANGELOG](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CHANGELOG.md){target="_blank" rel="nofollow"} +[CHANGELOG](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CHANGELOG.md){target="_blank"} and [Release notes](https://github.com/aws-powertools/powertools-lambda-java/releases) - make sure they communicate their intent at the human level. @@ -196,7 +196,7 @@ Continuously revisit areas of improvement to reduce operational burden in all pa 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](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank" rel="nofollow"} +[Code of Conduct](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CODE_OF_CONDUCT.md){target="_blank"} violations, deliberate harmful or malicious actions, spam, monopolization, and security risks. ## Common scenarios @@ -223,7 +223,7 @@ When in doubt, use the `need-more-information` label to signal more context and ### Crediting contributions -We credit all contributions as part of each [release note](https://github.com/aws-powertools/powertools-lambda-java/releases){target="_blank" rel="nofollow"} +We credit all contributions as part of each [release note](https://github.com/aws-powertools/powertools-lambda-java/releases){target="_blank"} as an automated process. If you find contributors are missing from the release note you're producing, please add them manually. ### Is that a bug? From 354659239d6746d817c2f9a9f6b3f567ec937db2 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Fri, 28 Jul 2023 16:39:25 +0200 Subject: [PATCH 06/12] Actually nofollow some followS --- docs/processes/maintainers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 5b59ca909..93cf36109 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -102,7 +102,7 @@ Provide code reviews and guidance on incoming pull requests. PRs are [labeled](#labels) based on file changes and semantic title. Pay attention to whether labels reflect the current state of the PR and correct accordingly. -Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for +Use and enforce [semantic versioning](https://semver.org/){target="_blank" rel="nofollow"} pull request titles, as these will be used for [CHANGELOG](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CHANGELOG.md){target="_blank"} and [Release notes](https://github.com/aws-powertools/powertools-lambda-java/releases) - make sure they communicate their intent at the human level. @@ -123,7 +123,7 @@ Make sure issues are assigned to our [board of activities](https://github.com/or Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might need additional feedback from the author, other customers, experienced community members and/or maintainers. -Be aware of [casual contributors](https://opensource.com/article/17/10/managing-casual-contributors) and recurring contributors. +Be aware of [casual contributors](https://opensource.com/article/17/10/managing-casual-contributors){target="_blank" rel="nofollow"} and recurring contributors. Provide the experience and attention you wish you had if you were starting in open source. See [Common scenarios](#common-scenarios) section for additional guidance. From 402f4723a358865336bd63e0416d55e5ad8918a9 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Mon, 31 Jul 2023 10:02:00 +0200 Subject: [PATCH 07/12] Update docs/processes/maintainers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JΓ©rΓ΄me Van Der Linden <117538+jeromevdl@users.noreply.github.com> --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 93cf36109..e1710e7f6 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -27,7 +27,7 @@ Previous active maintainers who contributed to this project. | Maintainer | GitHub ID | Affiliation | |----------------|-----------------------------------------------------------------------------------------|---------------| | Mark Sailes | [msailes](https://github.com/msailes){target="_blank"} | Amazon | -| Pankaj Agrawal | [ pankajagrawal16 ](https://github.com/pankajagrawal16){target="_blank"} | Former Amazon | +| Pankaj Agrawal | [pankajagrawal16](https://github.com/pankajagrawal16){target="_blank"} | Former Amazon | | Steve Houel | [stevehouel](https://github.com/stevehouel) | Amazon | ## Labels From 1fd79830d5043c715a5b8e7f017920a5bcca33fa Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Mon, 31 Jul 2023 10:34:42 +0200 Subject: [PATCH 08/12] Update docs/processes/maintainers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JΓ©rΓ΄me Van Der Linden <117538+jeromevdl@users.noreply.github.com> --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index e1710e7f6..4e5c81583 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -149,7 +149,7 @@ before implementation begins. Make sure you ask these questions in mind when reviewing: - Does it use our [RFC template](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=RFC%2C+triage&projects=&template=rfc.md&title=RFC%3A+)? -- Does the match our [Tenets](https://docs.powertools.aws.dev/lambda/java/latest/#tenets)? +- Does it match our [Tenets](https://docs.powertools.aws.dev/lambda/java/latest/#tenets)? - Does the proposal address the use case? If so, is the recommended usage explicit? - Does it focus on the mechanics to solve the use case over fine-grained implementation details? - Can anyone familiar with the code base implement it? From 54a12fc784bdc173fdd54e373d529a6922ea8172 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Mon, 31 Jul 2023 10:34:59 +0200 Subject: [PATCH 09/12] Update docs/processes/maintainers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JΓ©rΓ΄me Van Der Linden <117538+jeromevdl@users.noreply.github.com> --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 4e5c81583..1b36147d3 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -179,7 +179,7 @@ Once this is done, check out the branch and clean up the release notes. These wi file and the [published github release information](https://github.com/aws-powertools/powertools-lambda-java/releases), and you can use the existing release notes to see how changes are summarized. -Next, commit and push, wait for the build to complete, and merge to main. Once main has built successfully, create a +Next, commit and push, wait for the build to complete, and merge to main. Once main has built successfully (i.e. build, tests and end-to-end tests should pass), create a tagged release from the Github UI, using the same release notes. Next, run the `Publish package to the Maven Central Repository` action to release the library. From 8dd5480bb0c3e783c10c4b698ba6df3e7aae8765 Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Mon, 31 Jul 2023 11:04:21 +0200 Subject: [PATCH 10/12] Add reference to changelog --- docs/processes/maintainers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index e1710e7f6..f3901870c 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -175,7 +175,8 @@ Kickoff the `Prepare for maven central release` workflow with the intended rekea draft a Pull Request named something like `chore: Prep release 1.19.0`. the PR will **(1)** roll all of the POM versions forward to the new release version and **(2)** release notes. -Once this is done, check out the branch and clean up the release notes. These will be used both in the release notes +Once this is done, check out the branch and clean up the release notes. These will be used both in the +[CHANGELOG.md file](https://github.com/aws-powertools/powertools-lambda-java/blob/main/CHANGELOG.md) file and the [published github release information](https://github.com/aws-powertools/powertools-lambda-java/releases), and you can use the existing release notes to see how changes are summarized. From 9027e979c1133401695c19349e1bebf39b3cbc8a Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Mon, 31 Jul 2023 11:05:05 +0200 Subject: [PATCH 11/12] Update docs/processes/maintainers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JΓ©rΓ΄me Van Der Linden <117538+jeromevdl@users.noreply.github.com> --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index e18fe4673..006dbbc41 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -185,7 +185,7 @@ tagged release from the Github UI, using the same release notes. Next, run the `Publish package to the Maven Central Repository` action to release the library. -Finally, by hand, create a PR rolling all of the POMs onto the next snapshot version. +Finally, by hand, create a PR rolling all of the POMs onto the next snapshot version (e.g. `1.20.0-SNAPSHOT`). ### Add Continuous Integration Checks From 866a6a61d6f6e3e75b0ae53dc11b4578165f0d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Van=20Der=20Linden?= <117538+jeromevdl@users.noreply.github.com> Date: Mon, 31 Jul 2023 11:21:19 +0200 Subject: [PATCH 12/12] change jeromevdl link --- docs/processes/maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/processes/maintainers.md b/docs/processes/maintainers.md index 006dbbc41..6b3d9e126 100644 --- a/docs/processes/maintainers.md +++ b/docs/processes/maintainers.md @@ -16,7 +16,7 @@ This is document explains who the maintainers are, their responsibilities, and h | Maintainer | GitHub ID | Affiliation | |-----------------------|---------------------------------------------------------------------------------| ----------- | -| Jerome Van Der Linden | [sthulb](https://github.com/jeromevdl){target="_blank"} | Amazon | +| Jerome Van Der Linden | [jeromevdl](https://github.com/jeromevdl){target="_blank"} | Amazon | | Michele Ricciardi | [mriccia](https://github.com/mriccia){target="_blank"} | Amazon | | Scott Gerring | [scottgerring](https://github.com/scottgerring){target="_blank"} | Amazon |