Skip to content

Conversation

et22
Copy link

@et22 et22 commented Aug 24, 2020

Issue #, if available:

Description of changes:

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

@et22 et22 force-pushed the tracefile_naming branch 3 times, most recently from 939599c to a719663 Compare September 3, 2020 19:55
@srchase srchase changed the base branch from master to main January 8, 2021 19:04
@srchase srchase force-pushed the tracefile_naming branch from a719663 to c1f9e00 Compare May 20, 2021 14:25
@srchase srchase force-pushed the tracefile_naming branch from c1f9e00 to 9f8883f Compare May 20, 2021 14:29
@srchase srchase requested review from JordonPhillips and kstich May 20, 2021 15:06
@@ -372,6 +422,10 @@ private void generateClient(ServiceShape shape) {
boolean hasPaginatedOperation = false;

for (OperationShape operation : containedOperations) {
OperationShape finalOperation = operation;
Copy link
Contributor

Choose a reason for hiding this comment

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

This new block seems like it might not be right.

Copy link
Contributor

@srchase srchase May 24, 2021

Choose a reason for hiding this comment

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

I removed the redundant variable and the block.

@@ -18,6 +18,7 @@ extra["displayName"] = "Smithy :: Typescript :: Codegen"
extra["moduleName"] = "software.amazon.smithy.typescript.codegen"

dependencies {
api("software.amazon.smithy:smithy-aws-traits:[1.7.2, 2.0[")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're looking to avoid taking this dependency in this package. It'll require changing the resolution of the serviceId for creating a TraceMetadata in the CodegenVisitor, but seems like the right call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that makes sense. Updated to remove the dependency and this will now just use the service name.

@srchase srchase force-pushed the tracefile_naming branch from 0f5629f to c83c380 Compare May 24, 2021 21:49
@srchase srchase changed the title Tracefile creation WIP Tracefile creation May 26, 2021
return Symbol.builder().putProperty("shape", shape).name(typeName);
return Symbol.builder()
.putProperty("shape", shape)
.putProperty("traceFileNamespace", moduleNameDelegator.formatModuleName(shape, null))
Copy link
Contributor

Choose a reason for hiding this comment

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

These calls to the moduleNameDelegator are causing issues for the model chunking. This needs address before the PR can be merged. Testing with regenerating an existing client should be performed to assure that the model chunking isn't changed unnecessarily for an existing client.

}

private Symbol.Builder createSymbolBuilder(Shape shape, String typeName, String namespace) {
return Symbol.builder()
.putProperty("shape", shape)
.name(typeName)
.namespace(namespace, "/");
.namespace(namespace, "/")
.putProperty("traceFileNamespace", moduleNameDelegator.formatModuleName(shape, null))
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment above. Another call to moduleNameDelegator that should be addressed.

@alexforsyth
Copy link
Contributor

Can you run codegeneration? It's hard to see what changes this results in

@alexforsyth alexforsyth self-requested a review May 26, 2021 17:50
@@ -212,6 +249,13 @@ void execute() {
settings, model, protocol, symbolProvider, writers, protocolGenerator).run();
}

// Write the TraceFile.
TracingSymbolProvider traceProvider = (TracingSymbolProvider) symbolProvider;
String traceName = symbolProvider.toSymbol(service).getName().replace("Client", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Notable that the replace here won't do anything for ssdks. That's probably fine though because we don't want them to share a filename, even if they can't be generated in the same plugin.

Symbol targetSymbol = toSymbol(targetShape)
.toBuilder()
.putProperty("model", model)
.putProperty("SymbolProvider", this)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe? Any plugin that wraps the symbol provider could trip this up. Ideally they wouldn't, since they shouldn't touch members or unions, but it could become an issue.

Comment on lines +144 to +145
.addTag(TypeScriptShapeLinkProvider.REQUEST_TAG, "AWS SDK request type")
.addTag(TypeScriptShapeLinkProvider.RESPONSE_TAG, "AWS SDK response type")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.addTag(TypeScriptShapeLinkProvider.REQUEST_TAG, "AWS SDK request type")
.addTag(TypeScriptShapeLinkProvider.RESPONSE_TAG, "AWS SDK response type")
.addTag(TypeScriptShapeLinkProvider.REQUEST_TAG, "Smithy client request type")
.addTag(TypeScriptShapeLinkProvider.RESPONSE_TAG, "Smithy client response type")

@et22 et22 requested a review from a team as a code owner April 4, 2022 21:19
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