Skip to content

Commit 4f7da01

Browse files
authored
kn: merge from main (#1565)
1 parent 8f3f9c7 commit 4f7da01

File tree

92 files changed

+29908
-9661
lines changed

Some content is hidden

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

92 files changed

+29908
-9661
lines changed

.github/workflows/codebuild-ci.yml

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -142,56 +142,9 @@ jobs:
142142
./gradlew collectDelegatedArtifactSizeMetrics -PpullRequest=$PULL_REQUEST
143143
- name: Analyze Artifact Size Metrics
144144
run: ./gradlew analyzeArtifactSizeMetrics
145-
- name: Show Results
146-
uses: actions/github-script@v7
147-
with:
148-
script: |
149-
const getComments =
150-
`query {
151-
repository(owner:"${context.repo.owner}", name:"${context.repo.repo}"){
152-
pullRequest(number: ${context.issue.number ?? process.env.SDK_PR}) {
153-
id
154-
comments(last:100) {
155-
nodes {
156-
id
157-
body
158-
author {
159-
login
160-
}
161-
isMinimized
162-
}
163-
}
164-
}
165-
}
166-
}`
167-
168-
const response = await github.graphql(getComments)
169-
const comments = response.repository.pullRequest.comments.nodes
170-
171-
const mutations = comments
172-
.filter(comment => comment.author.login == 'github-actions' && !comment.isMinimized && comment.body.startsWith('Affected Artifacts'))
173-
.map(comment =>
174-
github.graphql(
175-
`mutation {
176-
minimizeComment(input:{subjectId:"${comment.id}", classifier:OUTDATED}){
177-
clientMutationId
178-
}
179-
}`
180-
)
181-
)
182-
await Promise.all(mutations)
183145

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

196149
- name: Evaluate Result
197150
if: ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}

.github/workflows/merge-main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Merge main
22
on:
3-
schedule:
4-
- cron: "0 7 * * 1-5" # At 07:00 UTC (00:00 PST, 03:00 EST), Monday through Friday
3+
push:
4+
branches: [ main ]
55
workflow_dispatch:
66

77
jobs:
8-
test:
8+
merge:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Merge main

.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: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
jobs:
9+
update-canary:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Configure AWS Credentials
13+
uses: aws-actions/configure-aws-credentials@v4
14+
with:
15+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
16+
aws-region: us-west-2
17+
18+
19+
- name: Verify artifact is available on Maven
20+
shell: bash
21+
# Maven can take up to 2 hours after the release has succeeded to publish our artifacts
22+
# FIXME Track execution duration over time and see if this can be shortened
23+
timeout-minutes: 120
24+
run: |
25+
TAG="${{ github.event.release.tag_name }}"
26+
VERSION="${TAG#v}"
27+
MAVEN_URL="https://repo.maven.apache.org/maven2/aws/sdk/kotlin/s3/${VERSION}/"
28+
29+
echo "Checking for an artifact at $MAVEN_URL"
30+
31+
while true; do
32+
STATUS=$(curl -i -s -o /dev/null -w "%{http_code}" "$MAVEN_URL")
33+
echo "Status: $STATUS"
34+
35+
if [[ "$STATUS" == "200" ]]; then
36+
echo "Artifact is available at $MAVEN_URL"
37+
exit 0
38+
fi
39+
40+
sleep 30
41+
done
42+
43+
- name: Update canary
44+
shell: bash
45+
timeout-minutes: 15
46+
run: |
47+
set -euo pipefail
48+
49+
TAG="${{ github.event.release.tag_name }}"
50+
EXECUTION_NAME="update-canary-${TAG}"
51+
STATE_MACHINE_ARN="arn:aws:states:us-west-2:${{ secrets.CI_USER }}:stateMachine:DeployLatestSdkVersion"
52+
53+
echo "Starting step function: $EXECUTION_NAME"
54+
EXECUTION_ARN=$(aws stepfunctions start-execution \
55+
--state-machine-arn "$STATE_MACHINE_ARN" \
56+
--name "$EXECUTION_NAME" \
57+
--input '{}' \
58+
--query 'executionArn' \
59+
--output text)
60+
61+
echo "Waiting for step function to complete..."
62+
63+
while true; do
64+
STATUS=$(aws stepfunctions describe-execution --execution-arn "$EXECUTION_ARN" --query 'status' --output text)
65+
echo "Status: $STATUS"
66+
67+
if [[ "$STATUS" == "SUCCEEDED" ]]; then
68+
echo "Step Function completed successfully"
69+
exit 0
70+
elif [[ "$STATUS" == "FAILED" || "$STATUS" == "TIMED_OUT" || "$STATUS" == "ABORTED" ]]; then
71+
echo "Step Function failed with status: $STATUS"
72+
exit 1
73+
fi
74+
75+
sleep 10
76+
done

0 commit comments

Comments
 (0)