Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a07ff66
initial poc commit of DynamoDB Mapper (#1232)
ianbotsf Feb 27, 2024
c3e6286
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Feb 29, 2024
4ddf278
add support for Mapper initialization (#1237)
ianbotsf Mar 8, 2024
21fda60
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Mar 8, 2024
13f0744
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Mar 14, 2024
2a844c5
implement mapper pipeline (#1266)
ianbotsf Mar 29, 2024
ed50ed4
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Mar 29, 2024
41944d4
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Apr 4, 2024
5f9d679
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Jul 10, 2024
b31e851
initial implementation of codegen for low-level operations/types (#1357)
ianbotsf Jul 18, 2024
6025c0d
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Jul 26, 2024
e0d5231
initial implementation of secondary index support (#1375)
ianbotsf Aug 1, 2024
4db4582
Merge remote-tracking branch 'origin/main' into feat-ddb-mapper
ianbotsf Aug 1, 2024
592be7b
Create new codegen module and refactor annotation processor to use it…
lauzadis Aug 19, 2024
b53e7c5
Merge branch 'main' of github.com:awslabs/aws-sdk-kotlin into feat-dd…
lauzadis Aug 21, 2024
32108ae
feat: add Schema generator Gradle plugin (#1385)
lauzadis Aug 22, 2024
d5e31d0
Fix plugin test package
lauzadis Aug 26, 2024
936aaa9
add attribute converters for "standard" values (#1381)
ianbotsf Aug 27, 2024
5505fea
Merge branch 'main' into feat-ddb-mapper
ianbotsf Aug 27, 2024
b2e2f57
fix: schema generator plugin test module (#1394)
lauzadis Aug 28, 2024
54adfcb
feat: annotation processor codegen configuration (#1392)
lauzadis Sep 6, 2024
b08e24d
feat: add `@DynamoDbIgnore` annotation (#1402)
lauzadis Sep 12, 2024
4d71a04
DDB Mapper filter expressions (runtime components) (#1401)
ianbotsf Sep 17, 2024
be764b7
Merge branch 'main' into feat-ddb-mapper
ianbotsf Sep 18, 2024
15a9472
feat: basic annotation processing (#1399)
lauzadis Sep 19, 2024
21f1bd5
add DSL overloads, paginators, and better builder integration for DDB…
ianbotsf Sep 19, 2024
e509449
chore: split dynamodb-mapper-codegen into two modules (#1414)
lauzadis Sep 23, 2024
4240741
Merge branch 'main' into feat-ddb-mapper
ianbotsf Sep 29, 2024
535d4c3
emit DDB_MAPPER business metric (#1426)
ianbotsf Oct 3, 2024
997a9f6
feat: setup DynamoDbMapper publication (#1419)
lauzadis Oct 3, 2024
e080cea
DDB Mapper filter expressions (codegen components) (#1424)
ianbotsf Oct 3, 2024
8118d76
correct docs
lauzadis Oct 3, 2024
5a1c004
mark every HLL/DDBM API experimental (#1428)
ianbotsf Oct 4, 2024
9d79622
fix accidental inclusion of expression attribute members in high-leve…
ianbotsf Oct 5, 2024
e1051c0
Merge branch 'feat-ddb-mapper' of github.com:awslabs/aws-sdk-kotlin i…
lauzadis Oct 9, 2024
86acfe4
Merge branch 'main' of github.com:awslabs/aws-sdk-kotlin into feat-dd…
lauzadis Oct 10, 2024
8bd53f6
Upgrade to latest build plugin version
lauzadis Oct 10, 2024
53e9db0
Merge branch 'main' into feat-ddb-mapper
ianbotsf Oct 23, 2024
cd24266
fix: various issues found during testing (#1450)
lauzadis Oct 25, 2024
660eb2c
chore: update Athena changelog notes for 1.3.57 (2024-10-18) release …
ianbotsf Oct 23, 2024
02172d2
feat: update AWS API models
aws-sdk-kotlin-ci Oct 23, 2024
5d834dc
feat: update AWS service endpoints metadata
aws-sdk-kotlin-ci Oct 23, 2024
84c82aa
chore: release 1.3.60
aws-sdk-kotlin-ci Oct 23, 2024
352a6f4
chore: bump snapshot version to 1.3.61-SNAPSHOT
aws-sdk-kotlin-ci Oct 23, 2024
23d94b5
Merge branch 'main' into feat-ddb-mapper
ianbotsf Oct 25, 2024
cb1b37e
feat: initial release of Developer Preview of DynamoDB Mapper for Kotlin
ianbotsf Oct 25, 2024
a02e514
Fix Kotlin gradle-plugin version
lauzadis Oct 25, 2024
9d72356
fix: ddb mapper tests (#1453)
lauzadis Oct 28, 2024
4fc6a00
Bump build plugin version
lauzadis Oct 29, 2024
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
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
9 changes: 9 additions & 0 deletions .changes/e4f3b5cb-9cdc-4bc7-b12d-e0a17b635f23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "e4f3b5cb-9cdc-4bc7-b12d-e0a17b635f23",
"type": "feature",
"description": "Initial release of Developer Preview of **DynamoDB Mapper** for Kotlin",
"issues": [
"awslabs/aws-sdk-kotlin#472"
],
"module": "dynamodb-mapper"
}
1 change: 1 addition & 0 deletions aws-runtime/aws-http/api/aws-http.api
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AddUserAgentMetadata
}

public final class aws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric : java/lang/Enum, aws/smithy/kotlin/runtime/businessmetrics/BusinessMetric {
public static final field DDB_MAPPER Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
public static final field S3_EXPRESS_BUCKET Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public fun getIdentifier ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ private fun formatMetrics(metrics: MutableSet<String>): String {
@InternalApi
public enum class AwsBusinessMetric(public override val identifier: String) : BusinessMetric {
S3_EXPRESS_BUCKET("J"),
DDB_MAPPER("d"),
}
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
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$s
# atomicfu
kotlinx.atomicfu.enableJvmIrTransformation=true
# FIXME - https://github.com/Kotlin/kotlinx-atomicfu/issues/274
kotlinx.atomicfu.enableNativeIrTransformation=false
kotlinx.atomicfu.enableNativeIrTransformation=false

# https://github.com/google/ksp/blob/main/docs/ksp2.md
ksp.useKSP2=true
14 changes: 12 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[versions]
kotlin-version = "2.0.21"
ksp-version = "2.0.21-1.0.25" # Keep in sync with kotlin-version

dokka-version = "1.9.10"

aws-kotlin-repo-tools-version = "0.4.13"
Expand All @@ -16,6 +18,7 @@ smithy-kotlin-codegen-version = "0.33.17"
smithy-version = "1.51.0"

# testing
ddb-local-version = "2.5.2"
junit-version = "5.10.5"
kotest-version = "5.9.1"
kotlinx-benchmark-version = "0.4.12"
Expand All @@ -26,8 +29,8 @@ slf4j-version = "2.0.16"
[libraries]
aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" }

kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-version"}
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin-version"}
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-version" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin-version" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-version" }
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin-version" }
dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka-version" }
Expand All @@ -42,6 +45,9 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
kotlinx-coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines-version" }
kotlinx-coroutines-slf4j = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "coroutines-version" }

ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp-version" }
ksp-gradle-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp-version" }

slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-version" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j-version" }

Expand Down Expand Up @@ -107,6 +113,8 @@ kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-version" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk-version" }

ddb-local = { module = "com.amazonaws:DynamoDBLocal", version.ref = "ddb-local-version" }

[bundles]
# bundle of smithy-kotlin dependencies all AWS service clients have
smithy-kotlin-service-client = [
Expand Down Expand Up @@ -134,6 +142,8 @@ kotlin-multiplatform = {id = "org.jetbrains.kotlin.multiplatform", version.ref =
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark-version" }
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version"}
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-version" }
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
aws-kotlin-repo-tools-smithybuild = { id = "aws.sdk.kotlin.gradle.smithybuild", version.ref = "aws-kotlin-repo-tools-version" }
aws-kotlin-repo-tools-artifactsizemetrics = { id = "aws.sdk.kotlin.gradle.artifactsizemetrics", version.ref = "aws-kotlin-repo-tools-version" }
gradle-plugin-publish = { id = "com.gradle.plugin-publish", version = "1.2.1"}
115 changes: 115 additions & 0 deletions hll/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import aws.sdk.kotlin.gradle.dsl.configurePublishing
import aws.sdk.kotlin.gradle.kmp.*
import aws.smithy.kotlin.runtime.InternalApi
import aws.smithy.kotlin.runtime.text.ensureSuffix
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

description = "High-level libraries for the AWS SDK for Kotlin"
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL"
extra["moduleName"] = "aws.sdk.kotlin.hll"

// FIXME 🔽🔽🔽 This is all copied from :aws-runtime and should be commonized 🔽🔽🔽

plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.kotlinx.binary.compatibility.validator)
alias(libs.plugins.aws.kotlin.repo.tools.kmp) apply false
jacoco
}

val sdkVersion: String by project

// capture locally - scope issue with custom KMP plugin
val libraries = libs

val optinAnnotations = listOf(
"aws.smithy.kotlin.runtime.ExperimentalApi",
"aws.smithy.kotlin.runtime.InternalApi",
"aws.sdk.kotlin.runtime.InternalSdkApi",
"kotlin.RequiresOptIn",
)

@OptIn(InternalApi::class)
val hllPreviewVersion = if (sdkVersion.contains("-SNAPSHOT")) { // e.g. 1.3.29-beta-SNAPSHOT
sdkVersion
.removeSuffix("-SNAPSHOT")
.ensureSuffix("-beta-SNAPSHOT")
} else {
sdkVersion.ensureSuffix("-beta") // e.g. 1.3.29-beta
}

subprojects {
group = "aws.sdk.kotlin"
version = hllPreviewVersion
configurePublishing("aws-sdk-kotlin")
}

subprojects {
if (!needsKmpConfigured) {
return@subprojects
}

apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("org.jetbrains.dokka")
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
}

kotlin {
explicitApi()

sourceSets {
// dependencies available for all subprojects

all {
optinAnnotations.forEach(languageSettings::optIn)
}

named("commonTest") {
dependencies {
implementation(libraries.kotest.assertions.core)
}
}

named("jvmTest") {
dependencies {
implementation(libraries.kotest.assertions.core.jvm)
implementation(libraries.slf4j.simple)
}
}
}
}

dependencies {
dokkaPlugin(project(":dokka-aws"))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile> {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}

apiValidation {
val availableSubprojects = subprojects.map { it.name }.toSet()

ignoredProjects += listOf(
"hll-codegen",
"dynamodb-mapper-codegen",
"dynamodb-mapper-ops-codegen",
"dynamodb-mapper-schema-codegen",
"dynamodb-mapper-schema-generator-plugin-test",
).filter { it in availableSubprojects } // Some projects may not be in the build depending on bootstrapping
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbAttribute : java/lang/annotation/Annotation {
public abstract fun name ()Ljava/lang/String;
}

public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbIgnore : java/lang/annotation/Annotation {
}

public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbItem : java/lang/annotation/Annotation {
public abstract fun converterName ()Ljava/lang/String;
}

public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbPartitionKey : java/lang/annotation/Annotation {
}

public abstract interface annotation class aws/sdk/kotlin/hll/dynamodbmapper/DynamoDbSortKey : java/lang/annotation/Annotation {
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

description = "DynamoDbMapper annotations"
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL :: DynamoDbMapper :: Annotations"
extra["moduleName"] = "aws.sdk.kotlin.hll.dynamodbmapper.annotations"
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package aws.sdk.kotlin.hll.dynamodbmapper

/**
* Specifies the attribute name for a property in a [DynamoDbItem]-annotated class/interface. If this annotation is not
* included then the attribute name matches the property name.
*/
@Target(AnnotationTarget.PROPERTY)
public annotation class DynamoDbAttribute(val name: String)

/**
* Specifies that this class/interface describes an item type in a table. All public properties of this type will be mapped to
* attributes unless they are explicitly ignored.
* @param converterName The fully qualified name of the item converter to be used for converting this class/interface.
* If not set, one will be automatically generated.
*/
// FIXME Update to take a KClass<ItemConverter>, which will require splitting codegen modules due to a circular dependency
@Target(AnnotationTarget.CLASS)
public annotation class DynamoDbItem(val converterName: String = "")

/**
* Specifies that this property is the primary key for the item. Every top-level [DynamoDbItem] to be used in a table
* must have exactly one partition key.
*/
@Target(AnnotationTarget.PROPERTY)
public annotation class DynamoDbPartitionKey

/**
* Specifies that this property is the sort key for the item. Every top-level [DynamoDbItem] to be used in a table may
* have at most one sort key.
*/
@Target(AnnotationTarget.PROPERTY)
public annotation class DynamoDbSortKey

/**
* Specifies that this property should be ignored during mapping.
*/
@Target(AnnotationTarget.PROPERTY)
public annotation class DynamoDbIgnore
47 changes: 47 additions & 0 deletions hll/dynamodb-mapper/dynamodb-mapper-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

description = "DynamoDbMapper code generation"
extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL :: DynamoDbMapper :: Codegen"
extra["moduleName"] = "aws.sdk.kotlin.hll.dynamodbmapper.codegen"

plugins {
alias(libs.plugins.kotlin.jvm)
`maven-publish`
}

dependencies {
implementation(project(":hll:hll-codegen"))
}

val optinAnnotations = listOf(
"aws.smithy.kotlin.runtime.InternalApi",
"aws.sdk.kotlin.runtime.InternalSdkApi",
"kotlin.RequiresOptIn",
)

kotlin {
explicitApi()

sourceSets.all {
optinAnnotations.forEach(languageSettings::optIn)
}
}

val sourcesJar by tasks.creating(Jar::class) {
group = "publishing"
description = "Assembles Kotlin sources jar"
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}

publishing {
publications {
create<MavenPublication>("dynamodb-mapper-codegen") {
from(components["java"])
artifact(sourcesJar)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package aws.sdk.kotlin.hll.dynamodbmapper.codegen.model

import aws.sdk.kotlin.runtime.InternalSdkApi

@InternalSdkApi
public object MapperPkg {
@InternalSdkApi
public object Hl {
public val Base: String = "aws.sdk.kotlin.hll.dynamodbmapper"
public val Annotations: String = "$Base.annotations"
public val Internal: String = "$Base.internal"
public val Items: String = "$Base.items"
public val Model: String = "$Base.model"
public val Ops: String = "$Base.operations"
public val PipelineImpl: String = "$Base.pipeline.internal"
public val Values: String = "$Base.values"
public val CollectionValues: String = "$Values.collections"
public val ScalarValues: String = "$Values.scalars"
public val SmithyTypeValues: String = "$Values.smithytypes"

@InternalSdkApi
public object Expressions {
public val Base: String = "${Hl.Base}.expressions"
public val Internal: String = "$Base.internal"
}
}

@InternalSdkApi
public object Ll {
public val Base: String = "aws.sdk.kotlin.services.dynamodb"
public val Model: String = "$Base.model"
}
}
Loading
Loading