Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a4734c7
fix: create JMESPATH flattenIfPossible functions for Lists (#1169)
0marperez Dec 16, 2024
7911a94
chore: release 1.3.30
aws-sdk-kotlin-ci Dec 16, 2024
7085c8a
chore: bump snapshot version to 1.3.31-SNAPSHOT
aws-sdk-kotlin-ci Dec 16, 2024
4575023
misc: enhance support for replayable instances of `InputStream` (#1197)
lauzadis Dec 18, 2024
b0a4bac
chore: release 1.3.31
aws-sdk-kotlin-ci Dec 18, 2024
80f4538
chore: bump snapshot version to 1.3.32-SNAPSHOT
aws-sdk-kotlin-ci Dec 18, 2024
e9d16a9
fix: CBOR protocol test assertions / blob serialization (#1198)
lauzadis Dec 18, 2024
ce50237
Show me the failing tests
lauzadis Dec 20, 2024
c2afe51
Ignore failing tests
lauzadis Dec 20, 2024
cb62380
`@Ignore`
lauzadis Dec 20, 2024
3e1b758
ktlint
lauzadis Dec 20, 2024
7f27659
IgnoreNative
lauzadis Jan 6, 2025
59ea1ff
Add zero-arg constructor, apply `@IgnoreNative` everywhere!
lauzadis Jan 6, 2025
33f4414
ktlint
lauzadis Jan 6, 2025
fc0b48b
Merge branch 'main' of github.com:smithy-lang/smithy-kotlin into kn-i…
lauzadis Jan 6, 2025
f370fad
CI
lauzadis Jan 7, 2025
91e22ab
CI
lauzadis Jan 7, 2025
ef0fd8d
CI
lauzadis Jan 7, 2025
1af9a30
rename file to match main branch
lauzadis Jan 7, 2025
b32b2f3
Add all-platforms checks back
lauzadis Jan 7, 2025
b2d8501
Remove checks that are stalled
lauzadis Jan 7, 2025
1e9f6a9
Revert "Remove checks that are stalled"
lauzadis Jan 7, 2025
5571b1b
Disable aws.kotlin.native in all-platforms
lauzadis Jan 7, 2025
a9d4a9a
Add `=false`
lauzadis Jan 7, 2025
4ecac4a
CI
lauzadis Jan 7, 2025
4854db6
Remove all-platforms
lauzadis Jan 7, 2025
7b168ed
Add all-platforms
lauzadis Jan 7, 2025
8f70b68
CI
lauzadis Jan 7, 2025
70672f2
Run a few more checks on '*-main' branches (expanded from just 'main')
lauzadis Jan 7, 2025
adeb4bb
Fix artifact-size-metrics running Native build
lauzadis Jan 7, 2025
74da55c
Run on main too
lauzadis Jan 7, 2025
3100519
Setup build
lauzadis Jan 7, 2025
8d43b22
Checkout with path`
lauzadis Jan 7, 2025
1bdf144
Add working-directory
lauzadis Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/1021e75a-45f3-4f3a-820c-700d9ec6e782.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "1021e75a-45f3-4f3a-820c-700d9ec6e782",
"type": "bugfix",
"description": "Fix serialization of CBOR blobs"
}
2 changes: 1 addition & 1 deletion .github/workflows/api-compat-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: API compatibility verification
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]
branches: [ main, '*-main' ]

jobs:
api-compat-verification:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/artifact-size-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Artifact Size Metrics
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]
branches: [ main, '*-main' ]
release:
types: [published]

Expand Down Expand Up @@ -53,9 +53,9 @@ jobs:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
- name: Generate Artifact Size Metrics
run: ./gradlew artifactSizeMetrics
run: ./gradlew -Paws.kotlin.native=false artifactSizeMetrics
- name: Analyze Artifact Size Metrics
run: ./gradlew analyzeArtifactSizeMetrics
run: ./gradlew -Paws.kotlin.native=false analyzeArtifactSizeMetrics
- name: Show Results
uses: actions/github-script@v7
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Changelog verification
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]
branches: [ main, '*-main' ]

jobs:
changelog-verification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,44 @@ jobs:
name: test-reports-windows
path: '**/build/reports'

all-platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
path: 'smithy-kotlin'

- name: Setup build
uses: ./smithy-kotlin/.github/actions/setup-build

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
cache: 'gradle'

- name: Test
working-directory: ./smithy-kotlin
shell: bash
run: |
# FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532
# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
./gradlew -Paws.kotlin.native=false apiCheck
./gradlew -Paws.kotlin.native=false test jvmTest

- name: Save Test Reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-reports-${{ matrix.os }}
path: '**/build/reports'

protocol-tests:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.3.31] - 12/18/2024

### Features
* [#1473](https://github.com/awslabs/aws-sdk-kotlin/issues/1473) Enhance support for replayable instances of `InputStream`

## [1.3.30] - 12/16/2024

## [1.3.29] - 12/12/2024

## [1.3.28] - 12/03/2024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ open class HttpProtocolUnitTestRequestGenerator protected constructor(builder: B
write("return")
}
write("requireNotNull(expectedBytes) { #S }", "expected application/cbor body cannot be null")
write("requireNotNull(expectedBytes) { #S }", "actual application/cbor body cannot be null")
write("requireNotNull(actualBytes) { #S }", "actual application/cbor body cannot be null")

write("")
write("val expectedRequest = #L(#T(expectedBytes))", inputDeserializer.name, RuntimeTypes.Serde.SerdeCbor.CborDeserializer)
write("val actualRequest = #L(#T(expectedBytes))", inputDeserializer.name, RuntimeTypes.Serde.SerdeCbor.CborDeserializer)
write("val actualRequest = #L(#T(actualBytes))", inputDeserializer.name, RuntimeTypes.Serde.SerdeCbor.CborDeserializer)
write("assertEquals(expectedRequest, actualRequest)")
}
writer.write("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ open class SerializeStructGenerator(
val target = member.targetOrSelf(ctx.model)

val encoded = when {
target.type == ShapeType.BLOB -> writer.format("#L.#T()", identifier, RuntimeTypes.Core.Text.Encoding.encodeBase64String)
target.type == ShapeType.TIMESTAMP -> {
writer.addImport(RuntimeTypes.Core.TimestampFormat)
val tsFormat = member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ class SerializeStructGeneratorTest {

val expected = """
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.fooBlob?.let { field(FOOBLOB_DESCRIPTOR, it.encodeBase64String()) }
input.fooBlob?.let { field(FOOBLOB_DESCRIPTOR, it) }
}
""".trimIndent()

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kotlinx.atomicfu.enableNativeIrTransformation=false
org.gradle.jvmargs=-Xmx2G -XX:MaxMetaspaceSize=1G

# SDK
sdkVersion=1.3.30-SNAPSHOT
sdkVersion=1.3.32-SNAPSHOT

# codegen
codegenVersion=0.33.30-SNAPSHOT
codegenVersion=0.33.32-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package aws.smithy.kotlin.runtime.auth.awscredentials

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.collections.Attributes
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.ManualClock
Expand Down Expand Up @@ -36,6 +37,7 @@ class CachedCredentialsProviderTest {
}
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testLoadFirstCall() = runTest {
// explicit expiration
Expand All @@ -50,6 +52,7 @@ class CachedCredentialsProviderTest {
assertEquals(1, source.callCount)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testDefaultExpiration() = runTest {
// expiration should come from the cached provider
Expand All @@ -62,6 +65,7 @@ class CachedCredentialsProviderTest {
assertEquals(1, source.callCount)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testReloadExpiredCredentials() = runTest {
val source = TestCredentialsProvider(expiration = testExpiration)
Expand All @@ -77,6 +81,7 @@ class CachedCredentialsProviderTest {
assertEquals(2, source.callCount)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testRefreshBufferWindow() = runTest {
val source = TestCredentialsProvider(expiration = testExpiration)
Expand All @@ -98,6 +103,7 @@ class CachedCredentialsProviderTest {
assertEquals(2, source.callCount)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testLoadFailed() = runTest {
val source = object : CredentialsProvider {
Expand All @@ -120,6 +126,7 @@ class CachedCredentialsProviderTest {
provider.resolve()
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testItThrowsOnGetCredentialsAfterClose() = runTest {
val source = TestCredentialsProvider(expiration = testExpiration)
Expand All @@ -137,6 +144,7 @@ class CachedCredentialsProviderTest {
assertEquals(1, source.callCount)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testCachedConvenienceFunction() = runTest {
val source = TestCredentialsProvider(expiration = testExpiration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
package aws.smithy.kotlin.runtime.auth.awssigning

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
Expand All @@ -24,12 +25,14 @@ import kotlin.test.assertTrue
class PresignerTest {
// Verify that custom endpoint URL schemes aren't changed.
// See https://github.com/awslabs/aws-sdk-kotlin/issues/938
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testSignedUrlAllowsHttp() = testSigningUrl("http://localhost:8080/path/to/resource?foo=bar")

// Verify that custom endpoint URL schemes aren't changed.
// See https://github.com/awslabs/aws-sdk-kotlin/issues/938
@Test
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
fun testSignedUrlAllowsHttps() = testSigningUrl("https://localhost:8088/path/to/resource?bar=foo")

private fun testSigningUrl(url: String) = runTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
package aws.smithy.kotlin.runtime.auth.awssigning

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
import aws.smithy.kotlin.runtime.auth.awssigning.tests.DEFAULT_TEST_CREDENTIALS
import aws.smithy.kotlin.runtime.http.*
Expand All @@ -18,6 +19,7 @@ import kotlin.test.assertEquals

class DefaultCanonicalizerTest {
// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testCanonicalize() = runTest {
val request = HttpRequest {
Expand Down Expand Up @@ -78,6 +80,7 @@ class DefaultCanonicalizerTest {
}

// Targeted test for proper URI path escaping. See https://github.com/smithy-lang/smithy-kotlin/issues/657
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testEscapablePath() {
val uri = Url.Builder()
Expand All @@ -94,6 +97,7 @@ class DefaultCanonicalizerTest {
assertEquals("/2013-04-01/healthcheck/foo%253Cbar%253Ebaz%253C%252Fbar%253E", uri.canonicalPath(config))
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testCanonicalPath() {
val config = AwsSigningConfig {
Expand All @@ -109,6 +113,7 @@ class DefaultCanonicalizerTest {
assertEquals("/foo/%40bar/baz%253Cqux%253Aquux", uri.canonicalPath(config))
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testCanonicalQueryParams() {
Url.Builder().apply {
Expand All @@ -123,6 +128,7 @@ class DefaultCanonicalizerTest {
}
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testUnsignedHeaders() = runTest {
val request = HttpRequest {
Expand Down Expand Up @@ -155,6 +161,7 @@ class DefaultCanonicalizerTest {
assertEquals(expectedSignedHeaders, actual.signedHeaders)
}

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testCustomPort() = runTest {
val request = HttpRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
package aws.smithy.kotlin.runtime.auth.awssigning

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
import aws.smithy.kotlin.runtime.http.Headers
import aws.smithy.kotlin.runtime.http.HttpBody
Expand All @@ -15,6 +16,7 @@ import kotlin.test.Test
import kotlin.test.assertEquals

class DefaultRequestMutatorTest {
@IgnoreNative // FIXME Re-enable after Kotlin/Native implementation
@Test
fun testAppendAuthHeader() {
val canonical = CanonicalRequest(baseRequest.toBuilder(), "", "action;host;x-amz-date", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
package aws.smithy.kotlin.runtime.auth.awssigning

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
import aws.smithy.kotlin.runtime.auth.awssigning.tests.DEFAULT_TEST_CREDENTIALS
import aws.smithy.kotlin.runtime.hashing.sha256
Expand All @@ -16,6 +17,7 @@ import kotlin.test.assertEquals

class DefaultSignatureCalculatorTest {
// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testCalculate() {
val signingKey = "c4afb1cc5771d871763a393e44b703571b55cc28424d1a5e86da6ed3c154a4b9".decodeHexBytes()
Expand All @@ -32,6 +34,7 @@ class DefaultSignatureCalculatorTest {
}

// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testSigningKey() = runTest {
val config = AwsSigningConfig {
Expand All @@ -47,6 +50,7 @@ class DefaultSignatureCalculatorTest {
}

// Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testStringToSign() {
val canonicalRequest = """
Expand Down Expand Up @@ -80,6 +84,7 @@ class DefaultSignatureCalculatorTest {

private data class ChunkStringToSignTest(val signatureType: AwsSignatureType, val expectedNonSignatureHeaderHash: String)

@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testChunkStringToSign() {
// Test event stream signing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package aws.smithy.kotlin.runtime.auth.awssigning.tests

import aws.smithy.kotlin.runtime.IgnoreNative
import aws.smithy.kotlin.runtime.auth.awssigning.*
import aws.smithy.kotlin.runtime.auth.awssigning.internal.CHUNK_SIZE_BYTES
import aws.smithy.kotlin.runtime.io.*
Expand All @@ -17,6 +18,7 @@ import kotlin.test.*
import kotlin.time.Duration.Companion.milliseconds

abstract class AwsChunkedByteReadChannelTestBase : AwsChunkedTestBase(AwsChunkedReaderFactory.Channel) {
@IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation
@Test
fun testSlowProducerMultipleChunksPartialLast(): TestResult = runTest {
val numChunks = 6
Expand Down
Loading
Loading