Commit Graph

241 Commits

Author SHA1 Message Date
Fahad Zubair 6ec8db1786
Add -L to the curl command to download openssl-1.0.2 (#3846)
The GitHub workflow for `exotic platform` downloads the `openssl.sh`
script, which tries to download
`https://www.openssl.org/source/openssl-1.0.2t.tar.gz`, but the file has
been permanently moved. This PR updates the `curl` command to include
the `-L` option.

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2024-09-25 05:51:29 +00:00
ysaito1001 064fbd79a0
Update lockfiles (#3821)
## Description
This PR updates lockfiles by running:
```
./gradlew aws:sdk:generateAllLockfiles -Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust
```
However, due to [the minicbor
issue](https://github.com/smithy-lang/smithy-rs/pull/3818), we still pin
it to 0.24.2 by running the following on `rust-runtime/Cargo.lock` and
`aws/sdk/Cargo.lock`:
```
RUSTFLAGS="--cfg aws_sdk_unstable" cargo update -p minicbor --precise 0.24.2
```

The rest of the changes handle miscellaneous scenarios:
- **Updated nightly version**: Upgraded to `nightly-2024-03-15` to
address a [compatibility
issue](https://github.com/serde-rs/serde/issues/2770) introduced by the
updated serde library.
- **Cleaned up use statements**: Removed redundant use statements, which
were flagged as warnings by the new nightly version.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-06 17:57:59 +00:00
ysaito1001 bd18a9154f
Pin `minicbor` to 0.24.2 (#3818)
**Will merge to the release branch**

## Motivation and Context
Fixes a failure observed in our release pipeline

## Description
A lockfile located at `aws/sdk/Cargo.lock` did not include the
`minicbor` crate that was introduced as part of RPC V2 CBOR. This has
caused a build failure in our release pipeline due to a new version of
`minicbor` 0.24.3 uploaded to crates.io.
```
error: unsupported output in build script of `minicbor v0.24.3`: `cargo::rustc-check-cfg=cfg(atomic64, atomic32)`
```

To address this issue, this PR pins `minicbor` to 0.24.2 in
`aws/sdk/Cargo.lock` (`rust-runtime/Cargo.lock` already pins it to
0.24.2)

The change in `aws/sdk/Cargo.lock` was obtained by
1. running `git pull` in `/Users/awsaito/src/aws-sdk-rust`
2. running `./gradlew aws:sdk:generateAllLockfiles
-Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust`
3. retaining the portion only relevant to `minicbor`

In addition, since the release of aws-sdk-rust the other day, smoke
tests have started getting rendered and compiled in cargo-semver-checks.
This has caused cargo-semver-checks to exceed the previous timeout of 20
minutes. To address it, we have increased the timeout to 30 minutes.

## Testing
- [ ] Tests in CI
- [x] End-to-end tests in our release pipeline

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-03 15:21:39 -05:00
ysaito1001 740edcc6f6
Upgrade MSRV to 1.78.0 (#3800)
## Motivation and Context
Upgrades MSRV to 1.78.0 since the [latest
Rust](https://www.rust-lang.org/) at the time of writing is 1.80.1 (we
try keeping [two releases
behind](https://github.com/awslabs/aws-sdk-rust?tab=readme-ov-file#supported-rust-versions-msrv)).

## Description
In Rust 1.78.0, `clippy` enforces stricter checks in two areas:
- `dead_code`
It seems to be able to uncover more unused code patterns, especially
when different combinations of cargo features are enabled
- `empty_docs`
Prior to 1.78.0, the codegen used to render the following empty docs
`///`, regardless whether the codegen is for the server or for the
client. This is now flagged as `empty_docs` by `clippy`:
```
///
pub(crate) mod XXX {
    ...
}
```

Other than bumping MSRV to 1.78.0, the remaining code changes address
issues related to the fixes mentioned above.

**EDIT:**
`cargo-semver-checks` required an upgrade due to incompatibility issues
following the MSRV upgrade ([example
error](https://github.com/smithy-lang/smithy-rs/actions/runs/10534205294/job/29261105195#step:4:2068)).
Specifically, after updating the MSRV to 1.78.0, the rustdoc version was
upgraded to v28. However, the version of `cargo-semver-checks` we were
using (0.24.1) only supported rustdoc [up to
v27](4bce03d4a6/Cargo.toml (L18)).

To resolve this, we have updated `cargo-semver-checks` to the first
version that supports rustdoc
[v28](94a491f085/Cargo.toml (L18)).

## Testing
Existing tests in CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [x] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-08-27 15:30:40 +00:00
David Tolnay 1ee932f7a2
Destroy history of github-pages branch (#3783)
## Motivation and Context

Keeping the history of `github-pages` is not useful, and it hogs the
output of `git log --graph --all` and other such views of the repository
history. In the event that someone would need to look at old contents of
the website, it can be regenerated using `mdbook` from any commit on
`main`.

<img
src="https://github.com/user-attachments/assets/f37630fa-92ef-4e49-a9e5-a1357a785e46"
width="550">

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-08-07 02:49:18 +00:00
ysaito1001 10a92052b1
Switch to file-per-change changelog (#3774)
## Motivation and Context
Implements [RFC: File-per-change
changelog](https://smithy-lang.github.io/smithy-rs/design/rfcs/rfc0042_file_per_change_changelog.html#rfc-file-per-change-changelog)

## Description
When this PR is merged to `main`, it will impact developer workflow for
creating a changelog entry that goes with a PR.
Prior to this, one edited `CHANGELOG.next.toml` to enter a changelog
entry, but it often caused merge conflicts among us. With this PR, one
creates a `.md` file (any filename stem will do) under the
`smithy-rs/.changelog` directory. This Markdown file has the YAML front
matter, and it can be created manually or via the `ChangeLogger` CLI
(see [this
commit](83cda76608)
for more details).

Here are the highlights of the code changes:
- [The release
script](https://github.com/smithy-lang/smithy-rs/pull/3774/files#diff-162dc2b82eb3d72b105291d2fc5fc8d10c4fbc1e6f35862bc08ac0d6a7c53f76)
has been pointed to `smithy-rs/.changelog`. This is pretty much what it
takes to let the `smithy-rs` release infra switch to the new changelog
mode.
-
[sdk-lints](efcc772b37)
now disallows `CHANGELOG.next.toml`. It will complain if the file is
present.
- The `--source-to-truncate` option for the `changelogger`'s `render` is
now optional because our internal release infra code no longer needs to
specify that option (i.e. there is nothing to truncate there).
- Tests in `smithy-rs-tool-common` and `changelogger` have been updated
so TOML changelog entries used in tests have been re-written to Markdown
changelog entries. We want to avoid giving the false impression that
TOML changelog entries are still well-supported.

## Testing
- Existing tests & lints in CI
- Ran `smithy-rs` [dry-run
release](https://github.com/smithy-lang/smithy-rs/actions/runs/10100442953)
and confirmed the correctness of `CHANGELOG.md` and
`SDK_CHANGELOG.next.json` in the release artifacts
- Ran the internal release and confirmed `CHANGELOG.md` was rendered
correctly in `aws-sdk-rust`

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-08-01 04:31:19 +00:00
iamjpotts ab74d87646
chore(ci): Only dry run a release, and only publish github pages, when ci workflow is triggered from main smithy-rs repository (#3663)
Similar to https://github.com/smithy-lang/smithy-rs/pull/3597.

Only run these two workflows when they are triggered from the
`smithy-lang/smithy-rs` repository, not from any fork.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

The scheduled dry run fails daily in forks, failing each time,
triggering alerts to the owner of the fork repository.

The github pages publishing workflow does not run regularly in forks,
but does run when a fork is synced. It would be undesirable for an
arbitrary fork to publish.

## Description
<!--- Describe your changes in detail -->

On each of the two github workflows, add an `if` condition testing the
repository owner and name. Only run if it matches the official
repository, and is not a fork.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
n/a

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

n/a in both cases
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-05-24 16:51:47 +00:00
Landon James 68704b1062 Bumping MSRV to 1.76.0 2024-05-20 11:58:10 -07:00
ysaito1001 9d2b0dd186
Fix "refusing to merge unrelated histories" (#3626)
## Motivation and Context
Fixes the last [failed backport workflow
run](https://github.com/smithy-lang/smithy-rs/actions/runs/8971718857/job/24638066793)

## Description
The error `refusing to merge unrelated histories` was caused by the same
reason described in prior PRs (#3479, #3480). We need to tell git
unshallow histories so that it knows they are actually related.

## Testing
Ran the failed workflow from this branch and successfully generated a
backport PR3625.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-05-06 17:09:40 +00:00
John DiSanti 83752727c2
Allow manual invocation of verify TLS CI step (#3602)
The verify TLS CI step is flaky at the moment, so it would be helpful to
be able to run it manually against main to see if it was the PR that
broke it, or if it is its general flakiness.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-26 00:50:15 +00:00
John DiSanti 386ec3f1f7
Add MSRV to generated SDK Cargo.toml files (#3601)
This PR sets the `rust-version` property on generated Cargo.toml files
for the AWS SDK crates. It doesn't attempt to place the property on the
runtime crates for now since that will either require manual updating,
or more machinery to automate.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-25 16:03:34 -07:00
iamjpotts c71787499b
CI: Only allow daily credentials verification to run on smithy-lang/ repo (#3597)
## Motivation and Context

The CI job that checks CI credentials fails when run on forks, resulting
in daily job failure alerts in forks.

Example failure:
https://github.com/iamjpotts/aws-smithy-rs/actions/runs/8768654532

See https://github.com/smithy-lang/smithy-rs/issues/3519.

## Description

For the `Daily Credentials Verification` workflow, add a condition on
each of its jobs so that they will only run for the
`smithy-lang/smithy-rs` repo and not any forks.


## Testing

No code changes.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

CI only; no change log entry required.

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-04-22 16:18:12 +00:00
John DiSanti 13c04dafcf
Revert cargo-semver-checks version due to performance regression (#3594)
It seems upgrading cargo-semver-checks to 0.30 made it take
significantly longer than before (going from less than 20 minutes up to
between 1-4 hours). Reverting it back to 0.24.1 for now to keep CI
faster.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-19 19:40:24 +00:00
ysaito1001 1f5cb697d1
Update JDK to 17 (#3592)
## Motivation and Context
Upgrade JDK to 17 in the repository

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-19 15:09:21 +00:00
John DiSanti 1009efebf5
Add timeouts to CI jobs (#3586)
This PR adds reasonable timeouts to each CI job so that a PR isn't held
up for six hours by a hung runner.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-15 23:24:24 +00:00
John DiSanti b1cbce65a5
Upgrade MSRV to 1.75 (#3553)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-11 23:20:06 +00:00
ysaito1001 2865a3fe5f
Remove a dead step from release workflow (#3580)
## Motivation and Context
A step `trim-changelog-next-on-main` has been
[skipped](https://github.com/smithy-lang/smithy-rs/actions/workflows/release.yml?query=actor%3Aaws-sdk-rust-ci)
probably since a release branch `smithy-rs-release-1.x.y` was created.

## Description
We no longer directly remove released entries from CHANGELOG.next.toml
on `main`. We do so by backport PRs to merge `smithy-rs-release-1.x.y`
to `main`. So `open-backport-pull-request` now depends on `release`,
instead of `trim-changelog-next-on-main`.

## Testing
`open-backport-pull-request` depending on `release` can only be "tested"
in prod runs, so we'll see what happens in the next release. If
`open-backport-pull-request` fails, we will manually run it and address
whatever issue that comes up.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-11 19:07:52 +00:00
John DiSanti 129b85d318
Fix canary execution during prod release (#3575)
The new canary secrets weren't being propagated from the root prod
release workflow into the CI workflow, so the canary was failing. This
PR propagates those secrets, and also makes it possible to run the full
CI workflow in a dry-run release so that it's possible to test in the
future.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-11 02:23:21 +00:00
ysaito1001 74ab9100ae
Support daily dry run release (#3548)
## Motivation and Context
Runs dry-run release workflow daily

## Description
We've had quite a few instances where we discovered that a dry-run
failed when we were about to release, by which time a good amount of
code changes were accumulated in the `main` branch. That sometimes made
it harder to investigate the underlying root cause, compared to if we
had run dry-run daily. To alleviate the issue, this PR runs a dry-run
release daily, ensuring that the `main` branch is in good shape to kick
off a prod release and that we can react to a dry-run failure caused by
a PR merged to the `main` the previous day.

To make this happen, the existing release workflow `release.yml` has
been converted to a reusable workflow (with `workflow_call`). This is
because a scheduled workflow run cannot take inputs, making it difficult
to pass `commit_sha` and the `dry_run` flag to it. With `release.yml`
being a reusable workflow, we have two new workflows calling
`release.yml`: `prod-release.yml` and `dry-run-release.yml`, both of
which we can manually trigger and we can also trigger the latter via
cron.

Note that there is no longer a checkbox `dry-run` that used to exist in
`release.yml`. Instead, we choose a corresponding workflow.

## Testing
Verified the previous workflows continued to work:
- manually triggered dry-run release
- manually triggered prod release

However, a scheduled dry-run has not been tested because we first need
to check-in `dry-run-release.yml` to main for a scheduled workflow to
kick-in. In other words, we'll do live test and see what happens (will
fix if any issues come up).

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-09 16:24:03 +00:00
ysaito1001 7db0f736fb
Create backport PRs automatically (#3558)
## Motivation and Context
Automatically opens backport PRs merging
`smithy-rs-release-1.x.y-release` to `main`.

## Description
A workflow `backport-pull-request.yml` can be called in two ways:
- called automatically when a prod release runs
- called manually when a patch fix has been made to
`smithy-rs-release-1.x.y-release` and needs to be back-ported

## Testing
- Triggered the workflow manually and confirmed [this (dummy)
PR](https://github.com/smithy-lang/smithy-rs/pull/3556) got created
- Triggered the workflow automatically and confirmed [this (dummy)
PR](https://github.com/smithy-lang/smithy-rs/pull/3557) got created

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-09 00:20:12 +00:00
ysaito1001 aff489bb21
Run canary as part of CI (#3525)
## Motivation and Context
CI now runs
[canary](https://github.com/smithy-lang/smithy-rs/tree/main/tools/ci-cdk/canary-lambda/src/latest)
on pull requests.

## Description
Historically, canary has been running only during releases and daily in
the
[aws-sdk-rust](https://github.com/awslabs/aws-sdk-rust/actions/workflows/canary.yaml)
repository. This presents a problem of action at a distance where a
potential bug that may hurt canary won't immediately be caught when a PR
is merged to `main` in `smithy-rs` (such as code under code under
`#[cfg(debug_assertions)]` was not used during canary's lambda execution
and the definition of an item only used under that resulted in unused
warning). This PR will address that problem.

PRs from forked repositories cannot run the `Canary` job (it will be
skipped). A maintainer can run it on their behalf within
`smithy-lang:smithy-rs` using a newly added [manual
workflow](https://github.com/smithy-lang/smithy-rs/pull/3525/files#diff-1b1b5b27850107cb97519c98de99d35a49b90277ccb52201b842e9b81feb5d47).

After we merge this to main, we will update the branch protection so
that the `Canary` job is required for merge, in addition to ` Matrix
Success ` (this will not affect PRs from forked repositories since the
`Canary` job will be skipped a skipped job will [report its status as
Success](https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution),
but a manual canary run should pass).

## Testing
- Verified a PR in `smithy-lang:smithy-rs` ran the canary
([passed](https://github.com/smithy-lang/smithy-rs/actions/runs/8473703578/job/23219021189?pr=3525)).
- Verified a PR in a `smithy-rs` fork cannot run the canary and
[indicated that a maintainer needs to run it
manually](https://github.com/smithy-lang/smithy-rs/actions/runs/8473799146/job/23218944122?pr=3528)
- Verified a maintainer can manually invoke the canary using a PR from a
fork
([passed](https://github.com/smithy-lang/smithy-rs/actions/runs/8474050953))
- Verified internal release pipeline passed with [the changes to
canary-runner](https://github.com/smithy-lang/smithy-rs/pull/3525/files#diff-cc953ba68fec8cf937e1aa70181a901150fc5f1a74bf6ca1075d522c63d1eb6f)

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-08 23:44:07 +00:00
Russell Cohen 09ba40e66b
Add FIPS support to Hyper 1.0 Client (#3539)
## Description
This does several things:
1. Upgrade to RusTLS 0.23 which enables FIPS support
2. Add smoke test of the clients. This revealed a bug where https URLs
were not supported.

This is technically a breaking change because I added `non_exhaustive`
to the CryptoMode enum.

<!--- Describe your changes in detail -->

## Testing
New integration tests. I expect this to fail in CI since I'll need to
update the build image to match.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-02 18:02:13 +00:00
Russell Cohen 0b9a2b8e89
Remove flags from release (#3521)
## Motivation and Context
This removes the (unneeded) flags from the smithy-rs release job that
set the stable/unstable versions.

## Testing
- [x] ran a dry run on the branch

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-29 14:30:38 +00:00
Russell Cohen 58d40b7686
Update CI to check for semver hazards on pull requests (#3535)
## Motivation and Context
We've hit issues several times where semver hazards were not discovered
until release. Now that we've removed version arguments, we can now run
this test on PRs.


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-28 14:11:15 -07:00
ysaito1001 0694727eb8
Add empty workflow for manually running canary in smithy-rs on behalf of external contributors (#3517)
## Motivation and Context
The same reason for #3500, which is GitHub actions do not allow us to
manually trigger them unless they are first checked-in to the main
branch.

## Description
This PR adds a skeletal workflow file for manually invoking canary
within `smithy-lang/smithy-rs` on behalf of external contributors.
Forked repositories will be missing repository secrets to run the canary
in CI so it will always fail for external contributors. As a workaround,
maintainers will manually trigger `manual-canary.yml`, given a PR number
from an external contributor as input.

A subsequent PR will fill in the blank.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-27 15:12:06 +00:00
ysaito1001 2561e01afc
Allow artifacts of the same name to be overwritten (#3509)
## Motivation and Context


## Description
After [upgrading to
actions/upload-artifact@v4](https://github.com/smithy-lang/smithy-rs/pull/3497),
it seems to have brought a behavior change where an artifact with the
same name is [disallowed by
default](https://github.com/smithy-lang/smithy-rs/actions/runs/8423689643/job/23067178393#step:4:639)
within a workflow run.

This happened during a
[release](https://github.com/smithy-lang/smithy-rs/blob/main/.github/workflows/release.yml)
workflow where it first invoked ci.yml (which then called
`generate-smithy-rs-release` and created an artifact with that action
name) and then called `generate-smithy-rs-release` by itself (attempted
to create an artifact with that action name again, leading to the error
above). This was not a problem previously when we were using
`actions/upload-artifact@v3`.

This PR explicitly sets `overwrite: true` to bring back the old behavior
for a place that's affected.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-25 18:28:19 +00:00
ysaito1001 9c6f7e64db
Add empty workflow for running canary in `aws-sdk-rust` from `smithy-rs` CI (#3500)
## Motivation and Context
Add a skeletal workflow file for later invoking canary in `aws-sdk-rust`
from within `smithy-rs` CI. GitHub actions do not allow us to manually
trigger them unless they are first checked-in to the main branch.

(**Disclaimer**: we may end up executing `canary-runner` from a
smithy-rs CI step without invoking canary in `aws-sdk-rust`, but for the
sake of illustration, assume we invoke canary in `aws-sdk-rust` for the
rest of the PR description)

## Description
To briefly explain where we're going, a diagram below illustrates how
relevant workflow files look like when we run canary in `smithy-rs` CI
(in the context of this PR, it will check-in a file that says
`canary.yml` in red).

<p align="center">
<img width="600" alt="Screen Shot 2023-02-08 at 3 47 05 PM"
src="https://github.com/smithy-lang/smithy-rs/assets/15333866/4a336f7b-8d41-42e4-b59d-4aa87ab91093">
</p>

We will add a new CI step that runs canary in `aws-sdk-rust` from within
`smithy-rs`. It will work when run as part of `cr-pr.yml` but it won't
when run from `cr-pr-forks.yml` (i.e. for external contributors) because
their forked repos do not have a necessary repository secret to invoke
canary in `aws-sdk-rust`. To work around, we will manually run
`smithy-lang/smithy-rs/.github/workflows/canary.yml` on their behalf
with the name of a fork and a commit hash.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-20 19:54:23 +00:00
Zelda Hessler 08f33e0279
Update GitHub actions to fix deprecation warning (#3497)
Our workflows used outdated actions and that was causing deprecation
warnings for Node v16. Those annoyed me so I updated everything.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-19 18:12:30 +00:00
Russell Cohen c9786d6f56
switch to fetch unshallow (#3480)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-12 17:17:21 +00:00
Russell Cohen 3fa6d83599
unshallow git history prior to pushing (#3479)
## Motivation and Context
I'm not sure what changed but I was able to reproduce the failure from
https://github.com/smithy-lang/smithy-rs/actions/runs/8242141624/job/22564640708
with the downloaded release artifact. Because the clone was shallow, git
did not attempt to push because the histories were unrelated.

Of course, they are in reality, but because the history is shallow git
doesn't know that.

I verified this allowed a dry run push to succeed locally.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-12 15:39:28 +00:00
Russell Cohen f68b5eeaa9
Add Initial Support for Hyper 1.0 (#3461)
## Motivation and Context
- #1925 

## Description
This adds a minimal Hyper client, focusing on not exposing any unstable
APIs. For this reason, the `Client::Builder` customization API is not
exposed anymore. We do this because at some point in the future, we will
likely move away from the hyper-util based Client.

The code for this was lifted directly from the Hyper 0.14 implementation
but updated for new traits.

However, this does come with some new valuable pieces:
1. Support for aws-lc (no FIPS yet)
2. Support for providing a custom DNS resolver

## Testing
- E2E test with Hyper. A Canary should also be added
(https://github.com/awslabs/aws-sdk-rust/issues/1089)

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-07 10:57:57 -08:00
Zelda Hessler b77c52944c
Update release.yml (#3437)
See https://github.com/smithy-lang/smithy-rs/pull/3436

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-22 20:44:52 +00:00
Zelda Hessler 278b0b6678
Update credentials-verification.yml (#3436)
According to [these
docs](https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials),
we should be able to just set an env var instead of calling `cargo
login`.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-22 20:26:35 +00:00
John DiSanti b382ebc063
Upgrade cargo-check-external-types to 0.1.11 (#3413)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-21 14:28:25 +00:00
John DiSanti 4c3848d319
Fix credentials-verification workflow (#3425)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-17 02:09:42 +00:00
Russell Cohen 40f44cee6c
Rust msrv 1.74 (#3410)
## Motivation and Context
Update MSRV to 1.74

## Description
Normal slate of things, mostly appeasing clippy.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
2024-02-16 21:15:48 +00:00
John DiSanti 0be5cb32bc
Add CI step to release workflow to check for semver hazards (#3383)
This CI step will check for subtle semver hazards with the `ConfigBag`
during release. Once all the runtime crates are independent, then this
check can be moved into normal CI.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-09 00:15:38 +00:00
John DiSanti bcfabede3d
Fix rustdoc CI (#3395)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-07 18:54:39 +00:00
John DiSanti 6ffd99000b
Implement runtime-versioner audit tool (#3332)
This PR implements a build tool to audit runtime crate versions as part
of CI and release. If a runtime crate doesn't have the special
`0.0.0-smithy-rs-head` version number, then it is assumed to be
independently versioned, and the audit tool will verify it is version
bumped when any changes are made to it.

Given that there isn't a complete/reliable semver checking tool for Rust
yet, this tool isn't smart. It will rely on devs to correctly bump the
version number when that is done.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-11 23:20:36 +00:00
Russell Cohen 7093ea60e7 Various missing precommit updates 2023-12-20 10:38:49 -05:00
david-perez 1bb0349e5d
Update server TLS example to showcase how to extract connection information (#3023)
Showcase how to pass TLS derived information to server operation
handlers, like the certificate chain presented by the client.

To test, run `RUST_LOG=pokemon_service_tls=DEBUG cargo run` and `curl -v
--insecure https://localhost:13734/do-nothing`. Alternatively, run the
tests using `RUST_LOG=pokemon_service_tls=DEBUG cargo test`, which have
been updated to hit the operation that logs the TLS connection derived
information.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-19 15:53:37 +00:00
John DiSanti aa1f556ae0
Upgrade nightly used in CI (#3073)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2023-12-14 11:30:23 -08:00
ysaito1001 b180199f6a
Add daily credentials verification workflow (#3314)
## Motivation and Context
Adds a daily credentials verification workflow

## Description
We rotate credentials manually. Those credentials are
`RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN` and
`RELEASE_AUTOMATION_BOT_PAT`. While the validity of those credentials
are checked during dry-runs of [the release
workflow](https://github.com/smithy-lang/smithy-rs/blob/main/.github/workflows/release.yml)
we've had instances where a dry-run failed because it was not idempotent
and we nevertheless kicked off a production run, only to find out the
token was invalid. This raises the need for daily credentials
verification, and the PR adds one.

The workflow will check the validly of two credentials
`RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN` and
`RELEASE_AUTOMATION_BOT_PAT`, each checked by a separate job. Upon
failure, a job will notify us as follows:

<img width="1056" alt="Screenshot 2023-12-12 at 6 26 40 PM"
src="https://github.com/smithy-lang/smithy-rs/assets/15333866/1105b26b-7064-4ba2-849a-5969d59f1dd4">

## Testing
Manually triggered failures and got the messages in the above
screenshot. Also verified a successful run with valid credentials.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-14 17:23:29 +00:00
ysaito1001 e42d8cd987
Add skeletal workflow file for credentials verification (#3310)
## Motivation and Context
To manually trigger a workflow, the workflow file needs to have a
revision in the main branch. This PR adds an empty workflow file for
credentials verification. A subsequent PR will fill the contents.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-12 20:37:33 +00:00
ysaito1001 bd9ad10ec2
Run `semver-checks` on PRs submitted by external contributors (#3291)
## Motivation and Context
Enables `cargo semver-checks` in CI for PRs created by external
contributors

## Description
For instance, we skipped a run of `cargo semver-checks` in
https://github.com/smithy-lang/smithy-rs/pull/3286 and failed to detect
[a breaking
change](https://github.com/smithy-lang/smithy-rs/pull/3286#discussion_r1416479632)
programmatically.

With this PR, the workflow will run a job `semver-checks` even if the
preceding jobs `save-docker-login-token` or `acquire-base-image` are
skipped. Those jobs are relevant when the PR made changes to build
tools, which is less likely for PRs created by external contributors, so
it's reasonable to skip them and still run the `semver-checks` job.

Furthermore, this PR enables `semver-checks` to run against all crates
in `tmp-codegen-diff/aws-sdk/sdk/`, not just those limited by
`list(os.listdir())[:10]`.

## Testing
Tested the change against [a dummy
PR](https://github.com/smithy-lang/smithy-rs/pull/3288) I created from
my fork of `smithy-rs`. Specifically, `semver-checks` [caught the
aforementioned breaking
change](https://github.com/smithy-lang/smithy-rs/actions/runs/7121830175/job/19391798131#step:4:681)
in CI.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-07 17:50:35 +00:00
ysaito1001 1c445774d0
Use a `rustv1` directory from `aws-doc-sdk-examples` (#3287)
## Motivation and Context
This PR is a cleanup after
https://github.com/smithy-lang/smithy-rs/pull/3115, fully switching to
`rustv1` for the rust example directory in
[aws-doc-sdk-examples](https://github.com/awsdocs/aws-doc-sdk-examples).

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-06 23:00:41 +00:00
ysaito1001 28da3c5fde
Stop tagging releases as prereleases (#3259)
## Motivation and Context
Now that we have started [stable
releases](https://github.com/smithy-lang/smithy-rs/releases) since
`release-2023-11-21`, we shouldn't set those as pre-releases.

(this PR also includes a small fix to the `Release` job in our release
workflow to avoid `git push` failing during dry-runs, which [a previous
dry-run](https://github.com/smithy-lang/smithy-rs/actions/runs/6989359794)
ran into)

## Description
The fix is in `changelogger`, and this should remove pre-releases from
releases in `smithy-rs` as well as those in `aws-sdk-rust`.

## Testing
Ran a
[dry-run](https://github.com/smithy-lang/smithy-rs/actions/runs/7007835035)
and checked the release artifacts as follows:
```
{
  "tagName": "release-2023-11-27",
  "name": "November 27th, 2023",
  "body": "",
  "prerelease": false
}
```

Have not verified what a release manifest looks like in `aws-sdk-rust`,
but I suspect `prerelease: false` should be applied there as well given
the same `changelogger` is used.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-27 21:14:53 +00:00
Russell Cohen 505c0dbfd2
Use the `rust-launch` from the the docs repo (#3240)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-20 21:30:19 -05:00
ysaito1001 68eade9f6b
Add a job to release workflow that checks the current actor for prod run (#3207)
## Motivation and Context
In our GitHub [release
workflow](https://github.com/smithy-lang/smithy-rs/actions/workflows/release.yml),
we require production runs to be triggered by the bot user
`aws-sdk-rust-ci`, which has special permissions. There are times we
have triggered a production run by our own actors and later realized it
wasn't the bot user.

Although there is a way to recover from that (logging in as the bot user
and rerunning the failed step), it's so much easier to add the initial
check to the workflow, especially when that's cheap to add. This PR,
therefore, adds a job `check-actor-for-prod-run` to the workflow.

Note that if it's a dry-run, `check-actor-for-prod-run` will be skipped
and the rest of the jobs in the workflow will be executed normally.

## Testing
Tested the following scenarios using the release workflow:
- making sure that `check-actor-for-prod-run` will be skipped in a
dry-run and the dry-run should succeed
([link](https://github.com/smithy-lang/smithy-rs/actions/runs/6886643811))
- making sure that `check-actor-for-prod-run` will kick in for a prod
run and let the prod run fail if run by me
([link](https://github.com/smithy-lang/smithy-rs/actions/runs/6886709963/job/18732793128))
- making sure that `check-actor-for-prod-run` will kick in for a prod
run and let the prod run proceed if run by the bot user
([link](https://github.com/smithy-lang/smithy-rs/actions/runs/6886738756/job/18732857316)
- I canceled the run as soon as I conformed the check worked)
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-16 20:19:50 +00:00
ysaito1001 c0f72fbfe8
Enable stable & unstable versions in release workflow (#3201)
## Motivation and Context
Addresses `TODO(GA)` from
https://github.com/smithy-lang/smithy-rs/pull/3082

## Description
This small PR will remove a guard so we can truly specify different
versions for stable crates and unstable crates. Previously, whatever
that's entered in `Stable semantic version` in the release workflow
textbox (see a screenshot in the above PR) is overwritten by what's
entered in `Unstable semantic version`. With this PR, whatever that's
entered in `Stable semantic version` will make its way to
`smithy.rs.runtime.crate.stable.version` in `gradle.properties`.

In addition, with this PR, the name of a release branch is derived from
what we enter in `Stable semantic version` in the release workflow
textbox.

## Testing
~~It has been tested in the above PR.~~

EDIT:
Found a bug I introduced in the above PR where `publisher` was not
reading a metadata `package.metadata.smithy-rs-release-tooling`
correctly in a manifest file. Fixed it in c477d2f, confirmed that a
[dry-run](https://github.com/smithy-lang/smithy-rs/actions/runs/6872502257)
passed, and verified the release artifact contained both stable crate
versions & unstable versions as expected.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-15 17:05:43 +00:00