Skip to content

Migration smithy initial setup#3861

Open
sbaluja wants to merge 15 commits into
mainfrom
migration-smithy
Open

Migration smithy initial setup#3861
sbaluja wants to merge 15 commits into
mainfrom
migration-smithy

Conversation

@sbaluja

@sbaluja sbaluja commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Issue #, if available:

Description of changes:

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

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

sbaluja added 15 commits June 29, 2026 15:09
- Fix CRITICAL bug: getShapeCppName() now properly handles empty-string resolutions from HARDCODED_COLLISION_RESOLUTIONS map
- Changed null-only check to check both null and empty string: resolved != null && !resolved.isEmpty()
- Empty strings indicate shapes removed from model (e.g., medialive BatchUpdateScheduleResult)
- Added test coverage: getHardcodedResolution and getShapeCppName for medialive empty-string case
- Added ServiceNameUtil documentation comment explaining serviceMap parameter reserved for future use
- Created ServiceNameUtilTest with capitalize tests
- Register ModelCodegenPlugin in SPI file and build.gradle.kts projections
- Fix CppWriter: set 2-space indent, enable trimTrailingSpaces
- Fix CppWriterDelegator: add UTF-8 BOM to match C2J output
- Fix CppTypeMapper: check enum before string (EnumShape extends StringShape),
  add default values for enum (NOT_SET), timestamp, and blob types
- Fix EnumRenderer: use wire values as C++ constants (not member names),
  single/multi-line format based on line length
- Fix MemberRenderer: non-templated setters for primitives and enums,
  enum-aware Add methods for lists, doc comment format escaping
- Fix ModelGenerator: proper namespace structure, indent class body,
  class-level doc comments, Input->Request / Output->Result naming,
  conditional <utility> include
- Fix SerdeStub: remove hardcoded indent (handled by writer)
- Update EnumRendererTest for new format
// Capital "Headers" is always renamed (no service exclusions)
return "headerValues";
}
return null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

dont return null ever, return a Optional<String> to force the caller to check

return "Aws::Utils::Document";
}
// Fallback for unrecognized shapes
return "Aws::String";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we throw a exception if we dont recognize the shape instead of falling back to string?

if (shape.isTimestampShape() || shape.isBlobShape()) {
return ""; // produces Type m_field{}; (value-initialization)
}
return null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto about returning null

if (shape.isDocumentShape()) {
return "<aws/core/utils/Document.h>";
}
return null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ill stop now

"throw", "true", "try", "typeid", "typename", "typeof", "union",
"unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while",
"xor", "xor_eq",
// Platform macros

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please throw "LINUX", "WINDOWS", "max" and "min" in here. they're just some of the ones i know dont work

renderJsonStub(writer, className);
} else if (protocol == Protocol.REST_XML) {
renderXmlStub(writer, className);
} else {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

noticing a lot of using a default when exausted, when in reality we likely should be throwing runtime exceptions when we know we havent reached a default, but in reality a known "bad" option. bad code gen should fail fast, not default

* @param requestShape the operation's input structure
* @param resultShape the operation's output structure (contains the streaming union member)
*/
public record EventStreamInfo(String operationName, StructureShape requestShape, StructureShape resultShape) {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

public record what java version are we using? this has a hard requirement on java 16

// Enum classification
if (shape.isEnumShape() || (shape.isStringShape() && shape.hasTrait(EnumTrait.class))) {
enums.add(shape);
continue;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

feels like we should be doing a if else block instead of using continues


class CppTypeMapperTest {

@Test

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

woah this is raising the bar for our codegen

@sbaluja sbaluja marked this pull request as ready for review July 13, 2026 17:44
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.

2 participants