Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez committed Dec 15, 2023
2 parents 160afea + 1e99683 commit df9b14b
Show file tree
Hide file tree
Showing 139 changed files with 9,508 additions and 1,477 deletions.
8 changes: 0 additions & 8 deletions .changes/6c4d20f4-2c79-444c-b5e5-d0a1a752d58f.json

This file was deleted.

108 changes: 50 additions & 58 deletions .github/scripts/codegen-diff-revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,45 @@
#
# This script can be run and tested locally. To do so, you should check out
# a second aws-sdk-kotlin repository so that you can work on the script and still
# run it without it immediately bailing for an unclean working tree (and to avoid creating
# temporary branches).
# run it without it immediately bailing for an unclean working tree (and to avoid mutating
# your local repository).
#
# Example:
# `aws-sdk-kotlin/` - the main repo you're working out of
# `aws-sdk-kotlin/` - the main repo you're working out of <path-to-working-dir> below
# `/tmp/aws-sdk-kotlin/` - the repo you're testing against
#
# Generate code using the current HEAD of the repository.

# ```
# $ cd test/aws-sdk-kotlin
# $ ../../aws-sdk-kotlin/.github/scripts/codegen-diff-revisions.py . <some commit hash to diff against>
# $ cd /tmp/aws-sdk-kotlin
# $ <path-to-working-dir>/.github/scripts/codegen-diff-revisions.py codegen --bootstrap +s3,+dynamodb
# ```
#
# It will diff the generated code from HEAD against any commit hash you feed it. If you want to test
# a specific range, change the HEAD of the test repository.
#
# This script requires `diff2html-cli` to be installed from NPM:
# Generate diffs
#
# ```
# $ npm install -g [email protected]
# $ cd /tmp/aws-sdk-kotlin
# HEAD_SHA=$(git rev-parse <my-head-sha>)
# BASE_SHA=$(git rev-parse <my-base-branch>)
# HEAD_BRANCH_NAME="__tmp-localonly-head"
# BASE_BRANCH_NAME="__tmp-localonly-base"
#
# <path-to-working-dir>/.github/scripts/codegen-diff-revisions.py --head-sha $HEAD_SHA generate-diffs --base-sha $BASE_SHA $BASE_BRANCH_NAME $HEAD_BRANCH_NAME
# ```
#
# This script requires `difftags` to be installed from the smithy-rs repository. This requires installing a working
# rust toolchain (cargo, rustc, etc).
# ```
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
# ```
#
# Install difftags from smithy-rs
# ```
# git clone --depth 1 https://github.com/smithy-lang/smithy-rs.git
# cd smithy-rs/tools/ci-build/difftags
# cargo install --path .
# difftags -h
# ```
# Make sure the local version matches the version referenced from the GitHub Actions workflow.

Expand All @@ -33,7 +54,7 @@
import tempfile
import shlex

OUTPUT_PATH = "tmp-codegen-diff/"
OUTPUT_PATH = "tmp-codegen-diff"

COMMIT_AUTHOR_NAME = "GitHub Action (generated codegen diff)"
COMMIT_AUTHOR_EMAIL = "[email protected]"
Expand Down Expand Up @@ -103,40 +124,7 @@ def generate_and_commit_generated_code(sha, services_to_bootstrap):
run(f"git -c 'user.name={COMMIT_AUTHOR_NAME}' -c 'user.email={COMMIT_AUTHOR_EMAIL}' commit --no-verify -m 'Generated code for {sha}' --allow-empty")


# Writes an HTML template for diff2html so that we can add contextual information
def write_html_template(title, subtitle, tmp_file):
tmp_file.writelines(map(lambda line: line.encode(), [
"<!doctype html>",
"<html>",
"<head>",
' <metadata charset="utf-8">',
f' <title>Codegen diff for the {title}: {subtitle}</title>',
' <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/github.min.css" / >',
' <!--diff2html-css-->',
' <!--diff2html-js-ui-->',
' <script>',
' document.addEventListener("DOMContentLoaded", () => {',
' const targetElement = document.getElementById("diff");',
' const diff2htmlUi = new Diff2HtmlUI(targetElement);',
' //diff2html-fileListToggle',
' //diff2html-synchronisedScroll',
' //diff2html-highlightCode',
' });',
' </script>',
"</head>",
'<body style="font-family: sans-serif;">',
f" <h1>Codegen diff for the {title}</h1>",
f" <p>{subtitle}</p>",
' <div id="diff">',
' <!--diff2html-diff-->',
' </div>',
"</body>",
"</html>",
]))
tmp_file.flush()


def make_diff(opts, title, path_to_diff, suffix, ignore_whitespace):
def make_diff(opts, title, path_to_diff, outsubdir, ignore_whitespace):
base_sha = opts.base_sha
head_sha = opts.head_sha
ws_flag = "-b" if ignore_whitespace else ""
Expand All @@ -146,32 +134,36 @@ def make_diff(opts, title, path_to_diff, suffix, ignore_whitespace):
eprint(f"No diff output for {base_sha}..{head_sha}")
return None

run(f'mkdir -p {OUTPUT_PATH}/{base_sha}/{head_sha}')
dest_path = f"{base_sha}/{head_sha}/diff-{suffix}.html"
dest_path = f"{base_sha}/{head_sha}/{outsubdir}"
run(f'mkdir -p {OUTPUT_PATH}/{dest_path}')
whitespace_context = "(ignoring whitespace)" if ignore_whitespace else ""
with tempfile.NamedTemporaryFile() as tmp_file:
write_html_template(title, f"rev. {head_sha} {whitespace_context}", tmp_file)

# Generate HTML diff. This uses the diff2html-cli, which defers to `git diff` under the hood.
# All arguments after the first `--` go to the `git diff` command.
diff_cmd = f"diff2html -s line -f html -d word -i command --hwt " \
f"{tmp_file.name} -F {OUTPUT_PATH}/{dest_path} -- " \
f"-U20 {ws_flag} {opts.base_branch} {opts.head_branch} -- {path_to_diff}"

with tempfile.NamedTemporaryFile(mode='w') as tmp_file:
diff_cmd = f"git diff -U30 {ws_flag} {opts.base_branch} {opts.head_branch} -- {path_to_diff}"
eprint(f"Running diff cmd: {diff_cmd}")
run(diff_cmd)
output = get_cmd_output(diff_cmd)
tmp_file.write(output)

subtitle = f"rev. {base_sha}..{head_sha} {whitespace_context}"
generate_html_cmd = f"difftags --title \"{title}\" --subtitle \"{subtitle}\" --output-dir {OUTPUT_PATH}/{dest_path} {tmp_file.name}"
eprint(f"Running generate html cmd: {generate_html_cmd}")
run(generate_html_cmd)

return dest_path


def diff_link(diff_text, empty_diff_text, diff_location, alternate_text, alternate_location):
if diff_location is None:
return empty_diff_text

return f"[{diff_text}]({CDN_URL}/codegen-diff/{diff_location}) ([{alternate_text}]({CDN_URL}/codegen-diff/{alternate_location}))"
return f"[{diff_text}]({CDN_URL}/codegen-diff/{diff_location}/index.html) ([{alternate_text}]({CDN_URL}/codegen-diff/{alternate_location}/index.html))"


def make_diffs(opts):
sdk_ws = make_diff(opts, 'AWS SDK', f'{OUTPUT_PATH}/services', 'aws-sdk', ignore_whitespace=False)
sdk_no_ws = make_diff(opts, 'AWS SDK', f'{OUTPUT_PATH}/services', 'aws-sdk-ignore-ws', ignore_whitespace=True)
path_to_diff = f"{OUTPUT_PATH}/services"

sdk_ws = make_diff(opts, 'AWS SDK', path_to_diff, "aws-sdk", ignore_whitespace=False)
sdk_no_ws = make_diff(opts, 'AWS SDK', path_to_diff, "aws-sdk-ignore-ws", ignore_whitespace=True)
sdk_links = diff_link('AWS SDK', 'No codegen difference in the AWS SDK', sdk_ws, 'ignoring whitespace', sdk_no_ws)

return f'A new generated diff is ready to view.\\n\\n- {sdk_links}\\n'
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/codegen-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
repository: 'awslabs/smithy-kotlin'
fetch-depth: 0
path: 'smithy-kotlin'
- uses: actions/checkout@v4
with:
repository: 'smithy-lang/smithy-rs'
path: 'smithy-rs'
sparse-checkout: |
tools/ci-build/difftags
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -63,15 +69,18 @@ jobs:
cache: 'gradle'
- name: Install deps and setup environment
run: |
npm install -g diff2html-cli@${{ env.DIFF2HTML_VERSION }}
env | sort
# store off a copy of head ref of ci.py, otherwise base ref generation will use a different version of this script
CODEGEN_DIFF_REVISIONS=${{ runner.temp }}/codegen-diff-revisions.py
cp $GITHUB_WORKSPACE/aws-sdk-kotlin/.github/scripts/codegen-diff-revisions.py $CODEGEN_DIFF_REVISIONS
echo "CODEGEN_DIFF_REVISIONS=$CODEGEN_DIFF_REVISIONS" >> "$GITHUB_ENV"
echo "REPO_TOOLS=$GITHUB_WORKSPACE/aws-kotlin-repo-tools" >> "$GITHUB_ENV"
echo "SMITHY_KOTLIN_DIR=$GITHUB_WORKSPACE/smithy-kotlin" >> "$GITHUB_ENV"
echo "SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin" >> "$GITHUB_ENV"
echo "installing smithy-rs diff tooling"
pushd $GITHUB_WORKSPACE/smithy-rs/tools/ci-build/difftags
cargo install --path .
difftags --version
popd
- name: Generate code for head ref
run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/update-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ jobs:
# This should help prevent the cases where we forgot to bump smithy-kotlin versions and don't catch it
# because CI is masking it
./gradlew -Paws.kotlin.native=false test jvmTest
- name: Release Check - build an SDK client
if: env.MERGED_NEEDED == 'true'
shell: bash
run: |
# Additionally generate and build a service client to confirm that codegen and build works
# without "live at HEAD" mode.
./gradlew -Paws.services=s3 -Paws.kotlin.native=false bootstrap;
./gradlew -Paws.kotlin.native=false build;
- name: Merge
if: env.MERGE_NEEDED == 'true'
shell: bash
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Changelog

## [1.0.17] - 12/14/2023

### Features
* (**appstream**) This release includes support for images of Windows Server 2022 platform.
* (**billingconductor**) Billing Conductor is releasing a new API, GetBillingGroupCostReport, which provides the ability to retrieve/view the Billing Group Cost Report broken down by attributes for a specific billing group.
* (**connect**) This release adds support for more granular billing using tags (key:value pairs)
* (**firehose**) This release, 1) adds configurable buffering hints for the Splunk destination, and 2) reduces the minimum configurable buffering interval for supported destinations
* (**gamelift**) Amazon GameLift adds the ability to add and update the game properties of active game sessions.
* (**iot**) This release adds the ability to self-manage certificate signing in AWS IoT Core fleet provisioning using the new certificate provider resource.
* (**neptunegraph**) This is the initial SDK release for Amazon Neptune Analytics
* (**opensearch**) Updating documentation for Amazon OpenSearch Service support for new zero-ETL integration with Amazon S3.
* (**quicksight**) Update Dashboard Links support; SingleAxisOptions support; Scatterplot Query limit support.

### Documentation
* (**b2bi**) Documentation updates for AWS B2B Data Interchange
* (**controltower**) Documentation updates for AWS Control Tower.
* (**workspaces**) Updated note to ensure customers understand running modes.

## [1.0.16] - 12/13/2023

### Features
* (**drs**) Adding AgentVersion to SourceServer and RecoveryInstance structures

## [1.0.15] - 12/12/2023

### Features
* (**cloudwatchlogs**) This release introduces the StartLiveTail API to tail ingested logs in near real time.
* (**imagebuilder**) This release adds the Image Workflows feature to give more flexibility and control over the image building and testing process.
* (**location**) This release 1) adds sub-municipality field in Places API for searching and getting places information, and 2) allows optimizing route calculation based on expected arrival time.

### Fixes
* [#1008](https://github.com/awslabs/smithy-kotlin/issues/1008) Upgrade to [**smithy-kotlin** 1.0.3](https://github.com/awslabs/smithy-kotlin/releases/tag/v1.0.3) to consume fixes for URL signing special characters

## [1.0.14] - 12/11/2023

### Features
Expand Down
6 changes: 3 additions & 3 deletions aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ codegen {
transforms = listOf(
"""
{
"name": "awsSdkKotlinIncludeOperations",
"name": "awsSmithyKotlinIncludeOperations",
"args": {
"operations": [
"com.amazonaws.sts#AssumeRole",
Expand Down Expand Up @@ -138,7 +138,7 @@ codegen {
transforms = listOf(
"""
{
"name": "awsSdkKotlinIncludeOperations",
"name": "awsSmithyKotlinIncludeOperations",
"args": {
"operations": [
"com.amazonaws.sso#GetRoleCredentials"
Expand Down Expand Up @@ -173,7 +173,7 @@ codegen {
transforms = listOf(
"""
{
"name": "awsSdkKotlinIncludeOperations",
"name": "awsSmithyKotlinIncludeOperations",
"args": {
"operations": [
"com.amazonaws.ssooidc#CreateToken"
Expand Down
3 changes: 0 additions & 3 deletions aws-runtime/aws-core/api/aws-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class aws/sdk/kotlin/runtime/ConfigurationException : aws/sdk/kotlin/runt
public fun <init> (Ljava/lang/Throwable;)V
}

public final class aws/sdk/kotlin/runtime/FlowUtilKt {
}

public abstract interface annotation class aws/sdk/kotlin/runtime/InternalSdkApi : java/lang/annotation/Annotation {
}

Expand Down
15 changes: 0 additions & 15 deletions aws-runtime/aws-core/common/src/aws/sdk/kotlin/runtime/FlowUtil.kt

This file was deleted.

This file was deleted.

Loading

0 comments on commit df9b14b

Please sign in to comment.