Skip to content

Commit

Permalink
fix conflicts when merging with main
Browse files Browse the repository at this point in the history
  • Loading branch information
anssari1 committed Feb 18, 2025
2 parents 51e49d6 + f20b1f9 commit a7dd6ce
Show file tree
Hide file tree
Showing 29 changed files with 126 additions and 387 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-and-publish-sdk-sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ on:

jobs:
generate-and-publish-sources:
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241126
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20250203
secrets: inherit
with:
name: rapid
version: ${{ inputs.version }}
transformations: "-th -te /v3 --operationIdsToTags"
repository: 'ExpediaGroup/rapid-java-sdk'
sdk_repo_ref: ${{ inputs.sdk_repo_ref }}
sdk_repo_ref: ${{ inputs.sdk_repo_ref || 'v20250203' }}
100 changes: 12 additions & 88 deletions .github/workflows/generate-docs-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,21 @@ name: Deploy Reference Documentation

on:
workflow_dispatch:
inputs:
ref:
description: 'Branch or tag to deploy reference docs from. Defaults to current branch.'
type: string
required: false
default: ''

permissions:
id-token: write

jobs:
deploy-reference-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout "main" Branch
uses: actions/checkout@v4
with:
ref: main

- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "eg-oss-ci"
git fetch --all
- name: Checkout "gh-pages" Branch
run: git checkout gh-pages

- name: Extract and Store Latest Live Docs Version Number
run: echo "LATEST_DOCS_VERSION=$(jq -r '.version' version.json)" >> $GITHUB_ENV

- name: Move Latest Docs to the "older" Directory (Archiving latest live release)
run: |
mkdir older/${{ env.LATEST_DOCS_VERSION }}
mv images rapid-sdk scripts styles index.html navigation.html not-found-version.html version.json older/${{ env.LATEST_DOCS_VERSION }}
- name: Move the "older" and "assets" Directories to a Temporary Workspace
run: mv older assets ${{ runner.temp }}

- name: Checkout "main" Branch
run: git checkout main

- name: Generate New Release Reference Docs
run: mvn -f code dokka:dokka -Ddokka-old-versions.location=${{ runner.temp }}/older -Ddokka-assets.location=${{ runner.temp }}/assets

- name: Extract and Store Newly Generated Docs Version Number
run: echo "NEW_DOCS_VERSION=$(jq -r '.version' code/target/dokka/version.json)" >> $GITHUB_ENV

- name: Check the New Release Version
run: |
for dir in ${{ runner.temp }}/older/*; do
if [ -d "$dir" ]; then
DIR_NAME=$(basename "$dir")
if [ "$DIR_NAME" == "${{ env.NEW_DOCS_VERSION }}" ]; then
echo "Error: Reference Docs with version ${{env.NEW_DOCS_VERSION }} already exists."
echo "Hint: Make sure to update the project version in the pom.xml file"
exit 1
fi
fi
done
- name: Move the Newly Generated Docs to a Temporary Workspace
run: mv code/target/dokka ${{ runner.temp }}/${{ env.NEW_DOCS_VERSION }}

- name: Checkout "gh-pages" Branch
run: git checkout gh-pages

- name: Cleanup Old Docs from the Repository's Root
run: rm -rf code images older rapid-sdk scripts styles ui-kit index.html navigation.html not-found-version.html version.json

- name: Move Newly Generated Docs to the Repository Root
run: mv ${{ runner.temp }}/${{ env.NEW_DOCS_VERSION }}/* .

- name: Commit the New Release
run: |
git add .
git commit -m "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
commit-message: "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
body: "This PR adds the reference documentation for version ${{ env.NEW_DOCS_VERSION }}."
title: "chore: reference docs update for version ${{ env.NEW_DOCS_VERSION }}"
branch: "docs-update-${{ env.NEW_DOCS_VERSION }}"







uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@main"
with:
buildsystem: 'maven'
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
secrets:
GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
22 changes: 11 additions & 11 deletions .github/workflows/release-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ on:
default: ''

jobs:
run-examples:
strategy:
matrix:
jdk: [ 8, 11, 17, 21 ]
uses: ./.github/workflows/run-examples.yaml
secrets: inherit
with:
branch: ${{ inputs.branch }}
jdk: ${{ matrix.jdk }}
# run-examples:
# strategy:
# matrix:
# jdk: [ 8, 11, 17, 21 ]
# uses: ./.github/workflows/run-examples.yaml
# secrets: inherit
# with:
# branch: ${{ inputs.branch }}
# jdk: ${{ matrix.jdk }}

release-sdk:
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241126
needs: [ run-examples ]
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20250203
# needs: [ run-examples ]
secrets: inherit
with:
branch: ${{ inputs.branch }}
2 changes: 1 addition & 1 deletion code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.0</version>
<version>5.3.2</version>
</dependency>
```

Expand Down
29 changes: 15 additions & 14 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.0</version>
<version>5.3.2</version>
<name>EG rapid-sdk for Java</name>
<description>EG rapid-sdk v5.3.0</description>
<description>EG rapid-sdk v5.3.2</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -72,17 +72,17 @@
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<ktlint-plugin.version>3.4.0</ktlint-plugin.version>
<ktlint-plugin.version>3.5.0</ktlint-plugin.version>
<jacoco-plugin.version>0.8.12</jacoco-plugin.version>
<dokka-plugin.version>1.9.20</dokka-plugin.version>
<dokka-plugin.version>2.0.0</dokka-plugin.version>
<dokka-old-versions.location/> <!-- passed as a property when running dokka:dokka-->
<properties.maven.plugin.version>1.2.1</properties.maven.plugin.version>
<maven.licence.plugin.version>4.6</maven.licence.plugin.version>
<flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
<kotlin.version>2.0.21</kotlin.version>
<kotlinx.coroutines.version>1.9.0</kotlinx.coroutines.version>
<ktor.version>2.3.13</ktor.version>
<kotlin-atomic.version>0.26.1</kotlin-atomic.version>
<kotlin.version>2.1.0</kotlin.version>
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
<ktor.version>3.0.3</ktor.version>
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
<slf4j.version>2.0.16</slf4j.version>
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
Expand Down Expand Up @@ -138,12 +138,12 @@
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.9.1</version>
<version>3.10.2</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.1</version>
<version>26.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
Expand Down Expand Up @@ -449,6 +449,7 @@
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>${dokka-plugin.version}</version>
<configuration>
<sourceDirectories>
<dir>${project.basedir}/src/main/kotlin/com/expediagroup/sdk/rapid</dir>
Expand Down Expand Up @@ -732,25 +733,25 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
<version>3.17.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>
</dependency>

<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-api</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
</dependency>

<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-extensions</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ abstract class BaseRapidClient(
private val engine: HttpClientEngine =
_configurationProvider.okHttpClient?.let {
OkHttp.create {
preconfigured = it
config {
preconfigured = it
dispatcher(it.dispatcher)
}
}
} ?: httpClientEngine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ abstract class BaseXapClient(
private val engine: HttpClientEngine =
_configurationProvider.okHttpClient?.let {
OkHttp.create {
preconfigured = it
config {
preconfigured = it
dispatcher(it.dispatcher)
}
}
} ?: httpClientEngine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import okhttp3.Dispatcher
import okhttp3.OkHttpClient

// Create a Dispatcher with limits
val dispatcher =
val configuredDispatcher =
Dispatcher().apply {
maxRequests = 10000 // Maximum number of concurrent requests
maxRequestsPerHost = 1000
Expand All @@ -64,7 +64,7 @@ val DEFAULT_HTTP_CLIENT_ENGINE: HttpClientEngine =
OkHttp.create {
config {
eventListenerFactory(OkHttpEventListener.FACTORY)
dispatcher(dispatcher)
dispatcher(configuredDispatcher)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,20 @@ abstract class ExpediaGroupClient(
return self()
}
}

@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients.
abstract class BuilderWithHttpClient<SELF : Client.BuilderWithHttpClient<SELF>> : Client.BuilderWithHttpClient<SELF>() {
/** Sets the API auth endpoint to use for requests. */
protected var authEndpoint: String? = null

/** Sets the API auth endpoint to use for requests.
*
* @param authEndpoint The API auth endpoint to use for requests.
* @return The [Builder] instance.
*/
fun authEndpoint(authEndpoint: String): SELF {
this.authEndpoint = authEndpoint
return self()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
*/
package com.expediagroup.sdk.core.configuration.provider

import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.connectionTimeout
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.endpoint
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.name
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.requestTimeout
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.socketTimeout
import com.expediagroup.sdk.core.constant.Constant

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package com.expediagroup.sdk.core.constant

import io.ktor.client.plugins.HttpTimeout
import io.ktor.client.plugins.HttpTimeoutConfig

internal object Constant {
const val EMPTY_STRING = ""
const val TEN_SECONDS_IN_MILLIS = 10_000L
const val FIFTEEN_SECONDS_IN_MILLIS = 15_000L
const val INFINITE_TIMEOUT = HttpTimeout.INFINITE_TIMEOUT_MS
const val INFINITE_TIMEOUT = HttpTimeoutConfig.INFINITE_TIMEOUT_MS

private const val SUCCESSFUL_STATUS_CODES_RANGE_START = 200
private const val SUCCESSFUL_STATUS_CODES_RANGE_END = 299
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
*/
package com.expediagroup.sdk.core.constant

import com.expediagroup.sdk.core.constant.LoggingMessage.OMITTED

internal object LogMaskingRegex {
val FIELD_REGEX = "^[a-zA-Z0-9-_]+$".toRegex()

val NUMBER_FIELD_REGEX = "(?<=[\"']?number[\"']?:\\s?[\"'])(\\s*\\d{15,16}\\s*)(?=[\"'])".toRegex()
const val REPLACEMENT_TEMPLATE = "\"$1$2${OMITTED}\""
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,19 @@
package com.expediagroup.sdk.core.constant.provider

internal object LogMaskingRegexProvider {
fun getMaskedFieldsRegex(maskedBodyFields: Set<String>) = "(?<=[\"']?(${maskedBodyFields.joinToString("|")})[\"']?:\\s?[\"'])(\\s*[^\"']+\\s*)(?=[\"'])".toRegex()
fun getMaskedFieldsRegex(
maskedBodyFields: Set<String>,
value: String = "[^\\\"]+"
): Regex {
val fields = maskedBodyFields.joinToString("|")
return "\"($fields)(\\\\*\"\\s*:\\s*\\\\*\")$value(?:\\\\?\"|)".toRegex()
}

fun getMaskedFieldsRegex(
maskedBodyField: String,
value: String = "[^\\\"]+"
): Regex {
val fields = setOf(maskedBodyField)
return getMaskedFieldsRegex(fields, value)
}
}
Loading

0 comments on commit a7dd6ce

Please sign in to comment.