Skip to content

Commit

Permalink
Switch to file-per-change changelog (#3774)
Browse files Browse the repository at this point in the history
## 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](83cda76)
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](efcc772)
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._
  • Loading branch information
ysaito1001 authored Aug 1, 2024
1 parent 63753f3 commit 10a9205
Show file tree
Hide file tree
Showing 23 changed files with 841 additions and 900 deletions.
10 changes: 10 additions & 0 deletions .changelog/.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Example changelog entry, Markdown with YAML front matter
# ---
# applies_to: ["client", "server", "aws-sdk-rust"] # "aws-sdk-rust" here duplicates this entry into release notes in `aws-sdk-rust`
# authors: ["rcoh"]
# references: ["smithy-rs#920"]
# breaking: false
# new_feature: false
# bug_fix: false
# ---
# Fix typos in module documentation for generated crates
Empty file removed .changelog/.keep
Empty file.
14 changes: 14 additions & 0 deletions .changelog/1722464864.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
applies_to:
- aws-sdk-rust
- client
authors:
- landonxjames
references:
- smithy-rs#3765
- smithy-rs#3757
breaking: false
new_feature: false
bug_fix: true
---
Fix incorrect redaction of `@sensitive` types in maps and lists.
12 changes: 12 additions & 0 deletions .changelog/1722464947.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
applies_to:
- client
authors:
- ysaito1001
references:
- smithy-rs#3767
breaking: false
new_feature: false
bug_fix: true
---
Fix client error correction to properly parse structure members that target a `Union` containing that structure recursively.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

## 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
- [ ] 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.
- [ ] 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.

----

Expand Down
30 changes: 0 additions & 30 deletions CHANGELOG.next.toml

This file was deleted.

4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ To send us a pull request, please:
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
5. Send us a pull request, answering any default questions in the pull request interface. To create a changelog entry Markdown file in the `.changelog` directory, you can do either of the following:
- Use the `new` subcommand of [changelogger](https://github.com/smithy-lang/smithy-rs/tree/main/tools/ci-build/changelogger) CLI (**preferred**)
- Create one manually. Name the file `XXX.md`, where `XXX` can be any name you choose, as long as it is unique in the `.changelog` directory. Ensure the contents follow Markdown syntax with the YAML front matter. For reference, see [.example](https://github.com/smithy-lang/smithy-rs/blob/3e250cf9f61ee17ccd66e16314d4e47f3dd95e25/.changelog/.example) or other Markdown files in the `.changelog` directory.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
7. Ask maintainers to manually trigger [canary](https://github.com/smithy-lang/smithy-rs/actions/workflows/manual-canary.yml) and [PR bot](https://github.com/smithy-lang/smithy-rs/actions/workflows/manual-pull-request-bot.yml) workflows using your pull request number. Those workflows cannot run in your fork and are always skipped as such.

Expand Down
18 changes: 9 additions & 9 deletions design/src/rfcs/rfc0042_file_per_change_changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RFC: File-per-change changelog
==============================

> Status: RFC
> Status: Implemented
>
> Applies to: client and server
Expand Down Expand Up @@ -119,15 +119,15 @@ entry on behalf of a contributor).
Changes checklist
-----------------

- [ ] Refactor changelogger and smithy-rs-tool-common to separate the changelog
- [x] Refactor changelogger and smithy-rs-tool-common to separate the changelog
serialization format from the internal representation used for rendering and splitting.
- [ ] Implement deserialization for the new Markdown entry format
- [ ] Incorporate new format into the `changelogger render` subcommand
- [ ] Incorporate new format into the `changelogger split` subcommand
- [ ] Port existing `CHANGELOG.next.toml` to individual entries
- [ ] Update `sdk-lints` to fail if `CHANGELOG.next.toml` exists at all to avoid losing
- [x] Implement deserialization for the new Markdown entry format
- [x] Incorporate new format into the `changelogger render` subcommand
- [x] Incorporate new format into the `changelogger split` subcommand
- [x] Port existing `CHANGELOG.next.toml` to individual entries
- [x] Update `sdk-lints` to fail if `CHANGELOG.next.toml` exists at all to avoid losing
changelog entries during merges.
- [ ] Dry-run test against the smithy-rs release process.
- [ ] Dry-run test against the SDK release process.
- [x] Dry-run test against the smithy-rs release process.
- [x] Dry-run test against the SDK release process.

[Changes Checklist]: #changes-checklist
Loading

0 comments on commit 10a9205

Please sign in to comment.