Skip to content

Commit

Permalink
Merge branch 'main' into add_dogstatsd_support
Browse files Browse the repository at this point in the history
  • Loading branch information
lojzatran authored Apr 8, 2024
2 parents 001356c + 5009ae8 commit 3965837
Show file tree
Hide file tree
Showing 1,024 changed files with 33,239 additions and 3,319 deletions.
6 changes: 1 addition & 5 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
a8ec45c8ea4ba559247b654d01b0d35b21a68865
33f3224cb40e3fa8c56ddb88962e3a4e9319685d
430a1a0a5dd4efe78e21526c37bec9dbce036401




737c88a0049e111ea1473f4cc0838b1feff729ac
d0129c1095216d5c830900c8a6223ef5d4274de1
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand All @@ -44,7 +44,7 @@ jobs:
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
token: ${{ steps.generate_github_token.outputs.token }}
- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
Expand All @@ -53,7 +53,7 @@ jobs:
java-version: '17'

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1.2.0
uses: ts-graphviz/setup-graphviz@d5b2b6b67007094b256f3fd2fa6cf0ac41ceef25 # v2.0.0

- name: Fix code style
if: github.event_name == 'push' && github.ref != 'refs/heads/main'
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand All @@ -159,7 +159,7 @@ jobs:
with:
token: ${{ steps.generate_github_token.outputs.token }}

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
Expand All @@ -168,7 +168,7 @@ jobs:
java-version: '17'

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1.2.0
uses: ts-graphviz/setup-graphviz@d5b2b6b67007094b256f3fd2fa6cf0ac41ceef25 # v2.0.0

- name: build javadoc
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand All @@ -181,4 +181,4 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3
uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 # v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -63,7 +63,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3
uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -76,6 +76,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand All @@ -36,7 +36,7 @@ jobs:
with:
token: ${{ steps.generate_github_token.outputs.token }}

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- uses: jenschude/auto-create-pr-action@a5369414c74963e6ec065dab49066d3711b8c1db # v0.3.2
if: github.ref_name == 'gen-sdk-updates'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
java-version: '17'

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1.2.0
uses: ts-graphviz/setup-graphviz@d5b2b6b67007094b256f3fd2fa6cf0ac41ceef25 # v2.0.0

- run: ./gradlew -Pversion=${{ github.event.inputs.version }} alljavadoc
working-directory: sdk
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand All @@ -26,7 +26,7 @@ jobs:
with:
token: ${{ steps.generate_github_token.outputs.token }}

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand All @@ -74,7 +74,7 @@ jobs:
ref: main
token: ${{ steps.generate_github_token.outputs.token }}

- uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 # v2.0.0
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 # v2.1.2

- run: ./gradlew -Pversion=${{ github.ref_name }} writeVersionToExamples writeVersionToReadme setVersion nextMinorVersion snapshotVersion

Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
# Get GitHub token via the CT SDKs App
- name: Generate GitHub token (via CT SDKs App)
id: generate_github_token
uses: actions/create-github-app-token@86576b355dd19da0519e0bdb63d8edb5bcf76a25 # v1
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
with:
app-id: ${{ secrets.CT_SDKS_APP_ID }}
private-key: ${{ secrets.CT_SDKS_APP_PEM }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
java-version: '17'

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1.2.0
uses: ts-graphviz/setup-graphviz@d5b2b6b67007094b256f3fd2fa6cf0ac41ceef25 # v2.0.0

- run: ./gradlew -Pversion=${{ github.ref_name }} alljavadoc
working-directory: sdk
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
sarif_file: results.sarif
16 changes: 7 additions & 9 deletions Best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,18 @@ ApiRootBuilder.of().withClientCredentialsFlow(
);
```

#### RetryMiddleware
The RetryMiddleware can be used to retry failed requests based on the given options. It will use an incremental backoff strategy for retries. By default it will retry on HTTP status code 500 and 503
```java
ApiRootBuilder.of().withRetryMiddleware(3);
```
#### PolicyMiddleware
The PolicyBuilder allows the combination of different policies for failing requests. You can specify the error codes to retry, different retry strategy, timeout etc.

The middleware can retry on specific HTTP status codes or exception types

```java
ApiRootBuilder.of().withRetryMiddleware(3, Arrays.asList(500, 503));
ApiRootBuilder.of().withRetryMiddleware(3, Arrays.asList(500, 503),
Collections.singletonList(InterruptedException.class));
ApiRootBuilder.of().withPolicies(policyBuilder -> policyBuilder.withRetry(retry -> retry.maxRetries(3)
.statusCodes(Arrays.asList(HttpStatusCode.SERVICE_UNAVAILABLE_503,
HttpStatusCode.INTERNAL_SERVER_ERROR_500))))
```

For more examples see [the PolicyMiddleware test](https://github.com/commercetools/commercetools-sdk-java-v2/blob/0251e8aa150af60c6ff6253e41180bfe0a10036b/rmf/rmf-java-base/src/test/java/io/vrap/rmf/base/client/http/PolicyMiddlewareTest.java).

#### UserAgentMiddleware
The UserAgentMiddleware adds a User-Agent header to every request. It will be added by using the `defaultClient` builder method. But can also be customized
```java
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@

# 17.8.0 (2024-04-01)

## What's Changed
* Update changelog by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/592
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/593
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/594
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/597
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/598
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/600
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/602
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/603
* Replace deprecated retry middleware with policy middleware in docs by @lojzatran in https://github.com/commercetools/commercetools-sdk-java-v2/pull/601
* Add integration test to get a valid oauth token by @lojzatran in https://github.com/commercetools/commercetools-sdk-java-v2/pull/596
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/605
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/607
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/608
* chore(deps): update gradle/actions digest to 417ae3c by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/582
* chore(deps): update yarn to v4 by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/510
* fix(deps): update dependency org.jdrupes.taglets:plantuml-taglet to v3 by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/497
* chore(deps): update all dependencies by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/575
* chore(deps): update actions/create-github-app-token digest to 78e5f2d by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/574
* chore(deps): update github/codeql-action digest to 1b1aada by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/581
* chore(deps): update ts-graphviz/setup-graphviz action to v2 by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/576
* fix(deps): update dependency com.squareup.okio:okio to v3 by @renovate in https://github.com/commercetools/commercetools-sdk-java-v2/pull/590


**Full Changelog**: https://github.com/commercetools/commercetools-sdk-java-v2/compare/17.7.0...17.8.0

# 17.7.0 (2024-02-29)

## What's Changed
Expand Down
4 changes: 3 additions & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ After that, we will have our request <strong>CategoryPagedQueryResponse</strong>
.defaultClient(ServiceRegion.GCP_EUROPE_WEST1.getApiUrl(),
ClientCredentials.of().withClientId("clientId").withClientSecret("clientSecret").build(),
ServiceRegion.GCP_EUROPE_WEST1.getOAuthTokenUrl())
.withRetryMiddleware(5, Arrays.asList(BAD_GATEWAY_502, SERVICE_UNAVAILABLE_503, GATEWAY_TIMEOUT_504))
.withPolicies(
policyBuilder -> policyBuilder.withRetry(retry -> retry.maxRetries(5)
.statusCodes(Arrays.asList(BAD_GATEWAY_502, SERVICE_UNAVAILABLE_503, GATEWAY_TIMEOUT_504))))
.buildForProject("projectKey");

final CategoryPagedQueryResponse body = projectClient.categories().get().executeBlocking().getBody();
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The latest stable SDK release can be retrieved from [Maven Central](https://sear
```gradle
ext {
versions = [
commercetools: "17.7.0"
commercetools: "17.8.0"
]
}
Expand All @@ -42,7 +42,7 @@ dependencies {

```maven
<properties>
<commercetools.version>17.7.0</commercetools.version>
<commercetools.version>17.8.0</commercetools.version>
</properties>
<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ allprojects {

configurations {
taglet {
resolutionStrategy.force("net.sourceforge.plantuml:plantuml:1.2023.13")
resolutionStrategy.force("net.sourceforge.plantuml:plantuml:1.2024.3")
}
}

dependencies {
taglet 'com.commercetools.build.taglets:commercetools-taglets:3.6.3'
taglet 'org.jdrupes.taglets:plantuml-taglet:2.1.0'
taglet 'org.jdrupes.taglets:plantuml-taglet:3.1.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.9.22"
id 'org.jetbrains.kotlin.jvm' version "1.9.23"
}

repositories {
Expand All @@ -13,7 +13,7 @@ java {
}

dependencies {
implementation "com.github.javaparser:javaparser-symbol-solver-core:3.25.8"
implementation "com.github.javaparser:javaparser-symbol-solver-core:3.25.9"
implementation "com.google.code.gson:gson:2.10.1"
implementation 'com.squareup:javapoet:1.13.0'
}
Loading

0 comments on commit 3965837

Please sign in to comment.