Skip to content

Changelog entries for client generation - #121

Merged
kuhe merged 3 commits into
developfrom
kuhe/chore/make_clients_v2
Nov 4, 2026
Merged

kuhe merged 3 commits into
developfrom
kuhe/chore/make_clients_v2

Conversation

@kuhe

@kuhe kuhe commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces an unversioned file called CODEGEN_SYNC_CHANGELOG.md in the root.

Prior to running make clients, which regenerates all clients from the target version in codegen/smithy-python.toml, the developer should fill in this file with the changelog prose.

If the file is not present, empty, or older than 8 hours, this error message appears:

aws-sdk-python% make clients

SMITHY_PYTHON=/local/home/georgfu/workspace/python/smithy-python uv run python codegen/gen_client.py --all --pinned --batch-size 25

created empty /local/home/georgfu/workspace/python/aws-sdk-python/CODEGEN_SYNC_CHANGELOG.md; 

write the changelog text for this codegen sync of https://github.com/smithy-lang/smithy-python/commits/6c2dfa2c689c2352985ffb05eef1bfc5e3a697e7..b8eceadb0573bd0c757def9a2b26fe7bf938b239
make: *** [Makefile:63: clients] Error 1

Use the link from this error message to fill in an appropriate changelog description before continuing to rerun make clients.

This time, each client will get a changelog fragment linking to the diff of smithy-python being generated, appended with what the developer wrote.

@kuhe
kuhe force-pushed the kuhe/chore/make_clients_v2 branch from 64a457d to d9c52ff Compare November 4, 2026 16:48
@kuhe
kuhe marked this pull request as ready for review November 4, 2026 16:53
@kuhe
kuhe requested a review from a team as a code owner November 4, 2026 16:53
Comment thread codegen/gen_client.py Resolved
rohangavankar
rohangavankar previously approved these changes Nov 4, 2026
Comment thread codegen/gen_client.py Outdated
text = SYNC_CHANGELOG.read_text().strip()
if not text:
sys.exit(f"{SYNC_CHANGELOG} is empty; {reminder}")
return f"Codegen sync for {changes} {text}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return f"Codegen sync for {changes} {text}"
return f"Codegen sync for {changes}: {text}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a URL, right? I don't want to append anything to it without spaces

@rohangavankar rohangavankar Nov 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is but a markdown renderer will still hyperlink and show the colon after, upto you if you want to keep

Example
Codegen sync for https://github.com/smithy-lang/smithy-python/commits/6c2dfa2c689c2352985ffb05eef1bfc5e3a697e7..b8eceadb0573bd0c757def9a2b26fe7bf938b239: Fixed retry jitter.

Comment thread codegen/gen_client.py Outdated
Comment on lines +329 to +330
fragment = (
dest / ".changes" / "next-release" / f"{name}-enhancement-codegen-sync.json"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include the target commit in this filename? If two codegen syncs happen before a release, the second one will overwrite the first sync’s changelog entry

Comment thread codegen/gen_client.py Outdated
Comment on lines +312 to +313
if sync_entry is not None and _changed(dest):
_write_sync_fragment(dest, name, sync_entry)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this sync's fragment be removed when the client ends up unchanged? If an earlier run changed it but a rerun doesn’t, the old fragment will stick around since .changes is preserved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated make clients fragments. Testing and daily release automation just run make clients, whereas official manual updates will run make clients fragments.

Comment thread codegen/gen_client.py Outdated
text = SYNC_CHANGELOG.read_text().strip()
if not text:
sys.exit(f"{SYNC_CHANGELOG} is empty; {reminder}")
return f"Codegen sync for {changes} {text}"

@arandito arandito Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendering the raw link is messy if this is going into the client's changelog.

Can we make this a markdown link?

Something like:

return f"Codegen sync for [smithy-python {previous[:7]}..{commit[:7]}]({changes}): {text}"

Before:

After:

  • Codegen sync for smithy-python b8ecead..6c2dfa2: Adds adaptive retries, client-side event streams for RPC protocols, lazy model loading, and Python 3.15 support.

@rohangavankar
rohangavankar dismissed their stale review November 4, 2026 18:43

More changes to be made

Comment thread codegen/gen_client.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only write these fragments when the pin actually moves? Feels like it would disrupt the normal flow of generating clients

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated make clients fragments. Only add fragments when the developer is actually bringing in a new smithy-python version with the hash pointer update.

For automation model updates or just testing, run only make clients. The determination is a little too sensitive to automate.

Comment thread codegen/smithy-python.toml Outdated
commit = "b8eceadb0573bd0c757def9a2b26fe7bf938b239"
# The commit this pointer moved from; with `commit` it bounds the range linked
# in codegen sync changelog entries.
previous_commit = "6c2dfa2c689c2352985ffb05eef1bfc5e3a697e7"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this range is backwards. 6c2dfa2 is 29 commits ahead of b8ecead, so the generated link shows “No commits.” Since this PR isn’t moving the pin, could matching hashes mean “no sync pending” until the next update?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set it to 5053125, it's only illustrative for now and will change on the first real manual codegen update.

Comment thread Makefile
Comment on lines +65 to +66
fragments:
uv run --no-project --python $(PYTHON_VERSION) python codegen/gen_fragments.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could fragments depend on clients? That keeps normal make clients unchanged, but makes sure fragments only get written after generation succeeds

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is a manual invocation so the developer could have run make clients and paused.

A small typo or error in fragments should not require rerunning client generation, which is time-consuming.

@kuhe
kuhe force-pushed the kuhe/chore/make_clients_v2 branch from 40fbf2c to 3181e11 Compare November 4, 2026 20:08
@kuhe
kuhe merged commit 6b76938 into develop Nov 4, 2026
4 checks passed
@kuhe
kuhe deleted the kuhe/chore/make_clients_v2 branch November 4, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants