Skip to content

Commit 4d258d5

Browse files
committed
Merge branch 'main' of github.com:awslabs/aws-sdk-kotlin into try-dokka-2
2 parents 9705cf4 + fef1272 commit 4d258d5

File tree

281 files changed

+117579
-47306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+117579
-47306
lines changed

.brazil-1.x.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"dependencies": {
3+
"org.jetbrains.kotlin:kotlin-gradle-plugin:2.*": "KotlinGradlePlugin-2.x",
4+
"org.jetbrains.kotlin:kotlin-stdlib-common:2.*.*": "KotlinStdlibCommon-2.x",
5+
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.*.*": "KotlinStdlibJdk8-2.x",
6+
"org.jetbrains.kotlin:kotlin-stdlib:2.*.*": "KotlinStdlib-2.x",
7+
"org.jetbrains.kotlinx:atomicfu:0.*.*": "Atomicfu-0.x",
8+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x",
9+
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": "KotlinxCoroutinesJdk8-1.x",
10+
"com.google.devtools.ksp:symbol-processing-api:2.*": "Maven-com-google-devtools-ksp_symbol-processing-api-2.x",
11+
"com.google.devtools.ksp:symbol-processing-gradle-plugin:2.*": "Maven-com-google-devtools-ksp_symbol-processing-gradle-plugin-2.x"
12+
},
13+
"packageHandlingRules": {
14+
"versioning": {
15+
"defaultVersionLayout": "{MAJOR}.x"
16+
},
17+
"ignore": [
18+
"aws.sdk.kotlin:bom",
19+
"aws.sdk.kotlin:testing",
20+
"aws.sdk.kotlin:version-catalog"
21+
],
22+
"resolvesConflictDependencies": {
23+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*" : ["KotlinxCoroutinesCoreJvm-1.x"],
24+
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.*": ["KotlinxCoroutinesJdk8-1.x"],
25+
"aws.smithy.kotlin:aws-event-stream:1.*": ["KotlinxCoroutinesCoreJvm-1.x"]
26+
}
27+
}
28+
}

.github/scripts/run-codebuild-batch-job.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ START_RESULT=$(
9494
aws codebuild start-build-batch \
9595
--project-name ${PROJECT_NAME} \
9696
--source-version $SOURCE_VERSION \
97-
--environment-variables-override file:///tmp/gh_env_vars.json
97+
--environment-variables-override file:///tmp/gh_env_vars.json \
98+
--source-location-override "https://github.com/awslabs/$GITHUB_REPOSITORY_NO_ORG.git"
9899
)
99100

100101
if [ "$?" != "0" ]; then

.github/workflows/codebuild-ci.yml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
with:
8686
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
8787
aws-region: us-west-2
88+
- name: Configure Gradle
89+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
8890
- name: Run Service Check Batch and Calculate Artifact Size Metrics
8991
id: svc-check-batch
9092
run: |
@@ -140,56 +142,9 @@ jobs:
140142
./gradlew collectDelegatedArtifactSizeMetrics -PpullRequest=$PULL_REQUEST
141143
- name: Analyze Artifact Size Metrics
142144
run: ./gradlew analyzeArtifactSizeMetrics
143-
- name: Show Results
144-
uses: actions/github-script@v7
145-
with:
146-
script: |
147-
const getComments =
148-
`query {
149-
repository(owner:"${context.repo.owner}", name:"${context.repo.repo}"){
150-
pullRequest(number: ${context.issue.number ?? process.env.SDK_PR}) {
151-
id
152-
comments(last:100) {
153-
nodes {
154-
id
155-
body
156-
author {
157-
login
158-
}
159-
isMinimized
160-
}
161-
}
162-
}
163-
}
164-
}`
165-
166-
const response = await github.graphql(getComments)
167-
const comments = response.repository.pullRequest.comments.nodes
168-
169-
const mutations = comments
170-
.filter(comment => comment.author.login == 'github-actions' && !comment.isMinimized && comment.body.startsWith('Affected Artifacts'))
171-
.map(comment =>
172-
github.graphql(
173-
`mutation {
174-
minimizeComment(input:{subjectId:"${comment.id}", classifier:OUTDATED}){
175-
clientMutationId
176-
}
177-
}`
178-
)
179-
)
180-
await Promise.all(mutations)
181145

182-
const fs = require('node:fs')
183-
const comment = fs.readFileSync('build/reports/metrics/artifact-analysis.md', 'utf8')
184-
185-
const writeComment =
186-
`mutation {
187-
addComment(input:{body:"""${comment}""", subjectId:"${response.repository.pullRequest.id}"}){
188-
clientMutationId
189-
}
190-
}`
191-
192-
await github.graphql(writeComment)
146+
- name: Show Results
147+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/show-results@main
193148

194149
- name: Evaluate Result
195150
if: ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}
@@ -212,6 +167,8 @@ jobs:
212167
with:
213168
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
214169
aws-region: us-west-2
170+
- name: Configure Gradle
171+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
215172
- name: Calculate Artifact Size Metrics
216173
id: svc-check-batch
217174
run: |

.github/workflows/continuous-integration.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
path: 'aws-sdk-kotlin'
3434
- name: Setup Build
3535
uses: ./aws-sdk-kotlin/.github/actions/setup-build
36+
- name: Configure Gradle
37+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
38+
with:
39+
working-directory: ./aws-sdk-kotlin
3640
- name: Test
3741
working-directory: ./aws-sdk-kotlin
3842
shell: bash
@@ -60,6 +64,10 @@ jobs:
6064
path: 'aws-sdk-kotlin'
6165
- name: Setup Build
6266
uses: ./aws-sdk-kotlin/.github/actions/setup-build
67+
- name: Configure Gradle - smithy-kotlin
68+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
69+
with:
70+
working-directory: ./smithy-kotlin
6371
- name: Build smithy-kotlin
6472
working-directory: ./smithy-kotlin
6573
shell: bash
@@ -68,6 +76,10 @@ jobs:
6876
pwd
6977
./gradlew --parallel assemble
7078
./gradlew publishToMavenLocal
79+
- name: Configure Gradle aws-sdk-kotlin
80+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
81+
with:
82+
working-directory: ./aws-sdk-kotlin
7183
- name: Test
7284
working-directory: ./aws-sdk-kotlin
7385
shell: bash

.github/workflows/kat-transform.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
3939
aws-region: us-west-2
4040

41+
- name: Configure Gradle
42+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
43+
with:
44+
working-directory: ./aws-sdk-kotlin
45+
4146
- name: Setup kat
4247
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main
4348

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout sources
2323
uses: actions/checkout@v4
24+
- name: Configure Gradle
25+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
2426
- name: Lint ${{ env.PACKAGE_NAME }}
2527
run: |
2628
./gradlew ktlint

.github/workflows/merge-main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Merge main
2+
on:
3+
push:
4+
branches: [ main ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
merge:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Merge main
12+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/merge-main@main
13+
with:
14+
ci-user-pat: ${{ secrets.CI_USER_PAT }}
15+
exempt-branches: # Add any if required
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release readiness (snapshot dependency)
2+
description: >
3+
Makes sure that we aren't relying on SNAPSHOT/dev versions of smithy-kotlin before merging
4+
otherwise we could forget because the rest of CI is masking it.
5+
6+
on:
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
release-readiness:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout SDK
15+
uses: actions/checkout@v4
16+
with:
17+
path: 'aws-sdk-kotlin'
18+
19+
- name: Configure Gradle
20+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
21+
with:
22+
working-directory: ./aws-sdk-kotlin
23+
24+
- name: Build SDK
25+
working-directory: ./aws-sdk-kotlin
26+
run: ./gradlew test jvmTest
27+
28+
- name: Build SDK client
29+
working-directory: ./aws-sdk-kotlin
30+
run: |
31+
./gradlew -Paws.kotlin.native=false -Paws.services=s3 bootstrap
32+
./gradlew -Paws.kotlin.native=false build
33+
34+
- name: Checkout smithy-kotlin
35+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/checkout-head@main
36+
with:
37+
path: 'smithy-kotlin'
38+
repository: 'smithy-lang/smithy-kotlin'
39+
40+
- name: Check for smithy-kotlin unreleased changes
41+
run: |
42+
echo "aws-sdk-kotlin branch: $GITHUB_HEAD_REF"
43+
44+
cd smithy-kotlin
45+
SMITHY_KOTLIN_BRANCH=$(git branch --show-current)
46+
echo "smithy-kotlin branch: $SMITHY_KOTLIN_BRANCH"
47+
48+
if [ "$GITHUB_HEAD_REF" == "$SMITHY_KOTLIN_BRANCH" ]; then
49+
cd ../aws-sdk-kotlin
50+
git fetch origin
51+
52+
DIFF=$(git diff origin/main -- gradle/libs.versions.toml | grep '^[-+][^-+]'; exit 0)
53+
SMITHY_KOTLIN_VERSION_BUMP=$(echo "$DIFF" | grep "smithy-kotlin-runtime-version =\|smithy-kotlin-codegen-version ="; exit 0)
54+
55+
if [ -z "$SMITHY_KOTLIN_VERSION_BUMP" ]; then
56+
echo "::error::Matching smithy-kotlin and aws-sdk-kotlin branches but no smithy-kotlin version bump"
57+
exit 1
58+
else
59+
echo "Matching smithy-kotlin and aws-sdk-kotlin branches with smithy-kotlin version bump detected"
60+
fi
61+
fi
62+
63+
- name: Emit error message
64+
if: ${{ failure() }}
65+
run: |
66+
echo "::error::Did you forget to release smithy-kotlin and bump the dependency version?"
67+
exit 1

.github/workflows/sync-mirror.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Sync Mirror
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
git-sync:
10+
# Only sync when pushing to source repo
11+
if: github.repository == 'awslabs/aws-sdk-kotlin'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: git-sync
15+
uses: wei/git-sync@v3
16+
with:
17+
source_repo: "https://aws-sdk-kotlin-ci:${{ secrets.CI_USER_PAT }}@github.com/awslabs/aws-sdk-kotlin.git"
18+
source_branch: "main"
19+
destination_repo: "https://aws-sdk-kotlin-ci:${{ secrets.CI_USER_PAT }}@github.com/awslabs/private-aws-sdk-kotlin-staging.git"
20+
destination_branch: "main"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# After every GitHub release, verify that the Maven artifacts are available, then kick off
2+
# a canary deployment with the latest version of the SDK.
3+
name: Update Canary
4+
on:
5+
release:
6+
types: [ published ]
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
update-canary:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Configure AWS Credentials
17+
uses: aws-actions/configure-aws-credentials@v4
18+
with:
19+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
20+
aws-region: us-west-2
21+
22+
23+
- name: Verify artifact is available on Maven
24+
shell: bash
25+
# Maven can take up to 2 hours after the release has succeeded to publish our artifacts
26+
# FIXME Track execution duration over time and see if this can be shortened
27+
timeout-minutes: 120
28+
run: |
29+
TAG="${{ github.event.release.tag_name }}"
30+
VERSION="${TAG#v}"
31+
MAVEN_URL="https://repo.maven.apache.org/maven2/aws/sdk/kotlin/s3/${VERSION}/"
32+
33+
echo "Checking for an artifact at $MAVEN_URL"
34+
35+
while true; do
36+
STATUS=$(curl -i -s -o /dev/null -w "%{http_code}" "$MAVEN_URL")
37+
echo "Status: $STATUS"
38+
39+
if [[ "$STATUS" == "200" ]]; then
40+
echo "Artifact is available at $MAVEN_URL"
41+
exit 0
42+
fi
43+
44+
sleep 30
45+
done
46+
47+
- name: Update canary
48+
shell: bash
49+
timeout-minutes: 15
50+
run: |
51+
set -euo pipefail
52+
53+
TAG="${{ github.event.release.tag_name }}"
54+
EXECUTION_NAME="update-canary-${TAG}"
55+
STATE_MACHINE_ARN="arn:aws:states:us-west-2:${{ secrets.CI_USER }}:stateMachine:DeployLatestSdkVersion"
56+
57+
echo "Starting step function: $EXECUTION_NAME"
58+
EXECUTION_ARN=$(aws stepfunctions start-execution \
59+
--state-machine-arn "$STATE_MACHINE_ARN" \
60+
--name "$EXECUTION_NAME" \
61+
--input '{}' \
62+
--query 'executionArn' \
63+
--output text)
64+
65+
echo "Waiting for step function to complete..."
66+
67+
while true; do
68+
STATUS=$(aws stepfunctions describe-execution --execution-arn "$EXECUTION_ARN" --query 'status' --output text)
69+
echo "Status: $STATUS"
70+
71+
if [[ "$STATUS" == "SUCCEEDED" ]]; then
72+
echo "Step Function completed successfully"
73+
exit 0
74+
elif [[ "$STATUS" == "FAILED" || "$STATUS" == "TIMED_OUT" || "$STATUS" == "ABORTED" ]]; then
75+
echo "Step Function failed with status: $STATUS"
76+
exit 1
77+
fi
78+
79+
sleep 10
80+
done

0 commit comments

Comments
 (0)