Skip to content

Commit

Permalink
Merge branch 'v2' into chore/v2-split-idempotency-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
eldimi committed Dec 19, 2023
2 parents 0396be8 + fb14bcf commit 1a47aef
Show file tree
Hide file tree
Showing 252 changed files with 10,039 additions and 4,708 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_artifacts_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
distribution: 'corretto'
java-version: 11
- name: Build with Maven
run: mvn clean package --file pom.xml -DskipTests artifact:buildinfo
run: mvn clean package --file pom.xml -DskipTests artifact:buildinfo -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples'
- name: Get artifacts size & build report
id: artifacts-size-report
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
java: [8, 11, 17, 21, 15, 16, 18, 19, 20]
java: [8, 11, 17, 21]
name: Java ${{ matrix.java }}
env:
JAVA: ${{ matrix.java }}
Expand All @@ -66,13 +66,17 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build with Maven
if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory
run: mvn -B install --file pom.xml -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples'
- name: Build with Maven
if: ${{ matrix.java != '8' }} # If not 8 don't exclude the examples directory
run: mvn -B install --file pom.xml
- name: Build Gradle Example - Java
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
if: ${{ matrix.java != '8' }}
working-directory: examples/powertools-examples-core-utilities/gradle
run: ./gradlew build
- name: Build Gradle Example - Kotlin
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
if: ${{ matrix.java != '8' }}
working-directory: examples/powertools-examples-core-utilities/kotlin
run: ./gradlew build
- name: Setup Terraform
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
e2e:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
max-parallel: 4
matrix:
java: [ 8, 11, 17 ]
java: [ 8, 11, 17, 21 ]
name: End-to-end tests java${{ matrix.java }}
env:
JAVA_VERSION: ${{ matrix.java }}
AWS_DEFAULT_REGION: eu-west-1
JAVA_VERSION: ${{ matrix.java }}
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
Expand All @@ -56,5 +56,12 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Build with Maven Java 8
if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory
run: mvn -DskipTests install --file pom.xml -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples'
- name: Build with Maven
if: ${{ matrix.java != '8' }} # If not 8 don't exclude the examples directory
run: mvn -DskipTests install --file pom.xml
- name: Run e2e test with Maven
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
run: mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
2 changes: 1 addition & 1 deletion .github/workflows/spotbugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'corretto'
java-version: 8
java-version: 11
# https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/6
# https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
# Avoid complexity of git action with publishing report. Just build with spotbugs profile.
Expand Down
2 changes: 2 additions & 0 deletions .mvn/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is here purely so that we can get the root directory using maven.multiModuleProjectDirectory

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) fo

## [Unreleased]

## [1.18.0] - 2023-11-16

### Added

* feat: add support for [Lambda Advanced Logging Controls (ALC)](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html#monitoring-cloudwatchlogs-advanced) (#1514) by @jeromevdl
* feat: Add support for POWERTOOLS_LOGGER_LOG_EVENT (#1510) by @AlexeySoshin

### Maintenance

* fix: json schema 403 error (#1457) by @jeromevdl
* fix: array jmespath fail in idempotency module (#1420) by @jeromevdl
* chore: java21 support in our build (#1488) by @jeromevdl
* chore: Addition of Warn Message If Invalid Annotation Key While Tracing #1511 (#1512) by @jdoherty
* fix: null namespace should fallback to default namespace (#1506) by @jeromevdl
* fix: get trace id from system property when env var is not set (#1503) by @mriccia
* chore: artifacts size on good branches (#1493) by @jeromevdl
* fix: enforce jackson databind version (#1472) by @jeromevdl
* chore: add missing projects and improve workflow (#1487) by @jeromevdl
* chore: Reporting size of the jars in GitHub comments (#1196) by @jeromevdl
* Deps: Bump third party dependencies to the latest versions.

### Documentation

* docs(customer-reference): add Vertex Pharmaceuticals as a customer reference (#1486) by @scottgerring
* docs: Adding Kotlin example. (#1454) by @jasoniharris
* docs: Terraform example (#1478) by @skal111
* docs: Add Serveless Framework example (#1363) by @AlexeySoshin
* docs: Fix link to SQS large message migration guide (#1422) by @scottgerring
* docs(logging): correct log example keys (#1411) by @walmsles
* docs: Update gradle configuration readme (#1359) by @scottgerring

## [1.17.0] - 2023-08-21

### Added
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ We strongly recommend installing the CheckStyle-IDEA plugin and apply the provid
2. After installing the plugin, open the preferences (`⌘,` on macOS, or `Ctrl+Alt+S` on Windows/Linux) and search for _Code Style_. Click on the gear icon near the scheme and import checkstyle configuration. Click on "Apply" and "OK".
![](docs/media/intellij_checkstyle_1.png)

3. Select the code you've created (module, package, class) and reformat code: `⌘⌥L` (macOS), or `Ctrl+Alt+L` (Windows/Linux):
![](docs/media/intellij_checkstyle_2.png)
3. Select the code you've created (module, package, class) and reformat code: `⌘⌥L` (macOS), or `Ctrl+Alt+L` (Windows/Linux).

4. Apply the reformat, optimize imports, rearrange and cleanup to your code and only to java files:
![](docs/media/intellij_checkstyle_3.png)
Expand Down
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ Powertools for AWS Lambda (Java) is a developer toolkit to implement Serverless
**[📜Documentation](https://docs.powertools.aws.dev/lambda-java/)** | **[Feature request](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title=)** | **[🐛Bug Report](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=bug%2C+triage&template=bug_report.md&title=)** | **[Detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-aws-lambda-powertools-java/)**

### Installation
## Installation

Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it

#### Maven:
### Maven:
```xml
<dependencies>
...
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-tracing</artifactId>
<version>1.17.0</version>
<version>1.18.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-logging</artifactId>
<version>1.17.0</version>
<version>1.18.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-metrics</artifactId>
<version>1.17.0</version>
<version>1.18.0</version>
</dependency>
...
</dependencies>
Expand Down Expand Up @@ -190,9 +190,36 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
```
</details>

### Java Compatibility
Powertools for AWS Lambda (Java) supports all Java version from 8 up to 21 as well as the
[corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
For the modules that provide annotations, Powertools for AWS Lambda (Java) leverages the **aspectj** library.
You may need to add the good version of `aspectjrt` to your dependencies based on the JDK used for building your function:

```xml
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.??</version>
</dependency>
```

<details>
<summary><b>JDK - aspectj dependency matrix</b></summary>

| JDK version | aspectj version |
|-------------|-----------------|
| `1.8` | `1.9.7` |
| `11-17` | `1.9.20.1` |
| `21` | `1.9.21` |

More info [here](https://github.com/aws-powertools/powertools-lambda-java/pull/1519/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R191).

</details>

## Examples

See the latest release of the **[examples](https://github.com/aws-powertools/powertools-lambda-java/tree/v1.17.0/examples)** for example projects showcasing usage of different utilities.
See the latest release of the **[examples](https://github.com/aws-powertools/powertools-lambda-java/tree/v1.18.0/examples)** for example projects showcasing usage of different utilities.

Have a demo project to contribute which showcase usage of different utilities from powertools? We are happy to accept it [here](CONTRIBUTING.md#security-issue-notifications).

Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<module name="FileLength"/>

<module name="Header">
<property name="headerFile" value="license-header"/>
<property name="headerFile" value="${basedir}/license-header"/>
<property name="severity" value="error"/>
</module>

Expand Down
Loading

0 comments on commit 1a47aef

Please sign in to comment.