Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez committed Oct 31, 2024
2 parents 6a7b812 + 290c048 commit 3f082bb
Show file tree
Hide file tree
Showing 326 changed files with 71,135 additions and 18,618 deletions.
6 changes: 4 additions & 2 deletions .brazil.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"dependencies": {
"org.jetbrains.kotlin:kotlin-gradle-plugin:2.*": "KotlinGradlePlugin-2.x",
"org.jetbrains.kotlin:kotlin-stdlib-common:2.*.*": "KotlinStdlibCommon-2.x",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.*.*": "KotlinStdlibJdk8-2.x",
"org.jetbrains.kotlin:kotlin-stdlib:2.*.*": "KotlinStdlib-2.x",
"org.jetbrains.kotlinx:atomicfu:0.*.*": "Atomicfu-0.x",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x",
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": "KotlinxCoroutinesJdk8-1.x"
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": "KotlinxCoroutinesJdk8-1.x",
"com.google.devtools.ksp:symbol-processing-api:2.*": "Maven-com-google-devtools-ksp_symbol-processing-api-2.x",
"com.google.devtools.ksp:symbol-processing-gradle-plugin:2.*": "Maven-com-google-devtools-ksp_symbol-processing-gradle-plugin-2.x"
},
"packageHandlingRules": {
"versioning": {
"defaultVersionLayout": "{MAJOR}.0.x"
},
"ignore": [
"aws.sdk.kotlin:bom",
"aws.sdk.kotlin.crt:aws-crt-kotlin-android",
"aws.sdk.kotlin:testing",
"aws.sdk.kotlin:version-catalog"
],
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/kat-transform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Kat Transform

on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]

# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed
concurrency:
group: kat-pr-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

env:
RUN: ${{ github.run_id }}-${{ github.run_number }}
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
verify-transform:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
path: 'aws-sdk-kotlin'

- name: Setup Build
uses: ./aws-sdk-kotlin/.github/actions/setup-build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2

- name: Setup kat
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main

- name: Build
working-directory: ./aws-sdk-kotlin
shell: bash
run: |
pwd
ls -lsa
kat bump-version # Bump from `vNext-SNAPSHOT` to `vNext`. kat transform only works on non-SNAPSHOT versions
./gradlew build
./gradlew publishAllPublicationsToTestLocalRepository
- name: Transform
working-directory: ./aws-sdk-kotlin
shell: bash
run: |
pwd
ls -lsa
kat brazil transform -i ./build/m2 -o ./transformed -t .brazil.json -v live -m ./codegen/sdk/packages.json
# Check for manifest file
if [ ! -f "./transformed/brazil-import-manifest.json" ]; then
echo "Error: brazil-import-manifest.json not found in the transformed artifact"
exit 1
fi
echo "Transformation succeeded!"
249 changes: 249 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
description = "Support for AWS configuration"
extra["moduleName"] = "aws.sdk.kotlin.runtime.config"

apply(plugin = "kotlinx-atomicfu")
apply(plugin = "org.jetbrains.kotlinx.atomicfu")

kotlin {
sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package aws.sdk.kotlin.runtime.config.profile
import aws.sdk.kotlin.runtime.InternalSdkApi

@InternalSdkApi
@ExposedCopyVisibility // FIXME Change to @ConsistentCopyVisibility in 1.4.x minor version bump
public data class ConfigSection internal constructor(
public val name: String,
internal val properties: Map<String, AwsConfigValue>,
Expand Down
1 change: 1 addition & 0 deletions aws-runtime/aws-endpoint/api/aws-endpoint.api
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public final class aws/sdk/kotlin/runtime/endpoint/functions/PartitionConfig {
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,31 @@ public data class Partition(
* the result of a partition call.
*/
@InternalSdkApi
public data class PartitionConfig @JvmOverloads constructor(
public data class PartitionConfig(
public val name: String? = null,
public val dnsSuffix: String? = null,
public val dualStackDnsSuffix: String? = null,
public val supportsFIPS: Boolean? = null,
public val supportsDualStack: Boolean? = null,
public val implicitGlobalRegion: String? = null,
) {
@Deprecated("This constructor does not support implicitGlobalRegion") // but is added for backwards compatibility
@JvmOverloads
public constructor (
name: String? = null,
dnsSuffix: String? = null,
dualStackDnsSuffix: String? = null,
supportsFIPS: Boolean? = null,
supportsDualStack: Boolean? = null,
) : this(
name,
dnsSuffix,
dualStackDnsSuffix,
supportsFIPS,
supportsDualStack,
null,
)

public fun mergeWith(other: PartitionConfig): PartitionConfig =
PartitionConfig(
other.name ?: name,
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ configureNexus()
val lintPaths = listOf(
"**/*.{kt,kts}",
"!**/generated-src/**",
"!**/generated/ksp/**",
"!**/kspCaches/**",
"!**/smithyprojections/**",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package aws.sdk.kotlin.codegen.customization

import software.amazon.smithy.aws.traits.protocols.AwsQueryCompatibleTrait
import software.amazon.smithy.kotlin.codegen.KotlinSettings
import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
import software.amazon.smithy.kotlin.codegen.model.hasTrait
import software.amazon.smithy.kotlin.codegen.rendering.protocol.MutateHeadersMiddleware
import software.amazon.smithy.kotlin.codegen.rendering.protocol.ProtocolGenerator
import software.amazon.smithy.kotlin.codegen.rendering.protocol.ProtocolMiddleware
import software.amazon.smithy.model.Model

/**
* Send an extra `x-amzn-query-mode` header with a value of `true` for services which have the [AwsQueryCompatibleTrait] applied.
*/
class AwsQueryModeCustomization : KotlinIntegration {
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean =
model
.getShape(settings.service)
.get()
.hasTrait<AwsQueryCompatibleTrait>()

override fun customizeMiddleware(ctx: ProtocolGenerator.GenerationContext, resolved: List<ProtocolMiddleware>): List<ProtocolMiddleware> =
resolved + MutateHeadersMiddleware(extraHeaders = mapOf("x-amzn-query-mode" to "true"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SigV4AsymmetricTraitCustomization : KotlinIntegration {
override val order: Byte = -60

// services which support SigV4A but don't model it
private val unmodeledSigV4aServices = listOf("s3", "eventbridge")
private val unmodeledSigV4aServices = listOf("s3", "eventbridge", "sesv2")

override fun enabledForService(model: Model, settings: KotlinSettings): Boolean =
unmodeledSigV4aServices.contains(settings.sdkId.lowercase()) && !model.isTraitApplied(SigV4ATrait::class.java)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ val smokeTestDenyList = setOf(
"Application Auto Scaling",
"SWF",
"WAFV2",
"IoT Data Plane",
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ aws.sdk.kotlin.codegen.customization.glacier.GlacierBodyChecksum
aws.sdk.kotlin.codegen.customization.polly.PollyPresigner
aws.sdk.kotlin.codegen.customization.machinelearning.MachineLearningEndpointCustomization
aws.sdk.kotlin.codegen.customization.route53.TrimResourcePrefix
aws.sdk.kotlin.codegen.customization.route53.ChangeResourceRecordSetsUnmarshallingIntegration
aws.sdk.kotlin.codegen.customization.ec2.EC2MakePrimitivesOptional
aws.sdk.kotlin.codegen.customization.RemoveDefaults
aws.sdk.kotlin.codegen.customization.s3.UnsupportedSigningAlgorithmIntegration
Expand All @@ -44,3 +43,4 @@ aws.sdk.kotlin.codegen.customization.s3.express.S3ExpressIntegration
aws.sdk.kotlin.codegen.customization.s3.S3ExpiresIntegration
aws.sdk.kotlin.codegen.BusinessMetricsIntegration
aws.sdk.kotlin.codegen.smoketests.SmokeTestsDenyListIntegration
aws.sdk.kotlin.codegen.customization.AwsQueryModeCustomization
Loading

0 comments on commit 3f082bb

Please sign in to comment.