Skip to content

Conversation

@lauzadis
Copy link
Member

@lauzadis lauzadis commented Sep 26, 2024

This PR sets up DynamoDBMapper and other related libraries for publication. It also removes the dynamodb-mapper-annotation-processor-test module since it's now duplicated by SchemaGeneratorPluginTest

Issue #

Description of changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@lauzadis lauzadis changed the title Feat ddb publish feat: setup DynamoDbMapper publication Oct 1, 2024
@lauzadis lauzadis marked this pull request as ready for review October 1, 2024 21:01
@lauzadis lauzadis requested a review from a team as a code owner October 1, 2024 21:01
@github-actions
Copy link

github-actions bot commented Oct 1, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

Comment on lines 36 to 43
@OptIn(InternalApi::class)
fun getHllPreviewVersion() = if (sdkVersion.contains("-SNAPSHOT")) { // i.e. 1.3.29-beta-SNAPSHOT
sdkVersion
.removeSuffix("-SNAPSHOT")
.ensureSuffix("-beta-SNAPSHOT")
} else {
sdkVersion.ensureSuffix("-beta") // i.e. 1.3.29-beta
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "i.e." → "e.g."

Comment on lines 36 to 43
@OptIn(InternalApi::class)
fun getHllPreviewVersion() = if (sdkVersion.contains("-SNAPSHOT")) { // i.e. 1.3.29-beta-SNAPSHOT
sdkVersion
.removeSuffix("-SNAPSHOT")
.ensureSuffix("-beta-SNAPSHOT")
} else {
sdkVersion.ensureSuffix("-beta") // i.e. 1.3.29-beta
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Any reason not to make this a val instead of a fun?

Comment on lines -40 to -43
val sdkVersion: String by project
group = "aws.sdk.kotlin"
version = sdkVersion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: What version will hll-codegen use now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK so we'll just re-add version = sdkVersion when it comes time to GA the mapper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and it's set up so we just have to change it in that one spot

Comment on lines +1 to +2
import aws.smithy.kotlin.runtime.InternalApi
import aws.smithy.kotlin.runtime.text.ensureSuffix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: How are these imports resolvable by the build script? Do we have the SDK/Smithy runtime in the classpath at this point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why it works like this, but we do have a dependency on smithy-kotlin:runtime-core in this module, and the imports to resolve

Comment on lines 45 to 54
subprojects {
group = "aws.sdk.kotlin"
version = getHllPreviewVersion()
configurePublishing("aws-sdk-kotlin")
}

subprojects {
if (!needsKmpConfigured) {
return@subprojects
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why was group, version, and configurePublishing refactored into a second subprojects block?

Copy link
Member Author

@lauzadis lauzadis Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All subprojects should have those values configured, they are not KMP-specific which is what the pre-existing block is for

Comment on lines 90 to 101
// FIXME Commonize the following functions into the aws-kotlin-repo-tools build-support
val sdkVersion: String by project

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: When commonizing this function I'm assuming we'll also commonize the other declaration of getHllPreviewVersion()?

Nit: If so can we add a // FIXME or a // TODO to the other instance to remind us

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't think this function will last long enough, it should be removed once we GA the DynamoDbMapper

Comment on lines +63 to +72
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.named("javadocJar"))
}

tasks.named("publishDynamodb-mapper-schema-generatorPluginMarkerMavenPublicationToMavenLocal") {
dependsOn(tasks.named("javadocJar"))
}

tasks.findByName("signDynamodb-mapper-schema-generatorPluginMarkerMavenPublication")
?.dependsOn(tasks.named("javadocJar"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Refactor tasks.named("javadocJar") into a val

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2024

@github-actions
Copy link

github-actions bot commented Oct 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@lauzadis lauzadis merged commit 997a9f6 into feat-ddb-mapper Oct 3, 2024
11 checks passed
@lauzadis lauzadis deleted the feat-ddb-publish branch October 3, 2024 15:23
ianbotsf added a commit that referenced this pull request Oct 29, 2024
…lin (#1451)

* initial poc commit of DynamoDB Mapper (#1232)

* add support for Mapper initialization (#1237)

* implement mapper pipeline (#1266)

* initial implementation of codegen for low-level operations/types (#1357)

* initial implementation of secondary index support (#1375)

* Create new codegen module and refactor annotation processor to use it (#1382)

* feat: add Schema generator Gradle plugin (#1385)

* Fix plugin test package

* add attribute converters for "standard" values (#1381)

* fix: schema generator plugin test module (#1394)

* feat: annotation processor codegen configuration (#1392)

* feat: add `@DynamoDbIgnore` annotation (#1402)

* DDB Mapper filter expressions (runtime components) (#1401)

* feat: basic annotation processing (#1399)

* add DSL overloads, paginators, and better builder integration for DDB Mapper ops codegen (#1409)

* chore: split dynamodb-mapper-codegen into two modules (#1414)

* emit DDB_MAPPER business metric (#1426)

* feat: setup DynamoDbMapper publication (#1419)

* DDB Mapper filter expressions (codegen components) (#1424)

* correct docs

* mark every HLL/DDBM API experimental (#1428)

* fix accidental inclusion of expression attribute members in high-level DynamoDB Mapper requests (#1432)

* Upgrade to latest build plugin version

* fix: various issues found during testing (#1450)

* chore: update Athena changelog notes for 1.3.57 (2024-10-18) release (#1449)

* feat: update AWS API models

* feat: update AWS service endpoints metadata

* chore: release 1.3.60

* chore: bump snapshot version to 1.3.61-SNAPSHOT

* feat: initial release of Developer Preview of DynamoDB Mapper for Kotlin

* Fix Kotlin gradle-plugin version

* fix: ddb mapper tests (#1453)

* Bump build plugin version

---------

Co-authored-by: Matas <[email protected]>
Co-authored-by: aws-sdk-kotlin-ci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants