Rename the runtime namespace from smithy to opal (#201, surface 1 of 3) - #207
Conversation
616acb9 to
abfbc1d
Compare
a5b61c3 to
43444aa
Compare
|
Generated by Claude Code |
|
Correction to the above: the re-run request was refused ( Generated by Claude Code |
a90eb0c to
1c63b58
Compare
Smithy is the IDL a service is described in, not a property of its JSON codec, its HTTP transport, or its Outcome type. Every `smithy::` scope and `namespace smithy` becomes `opal`: the hand-written runtime, tests, examples, fuzz targets and docs; the 26 codegen emitters that print the namespace into generated code; and the goldens, regenerated from those emitters rather than edited. The generated protocol-conformance suites move with it to `opal::protocoltests::…`, so their headers move to `include/opal/protocoltests/`. What keeps `smithy`: Smithy namespaces in `.smithy` models, the `smithy_cpp_*_library` rules that consume them, the codegen plugin, and the rules-test fixture's `smithy::cpp::ruletest`, which mirrors its own model's Smithy namespace and is the consumer's C++ namespace, not the runtime's. The include root, include guards, `SMITHY_*` macros, the `smithy:` log prefix and the Bazel module are surfaces 2 and 3, each its own PR. Breaking on a pre-1.0 minor per docs/versioning.md; the CHANGELOG carries the migration, which is one substitution over a consumer's tree. The out-of-tree consumer module needed exactly that and nothing else. ADR-0024 records the decision and the sequencing.
1c63b58 to
3f5e5ee
Compare
ReviewLGTM — surface 1 of #201 is scoped correctly and the rename looks complete. ADR-0024’s model-vs-runtime rule holds on the branch, and CI is green across the full matrix on What looks right
Should-fix (docs)CHANGELOG migration recipe vs. “leave model-derived namespaces alone.” The Breaking entry says migration is Tighten the recipe to something like: substitute the runtime prefixes ( Nits (non-blocking)
No correctness issues found; happy to see this land. |
A blind smithy:: -> opal:: substitution also renames a C++ namespace a consumer derived from a model whose Smithy namespace starts with smithy., which the CHANGELOG told them to leave alone in the next sentence. Spell the recipe with that exclusion and the list of runtime scopes it applies to; same note in ADR-0024's consequences.
Part of #201. Records the decision as ADR-0024; the issue closes with the third surface.
Targets
maindirectly now that #199 and #206 have merged; the diff is the rename alone. (Earlier revisions of this PR usedsable; the name is nowopal, chosen after checking it is free on the Bazel Central Registry, vcpkg and Conan Center, and that the only C++ neighbor is the dormant OPAL VoIP library.)What
Option 3 from #201: rename outright, no alias, one PR per surface. This is the first surface, the C++ namespace. The runtime is
opal:Every
smithy::scope andnamespace smithybecomesopal: the hand-written runtime, tests, examples, fuzz targets and docs; the 26 codegen emitters that print the namespace into generated code; and the goldens, regenerated from those emitters rather than edited — a freshgradle generateFixtures generateProtocolTestson this head is byte-identical to what is checked in. The generated protocol-conformance suites move with it toopal::protocoltests::…, so their headers move toinclude/opal/protocoltests/and their guards toOPAL_PROTOCOLTESTS_*(both derive from the configured C++ namespace, not from the runtime's include root; they were always generated code that refers to the runtime, not a model).Unchanged in this PR, by design: the runtime's include root (
smithy/http/transport.h), its include guards andSMITHY_*macros, thesmithy:prefix on the runtime's own log lines, and the Bazel module@smithy_cpp. Those are surfaces 2 and 3, each its own PR, per the issue's "a mixed one is unreviewable".What keeps
smithy, and whyThe rule the audit applies: a name that refers to the model keeps it; a name that refers to a runtime thing that would exist identically had the service been hand-written does not.
.smithyfiles (smithy.cpp.protocols#jsonRpc2), thesmithy_cpp_*_libraryrules, the codegen plugin, prose about "the Smithy operation".smithy::cpp::ruletest: it mirrors its own model'ssmithy.cpp.ruletestnamespace, so it is the consumer's C++ namespace and the rule's derivation test depends on that spelling. The first pass caught it and the.smithyfiles'namespace smithy.cpp.…lines; both reverted, and the ADR names them so the next two surfaces don't repeat it.Breaking
Pre-1.0 minor, per
docs/versioning.md; the CHANGELOG carries the Breaking entry with the migration:smithy::→opal::,namespace smithy→namespace opal, constrained to the runtime's scopes for a consumer whose own model namespace starts withsmithy.(the fixture case above). The out-of-tree consumer module inexamples/bazel-consumerneeded exactly the unconstrained substitution and nothing else.Churn to expect in the diff
The shorter name let clang-format re-wrap many lines and spotless re-wrap five Java files, so the hand-written diff is larger than the rename alone. The generated diff is a pure token substitution plus the protocol-test header moves.
CHANGELOG.md's released sections keep their historical names; only[Unreleased]was renamed.Testing
bazel test //... --config=werror: 129 tests pass.examples/bazel-consumer: 15 tests pass against the renamed runtime, with only the substitution applied to its sources.--config=noexceptbuild of every runtime library passes.cd codegen && gradle build spotlessCheck: Java tests (they assert on the emitted namespace) and formatting pass.git diff --exit-code -- examples protocol-testsis empty), which is what the codegen CI job checks.Not run here: sanitizers and clang-tidy (a rename cannot change what they see; CI runs both).
Checklist
bazel test //...and(cd codegen && gradle build spotlessCheck)pass locally🤖 Generated with Claude Code
https://claude.ai/code/session_01Jj5X2fKdgrYurHmbwLzUiQ