You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tooling/common/serialization.py shims can drift silently across extension tools/ copies #88
From the codebase observations in #82 (kept out of the docs there):
tooling/common/serialization.py is copied into each extension's tools/serialization.py as a shim, and its own docstring says the NATS copy was the most recently updated at dedup time: the copies can drift silently. Consolidating on a single shared import (or a lint that hashes them) would remove that risk.
Suggested fix: consolidate on a single shared import, or add a lint/CI check that hashes all copies of the shim and fails when they differ.
@colinjlacy , I'd like to take this one, with the check rather than the consolidation.
I compared the four tools/serialization.py copies. Three are identical, and the one under tooling/smithy-runtime-conditions/ differs in a single line: parents[3] instead of parents[4], because it sits one directory level higher. So a plain hash comparison would fail today.
My plan is a unit test under tooling/common that finds every tools/serialization.py, checks that each one matches the shim text apart from that depth, and checks that the depth points at the repo root. It would run in the existing Tests workflow. Does that fit what you had in mind?
@vvardan007 I think it might be better to just have a shared import. One place to maintain it, instead of multiple copies to keep aligned, even with (or, especially with?) failing builds to remind us that we forgot to update one 😅
Agreed, one place is better. I'll go with the shared import:
delete the four tools/serialization.py copies;
in the ten scripts that use them, put tooling/common on sys.path and import the module directly, the way tooling/extension-bindings/ci/publish.py already does;
add the same line to the Kubernetes and NATS test_compile_extension.py, which import serialization themselves.
I will share the pr shortly. Please assign this issue to me.
Wait, hold on. These files shouldn't even exist in the first place. They were added as part of the SDK experiments that ended in September as a complete and utter failure.
Sorry, when I hear about four copies of a single file my brain automatically goes to "that's bad, we should have one." But in reality we shouldn't have any. The tooling/ folders in all of those extension folders can be straight up deleted.
Understood, deleting them is simpler still. Before I change anything, here is what goes with those folders, so you can confirm the scope.
The three tools/ folders under catalog/:
Folder
Scripts
What depends on it
catalog/aws/s3/tools
4
One mention in catalog/aws/s3/model/README.md
catalog/kubernetes/api/tools
2
catalog/kubernetes/api/tests (2 files), the tool commands in the README, requirements.txt
catalog/nats/service/tools
1
catalog/nats/service/tests, the compile command in the README, requirements.txt
Deleting them means these have to go in the same PR, or CI breaks:
the Kubernetes and NATS test folders, which import the tools;
in tests.yml: the two pytest lines for those folders, and the service-operations-inventories checkout and symlink steps, which only the NATS tests use;
the tool instructions in the three READMEs, and the NATS paragraph in CONTRIBUTING.md;
the two requirements.txt files, which exist only for the tools.
Two questions:
tooling/smithy-runtime-conditions/ is the fourth place with a tools/ folder and a copy of the shim. It is not under an extension folder, and smithy-maintenance.yml runs it daily against S3. Should it go as well, together with that workflow, or stay?
I would leave the data those tools read and wrote: the model/ bridges and generated mappings, and the S3 mappings/, maintenance/ and evidence/ folders. Tell me if any of that should go too.
No good reason. I just hadn't checked whether anything still used them. Nothing in the bindings or tooling does, so they go too.
I'll do for Kubernetes and NATS what #107 did for S3: keep the README, examples/ and releases/, delete the rest, and clean up tests.yml, CONTRIBUTING.md and both READMEs to match.
Should SERVICE_OPERATIONS_SEMANTIC_BRIDGES.md go in the same PR? After this no extension has a bridge. @colinjlacy
No good reason. I just hadn't checked whether anything still used them. Nothing in the bindings or tooling does, so they go too.
I'll do for Kubernetes and NATS what #107 did for S3: keep the README, examples/ and releases/, delete the rest, and clean up tests.yml, CONTRIBUTING.md and both READMEs to match.
Should SERVICE_OPERATIONS_SEMANTIC_BRIDGES.md go in the same PR? After this no extension has a bridge. @colinjlacy
Activity
vvardan007 commentedon Nov 29, 2026
@colinjlacy , I'd like to take this one, with the check rather than the consolidation.
I compared the four
tools/serialization.pycopies. Three are identical, and the one undertooling/smithy-runtime-conditions/differs in a single line:parents[3]instead ofparents[4], because it sits one directory level higher. So a plain hash comparison would fail today.My plan is a unit test under
tooling/commonthat finds everytools/serialization.py, checks that each one matches the shim text apart from that depth, and checks that the depth points at the repo root. It would run in the existingTestsworkflow. Does that fit what you had in mind?colinjlacy commentedon Nov 29, 2026
@vvardan007 I think it might be better to just have a shared import. One place to maintain it, instead of multiple copies to keep aligned, even with (or, especially with?) failing builds to remind us that we forgot to update one 😅
vvardan007 commentedon Nov 30, 2026
Agreed, one place is better. I'll go with the shared import:
tools/serialization.pycopies;tooling/commononsys.pathand import the module directly, the waytooling/extension-bindings/ci/publish.pyalready does;test_compile_extension.py, which importserializationthemselves.I will share the pr shortly. Please assign this issue to me.
colinjlacy commentedon Nov 30, 2026
Wait, hold on. These files shouldn't even exist in the first place. They were added as part of the SDK experiments that ended in September as a complete and utter failure.
Sorry, when I hear about four copies of a single file my brain automatically goes to "that's bad, we should have one." But in reality we shouldn't have any. The
tooling/folders in all of those extension folders can be straight up deleted.vvardan007 commentedon Nov 30, 2026
Understood, deleting them is simpler still. Before I change anything, here is what goes with those folders, so you can confirm the scope.
The three
tools/folders undercatalog/:catalog/aws/s3/toolscatalog/aws/s3/model/README.mdcatalog/kubernetes/api/toolscatalog/kubernetes/api/tests(2 files), the tool commands in the README,requirements.txtcatalog/nats/service/toolscatalog/nats/service/tests, the compile command in the README,requirements.txtDeleting them means these have to go in the same PR, or CI breaks:
tests.yml: the twopytestlines for those folders, and theservice-operations-inventoriescheckout and symlink steps, which only the NATS tests use;CONTRIBUTING.md;requirements.txtfiles, which exist only for the tools.Two questions:
tooling/smithy-runtime-conditions/is the fourth place with atools/folder and a copy of the shim. It is not under an extension folder, andsmithy-maintenance.ymlruns it daily against S3. Should it go as well, together with that workflow, or stay?model/bridges and generated mappings, and the S3mappings/,maintenance/andevidence/folders. Tell me if any of that should go too.colinjlacy commentedon Dec 2, 2026
@vvardan007 you can ignore the S3 extension. @itvi-1234 already got to that one when he closed #85.
Why would you leave the data that those tools wrote? The model bridges, generated mappings, etc.?
vvardan007 commentedon Dec 3, 2026
No good reason. I just hadn't checked whether anything still used them. Nothing in the bindings or tooling does, so they go too.
I'll do for Kubernetes and NATS what #107 did for S3: keep the README,
examples/andreleases/, delete the rest, and clean uptests.yml,CONTRIBUTING.mdand both READMEs to match.Should
SERVICE_OPERATIONS_SEMANTIC_BRIDGES.mdgo in the same PR? After this no extension has a bridge. @colinjlacyvvardan007 commentedon Dec 3, 2026
No good reason. I just hadn't checked whether anything still used them. Nothing in the bindings or tooling does, so they go too.
I'll do for Kubernetes and NATS what #107 did for S3: keep the README,
examples/andreleases/, delete the rest, and clean uptests.yml,CONTRIBUTING.mdand both READMEs to match.Should
SERVICE_OPERATIONS_SEMANTIC_BRIDGES.mdgo in the same PR? After this no extension has a bridge. @colinjlacyitvi-1234 commentedon Dec 3, 2026
@vvardan007 , That is also done in latest PR :)
Checkout #110
colinjlacy commentedon Dec 3, 2026
Fixed by #110